From e2935200577585b851c37549a0badb27a38aaeac Mon Sep 17 00:00:00 2001 From: mogemimi Date: Mon, 6 Mar 2017 11:01:53 +0900 Subject: [PATCH] Fix some local variable names in tests (#17445) --- tests/cpp-tests/Classes/BugsTest/Bug-15594.cpp | 4 ++-- .../ClippingNodeTest/ClippingNodeTest.cpp | 6 +++--- .../DataVisitorTest/DataVisitorTest.cpp | 18 +++++++++--------- .../Classes/PhysicsTest/PhysicsTest.cpp | 10 +++++----- .../Classes/ShaderTest/ShaderTest2.cpp | 10 +++++----- .../js-tests/src/Camera3DTest/Camera3DTest.js | 4 ++-- .../AccelerometerTest/AccelerometerTest.lua | 4 ++-- .../NewEventDispatcherTest.lua | 4 ++-- .../lua-tests/src/PhysicsTest/PhysicsTest.lua | 14 +++++++------- .../src/Sprite3DTest/Sprite3DTest.lua | 6 +++--- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-15594.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-15594.cpp index 4ffbe6873c..6ae66fd89f 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-15594.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-15594.cpp @@ -24,8 +24,8 @@ bool Bug15594Layer::init() auto animation = Animation3D::create("Images/bugs/bug15594.c3t"); auto animate = Animate3D::create(animation); - auto repeate = RepeatForever::create(animate); - sprite3d->runAction(repeate); + auto repeat = RepeatForever::create(animate); + sprite3d->runAction(repeat); return true; } diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 9682714496..af4c49a7de 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -343,10 +343,10 @@ void HoleDemo::setup() _outerClipper = ClippingNode::create(); _outerClipper->retain(); - AffineTransform tranform = AffineTransform::IDENTITY; - tranform = AffineTransformScale(tranform, target->getScale(), target->getScale()); + AffineTransform transform = AffineTransform::IDENTITY; + transform = AffineTransformScale(transform, target->getScale(), target->getScale()); - _outerClipper->setContentSize( SizeApplyAffineTransform(target->getContentSize(), tranform)); + _outerClipper->setContentSize(SizeApplyAffineTransform(target->getContentSize(), transform)); _outerClipper->setAnchorPoint( Vec2(0.5, 0.5) ); _outerClipper->setPosition(Vec2(this->getContentSize()) * 0.5f); _outerClipper->runAction(RepeatForever::create(RotateBy::create(1, 45))); diff --git a/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp b/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp index ee2e636d61..346421c2ae 100644 --- a/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp +++ b/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp @@ -58,26 +58,26 @@ void PrettyPrinterDemo::onEnter() } // Test code - PrettyPrinter vistor; + PrettyPrinter visitor; // print dictionary auto dict = __Dictionary::createWithContentsOfFile("animations/animations.plist"); - dict->acceptVisitor(vistor); - log("%s", vistor.getResult().c_str()); + dict->acceptVisitor(visitor); + log("%s", visitor.getResult().c_str()); log("-------------------------------"); __Set myset; for (int i = 0; i < 30; ++i) { myset.addObject(__String::createWithFormat("str: %d", i)); } - vistor.clear(); - myset.acceptVisitor(vistor); - log("%s", vistor.getResult().c_str()); + visitor.clear(); + myset.acceptVisitor(visitor); + log("%s", visitor.getResult().c_str()); log("-------------------------------"); - vistor.clear(); + visitor.clear(); addSprite(); // dict = Director::getInstance()->getTextureCache()->snapshotTextures(); -// dict->acceptVisitor(vistor); -// log("%s", vistor.getResult().c_str()); +// dict->acceptVisitor(visitor); +// log("%s", visitor.getResult().c_str()); } diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index 232d026888..a95d4cbf10 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -1201,12 +1201,12 @@ void PhysicsDemoSlice::clipPoly(PhysicsShapePolygon* shape, Vec2 normal, float d Vec2 center = PhysicsShape::getPolygonCenter(points, pointsCount); Node* node = Node::create(); - PhysicsBody* polyon = PhysicsBody::createPolygon(points, pointsCount, PHYSICSBODY_MATERIAL_DEFAULT, -center); + PhysicsBody* polygon = PhysicsBody::createPolygon(points, pointsCount, PHYSICSBODY_MATERIAL_DEFAULT, -center); node->setPosition(center); - node->addComponent(polyon); - polyon->setVelocity(body->getVelocityAtWorldPoint(center)); - polyon->setAngularVelocity(body->getAngularVelocity()); - polyon->setTag(_sliceTag); + node->addComponent(polygon); + polygon->setVelocity(body->getVelocityAtWorldPoint(center)); + polygon->setAngularVelocity(body->getAngularVelocity()); + polygon->setTag(_sliceTag); addChild(node); delete[] points; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index c83ef4a5ee..053c57fb9b 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -546,11 +546,11 @@ bool EffectSpriteLamp::init() lampEffect->setKBump(2); _sprite->setEffect(lampEffect); _effect = lampEffect; - auto listerner = EventListenerTouchAllAtOnce::create(); - listerner->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); - listerner->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); - listerner->onTouchesEnded = CC_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); - _eventDispatcher->addEventListenerWithSceneGraphPriority(listerner, this); + auto listener = EventListenerTouchAllAtOnce::create(); + listener->onTouchesBegan = CC_CALLBACK_2(EffectSpriteLamp::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(EffectSpriteLamp::onTouchesMoved, this); + listener->onTouchesEnded = CC_CALLBACK_2(EffectSpriteLamp::onTouchesEnded, this); + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); return true; } return false; diff --git a/tests/js-tests/src/Camera3DTest/Camera3DTest.js b/tests/js-tests/src/Camera3DTest/Camera3DTest.js index 1be42048fd..2f8ef99e2f 100644 --- a/tests/js-tests/src/Camera3DTest/Camera3DTest.js +++ b/tests/js-tests/src/Camera3DTest/Camera3DTest.js @@ -365,11 +365,11 @@ var Camera3DTest = (function(){ layer3D.setCameraMask(2); }, - addNewSpriteWithCoords:function(postion, file, playAnimation, scale, bindCamera){ + addNewSpriteWithCoords:function(position, file, playAnimation, scale, bindCamera){ var sprite = new jsb.Sprite3D(file); this._layer3D.addChild(sprite); var globalZOrder = sprite.getGlobalZOrder(); - sprite.setPosition3D(postion); + sprite.setPosition3D(position); sprite.setGlobalZOrder(globalZOrder); if(playAnimation){ var animation = new jsb.Animation3D(file, "Take 001"); diff --git a/tests/lua-tests/src/AccelerometerTest/AccelerometerTest.lua b/tests/lua-tests/src/AccelerometerTest/AccelerometerTest.lua index 0fe4559e01..ad1ae23c99 100644 --- a/tests/lua-tests/src/AccelerometerTest/AccelerometerTest.lua +++ b/tests/lua-tests/src/AccelerometerTest/AccelerometerTest.lua @@ -42,8 +42,8 @@ local function AccelerometerMainLayer() target:setPosition(cc.p(ptNowX , ptNowY)) end - local listerner = cc.EventListenerAcceleration:create(accelerometerListener) - layer:getEventDispatcher():addEventListenerWithSceneGraphPriority(listerner,ball) + local listener = cc.EventListenerAcceleration:create(accelerometerListener) + layer:getEventDispatcher():addEventListenerWithSceneGraphPriority(listener, ball) end local function onExit() diff --git a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua index fddc47c8d6..8bd2922957 100644 --- a/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua +++ b/tests/lua-tests/src/NewEventDispatcherTest/NewEventDispatcherTest.lua @@ -751,9 +751,9 @@ function SpriteAccelerationEventTest:onEnter() target:setPosition(cc.p(ptNowX , ptNowY)) end - local listerner = cc.EventListenerAcceleration:create(accelerometerListener) + local listener = cc.EventListenerAcceleration:create(accelerometerListener) - self:getEventDispatcher():addEventListenerWithSceneGraphPriority(listerner,sprite) + self:getEventDispatcher():addEventListenerWithSceneGraphPriority(listener, sprite) end function SpriteAccelerationEventTest:onExit() diff --git a/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua b/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua index 8024aa6ae1..6f45ba2962 100644 --- a/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua +++ b/tests/lua-tests/src/PhysicsTest/PhysicsTest.lua @@ -1036,14 +1036,14 @@ local function PhysicsDemoSlice() local center = cc.PhysicsShape:getPolygonCenter(points) local node = cc.Node:create() - local polyon = cc.PhysicsBody:createPolygon(points, - cc.PHYSICSBODY_MATERIAL_DEFAULT, - cc.p(-center.x, -center.y)) + local polygon = cc.PhysicsBody:createPolygon(points, + cc.PHYSICSBODY_MATERIAL_DEFAULT, + cc.p(-center.x, -center.y)) node:setPosition(center) - node:setPhysicsBody(polyon) - polyon:setVelocity(body:getVelocityAtWorldPoint(center)) - polyon:setAngularVelocity(body:getAngularVelocity()) - polyon.tag = sliceTag + node:setPhysicsBody(polygon) + polygon:setVelocity(body:getVelocityAtWorldPoint(center)) + polygon:setAngularVelocity(body:getAngularVelocity()) + polygon.tag = sliceTag layer:addChild(node) end diff --git a/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua b/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua index 2e908ad8a4..014630a0ba 100644 --- a/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua +++ b/tests/lua-tests/src/Sprite3DTest/Sprite3DTest.lua @@ -184,9 +184,9 @@ function Sprite3DWithSkinTest.addNewSpriteWithCoords(parent,x,y) end animate:setTag(110) animate:setQuality(Sprite3DWithSkinTest._animateQuality) - local repeate = cc.RepeatForever:create(animate) - repeate:setTag(110) - sprite:runAction(repeate) + local repeat = cc.RepeatForever:create(animate) + repeat:setTag(110) + sprite:runAction(repeat) end end