MCPcopy Create free account
hub / github.com/axmolengine/axmol / StressTest2

Method StressTest2

tests/cpp-tests/Source/NodeTest/NodeTest.cpp:339–367  ·  view source on GitHub ↗

------------------------------------------------------------------ StressNodeTest2 ------------------------------------------------------------------

Source from the content-addressed store, hash-verified

337//
338//------------------------------------------------------------------
339StressTest2::StressTest2()
340{
341 auto s = Director::getInstance()->getWinSize();
342
343 auto sublayer = Layer::create();
344
345 auto sp1 = Sprite::create(s_pathSister1);
346 sp1->setPosition(Vec2(80.0f, s.height / 2));
347
348 auto move = MoveBy::create(3, Vec2(350.0f, 0.0f));
349 auto move_ease_inout3 = EaseInOut::create(move->clone(), 2.0f);
350 auto move_ease_inout_back3 = move_ease_inout3->reverse();
351 auto seq3 = Sequence::create(move_ease_inout3, move_ease_inout_back3, nullptr);
352 sp1->runAction(RepeatForever::create(seq3));
353 sublayer->addChild(sp1, 1);
354
355 auto fire = ParticleFire::create();
356 fire->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png"));
357 fire->setPosition(Vec2(80.0f, s.height / 2 - 50));
358
359 auto copy_seq3 = seq3->clone();
360
361 fire->runAction(RepeatForever::create(copy_seq3));
362 sublayer->addChild(fire, 2);
363
364 schedule(AX_CALLBACK_1(StressTest2::shouldNotLeak, this), 6.0f, "should_not_leak_key");
365
366 addChild(sublayer, 0, kTagSprite1);
367}
368
369void StressTest2::shouldNotLeak(float dt)
370{

Callers

nothing calls this directly

Calls 11

getInstanceFunction · 0.85
createFunction · 0.85
getTextureCacheMethod · 0.80
Vec2Function · 0.50
setPositionMethod · 0.45
cloneMethod · 0.45
reverseMethod · 0.45
runActionMethod · 0.45
addChildMethod · 0.45
setTextureMethod · 0.45
addImageMethod · 0.45

Tested by

no test coverage detected