Skip to content

Commit 9015578

Browse files
committed
fix compiline error in release mode
1 parent 41fa2bc commit 9015578

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ StopPropagationTest::StopPropagationTest()
987987
auto keyboardEventListener = EventListenerKeyboard::create();
988988
keyboardEventListener->onKeyPressed = [](EventKeyboard::KeyCode /*key*/, Event* event){
989989
auto target = static_cast<Sprite*>(event->getCurrentTarget());
990+
CC_UNUSED_PARAM(target);
990991
CCASSERT(target->getTag() == TAG_BLUE_SPRITE || target->getTag() == TAG_BLUE_SPRITE2, "Yellow blocks shouldn't response event.");
991992
// Stop propagation, so yellow blocks will not be able to receive event.
992993
event->stopPropagation();

tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ bool UISliderNewEventCallbackTest::init()
396396
slider->addEventListener([=](Ref* widget,Slider::EventType type)
397397
{
398398
Slider* slider = (Slider*)widget;
399+
CC_UNUSED_PARAM(slider);
399400
if(type == Slider::EventType::ON_SLIDEBALL_DOWN)
400401
{
401402
CCLOG("slider button pressed!");

tests/cpp-tests/Classes/UnitTest/UnitTest.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ void TemplateVectorTest::onEnter()
161161
Vector<Node*> vec4(createVector());
162162
for (const auto& child : vec4)
163163
{
164+
CC_UNUSED_PARAM(child);
164165
CCASSERT(child->getReferenceCount() == 2, "child's reference count should be 2.");
165166
}
166167

@@ -184,6 +185,7 @@ void TemplateVectorTest::onEnter()
184185

185186
for (const auto& child : vec5)
186187
{
188+
CC_UNUSED_PARAM(child);
187189
CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2.");
188190
}
189191

@@ -276,6 +278,7 @@ void TemplateVectorTest::onEnter()
276278
CCASSERT(vec7.size() == 20, "vec7's size is 20.");
277279
for (const auto& child : vec7)
278280
{
281+
CC_UNUSED_PARAM(child);
279282
CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2.");
280283
}
281284

@@ -332,6 +335,7 @@ void TemplateVectorTest::onEnter()
332335

333336
for (const auto& child : vecSelfAssign)
334337
{
338+
CC_UNUSED_PARAM(child);
335339
CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2.");
336340
}
337341

@@ -340,6 +344,7 @@ void TemplateVectorTest::onEnter()
340344

341345
for (const auto& child : vecSelfAssign)
342346
{
347+
CC_UNUSED_PARAM(child);
343348
CCASSERT(child->getReferenceCount() == 2, "child's reference count is 2.");
344349
}
345350

@@ -388,13 +393,15 @@ void TemplateMapTest::onEnter()
388393
Map<std::string, Node*> map2 = createMap();
389394
for (const auto& e : map2)
390395
{
396+
CC_UNUSED_PARAM(e);
391397
CCASSERT(e.second->getReferenceCount() == 2, "e.second element's reference count is 2.");
392398
}
393399

394400
// Copy constructor
395401
Map<std::string, Node*> map3(map2);
396402
for (const auto& e : map3)
397403
{
404+
CC_UNUSED_PARAM(e);
398405
CCASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3.");
399406
}
400407

@@ -406,6 +413,7 @@ void TemplateMapTest::onEnter()
406413
CCASSERT(unusedNode->getReferenceCount() == 1, "unusedNode's reference count is 1.");
407414
for (const auto& e : map4)
408415
{
416+
CC_UNUSED_PARAM(e);
409417
CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2.");
410418
}
411419

@@ -414,6 +422,7 @@ void TemplateMapTest::onEnter()
414422
map5 = map4;
415423
for (const auto& e : map5)
416424
{
425+
CC_UNUSED_PARAM(e);
417426
CCASSERT(e.second->getReferenceCount() == 3, "e.second's reference count is 3.");
418427
}
419428

@@ -422,6 +431,7 @@ void TemplateMapTest::onEnter()
422431

423432
for (const auto& e : map4)
424433
{
434+
CC_UNUSED_PARAM(e);
425435
CCASSERT(e.second == map5.find(e.first)->second, "e.second can't be found in map5.");
426436
}
427437

@@ -465,6 +475,7 @@ void TemplateMapTest::onEnter()
465475

466476
// find
467477
auto nodeToFind = map4.find("10");
478+
CC_UNUSED_PARAM(nodeToFind);
468479
CCASSERT(nodeToFind->second->getTag() == 1010, "nodeToFind's tag value is 1010.");
469480

470481
// insert
@@ -510,6 +521,7 @@ void TemplateMapTest::onEnter()
510521

511522
for (const auto& e : mapForClearCopy)
512523
{
524+
CC_UNUSED_PARAM(e);
513525
CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2.");
514526
}
515527

@@ -531,6 +543,7 @@ void TemplateMapTest::onEnter()
531543

532544
for (const auto& e : mapForSelfAssign)
533545
{
546+
CC_UNUSED_PARAM(e);
534547
CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference count is 2.");
535548
}
536549

@@ -539,6 +552,7 @@ void TemplateMapTest::onEnter()
539552

540553
for (const auto& e : mapForSelfAssign)
541554
{
555+
CC_UNUSED_PARAM(e);
542556
CCASSERT(e.second->getReferenceCount() == 2, "e.second's reference's count is 2.");
543557
}
544558
}

0 commit comments

Comments
 (0)