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

Method shouldNotCrash

tests/cpp-tests/Source/NodeTest/NodeTest.cpp:302–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void StressTest1::shouldNotCrash(float dt)
303{
304 unschedule("should_not_crash_key");
305
306 auto s = Director::getInstance()->getWinSize();
307
308 // if the node has timers, it crashes
309 auto explosion = ParticleSun::create();
310 explosion->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png"));
311
312 // if it doesn't, it works Ok.
313 // auto explosion = [Sprite create:@"grossinis_sister2.png");
314
315 explosion->setPosition(Vec2(s.width / 2, s.height / 2));
316
317 runAction(Sequence::create(RotateBy::create(2, 360), CallFuncN::create(AX_CALLBACK_1(StressTest1::removeMe, this)),
318 nullptr));
319
320 addChild(explosion);
321}
322
323// remove
324void StressTest1::removeMe(Node* node)

Callers

nothing calls this directly

Calls 8

getInstanceFunction · 0.85
createFunction · 0.85
runActionFunction · 0.85
getTextureCacheMethod · 0.80
Vec2Function · 0.50
setTextureMethod · 0.45
addImageMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected