mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5560 from dumganhar/develop
Some warning fixes in cpp-tests.
This commit is contained in:
commit
06cd98076a
|
@ -355,8 +355,8 @@ void WidgetPropertiesReader0250::setColorPropsForWidgetFromJsonDictionary(Widget
|
||||||
widget->setAnchorPoint(Point(apxf, apyf));
|
widget->setAnchorPoint(Point(apxf, apyf));
|
||||||
bool flipX = DICTOOL->getBooleanValue_json(options, "flipX");
|
bool flipX = DICTOOL->getBooleanValue_json(options, "flipX");
|
||||||
bool flipY = DICTOOL->getBooleanValue_json(options, "flipY");
|
bool flipY = DICTOOL->getBooleanValue_json(options, "flipY");
|
||||||
widget->setFlipX(flipX);
|
widget->setFlippedX(flipX);
|
||||||
widget->setFlipY(flipY);
|
widget->setFlippedY(flipY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
|
@ -1129,8 +1129,8 @@ void WidgetPropertiesReader0300::setColorPropsForWidgetFromJsonDictionary(Widget
|
||||||
widget->setAnchorPoint(Point(apxf, apyf));
|
widget->setAnchorPoint(Point(apxf, apyf));
|
||||||
bool flipX = DICTOOL->getBooleanValue_json(options, "flipX");
|
bool flipX = DICTOOL->getBooleanValue_json(options, "flipX");
|
||||||
bool flipY = DICTOOL->getBooleanValue_json(options, "flipY");
|
bool flipY = DICTOOL->getBooleanValue_json(options, "flipY");
|
||||||
widget->setFlipX(flipX);
|
widget->setFlippedX(flipX);
|
||||||
widget->setFlipY(flipY);
|
widget->setFlippedY(flipY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
void WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)
|
||||||
|
|
|
@ -199,11 +199,12 @@ ConsoleUploadFile::~ConsoleUploadFile()
|
||||||
{
|
{
|
||||||
_thread.join();
|
_thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleUploadFile::uploadFile()
|
void ConsoleUploadFile::uploadFile()
|
||||||
{
|
{
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
struct addrinfo *result, *rp;
|
struct addrinfo *result, *rp;
|
||||||
int sfd, s, j;
|
int sfd, s;
|
||||||
|
|
||||||
/* Obtain address(es) matching host/port */
|
/* Obtain address(es) matching host/port */
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,12 @@ CurrentLanguageTest::CurrentLanguageTest()
|
||||||
case LanguageType::POLISH:
|
case LanguageType::POLISH:
|
||||||
labelLanguage->setString("current language is Polish");
|
labelLanguage->setString("current language is Polish");
|
||||||
break;
|
break;
|
||||||
|
case LanguageType::DUTCH:
|
||||||
|
labelLanguage->setString("current language is Polish");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
CCASSERT(false, "Invalid language type.");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
addChild(labelLanguage);
|
addChild(labelLanguage);
|
||||||
|
|
|
@ -518,7 +518,7 @@ std::string ArrayPerfTest::subtitle() const
|
||||||
void ArrayPerfTest::generateTestFunctions()
|
void ArrayPerfTest::generateTestFunctions()
|
||||||
{
|
{
|
||||||
auto createArray = [this](){
|
auto createArray = [this](){
|
||||||
Array* ret = Array::create();
|
__Array* ret = Array::create();
|
||||||
|
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
{
|
{
|
||||||
|
@ -531,7 +531,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
|
|
||||||
TestFunction testFunctions[] = {
|
TestFunction testFunctions[] = {
|
||||||
{ "addObject", [=](){
|
{ "addObject", [=](){
|
||||||
Array* nodeVector = Array::create();
|
__Array* nodeVector = Array::create();
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
|
@ -539,7 +539,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
CC_PROFILER_STOP(this->profilerName());
|
CC_PROFILER_STOP(this->profilerName());
|
||||||
} } ,
|
} } ,
|
||||||
{ "insertObject", [=](){
|
{ "insertObject", [=](){
|
||||||
Array* nodeVector = Array::create();
|
__Array* nodeVector = Array::create();
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
|
@ -547,7 +547,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
CC_PROFILER_STOP(this->profilerName());
|
CC_PROFILER_STOP(this->profilerName());
|
||||||
} } ,
|
} } ,
|
||||||
{ "setObject", [=](){
|
{ "setObject", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
|
|
||||||
srand(time(nullptr));
|
srand(time(nullptr));
|
||||||
ssize_t index = rand() % quantityOfNodes;
|
ssize_t index = rand() % quantityOfNodes;
|
||||||
|
@ -558,7 +558,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
CC_PROFILER_STOP(this->profilerName());
|
CC_PROFILER_STOP(this->profilerName());
|
||||||
} } ,
|
} } ,
|
||||||
{ "getIndexOfObject", [=](){
|
{ "getIndexOfObject", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
Ref* objToGet = nodeVector->getObjectAtIndex(quantityOfNodes/3);
|
Ref* objToGet = nodeVector->getObjectAtIndex(quantityOfNodes/3);
|
||||||
ssize_t index = 0;
|
ssize_t index = 0;
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
|
@ -572,7 +572,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
}
|
}
|
||||||
} } ,
|
} } ,
|
||||||
{ "getObjectAtIndex", [=](){
|
{ "getObjectAtIndex", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
|
@ -580,7 +580,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
CC_PROFILER_STOP(this->profilerName());
|
CC_PROFILER_STOP(this->profilerName());
|
||||||
} } ,
|
} } ,
|
||||||
{ "containsObject", [=](){
|
{ "containsObject", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
Ref* objToGet = nodeVector->getObjectAtIndex(quantityOfNodes/3);
|
Ref* objToGet = nodeVector->getObjectAtIndex(quantityOfNodes/3);
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
|
@ -589,7 +589,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
CC_PROFILER_STOP(this->profilerName());
|
CC_PROFILER_STOP(this->profilerName());
|
||||||
} } ,
|
} } ,
|
||||||
{ "removeObject", [=](){
|
{ "removeObject", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
Node** nodes = (Node**)malloc(sizeof(Node*) * quantityOfNodes);
|
Node** nodes = (Node**)malloc(sizeof(Node*) * quantityOfNodes);
|
||||||
|
|
||||||
for (int i = 0; i < quantityOfNodes; ++i)
|
for (int i = 0; i < quantityOfNodes; ++i)
|
||||||
|
@ -607,7 +607,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
free(nodes);
|
free(nodes);
|
||||||
} } ,
|
} } ,
|
||||||
{ "removeObjectAtIndex", [=](){
|
{ "removeObjectAtIndex", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
|
@ -628,7 +628,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
CCASSERT(nodeVector->count() == 0, "nodeVector was not empty.");
|
CCASSERT(nodeVector->count() == 0, "nodeVector was not empty.");
|
||||||
} } ,
|
} } ,
|
||||||
{ "swap by index", [=](){
|
{ "swap by index", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
|
|
||||||
int swapIndex1 = quantityOfNodes / 3;
|
int swapIndex1 = quantityOfNodes / 3;
|
||||||
int swapIndex2 = quantityOfNodes / 3 * 2;
|
int swapIndex2 = quantityOfNodes / 3 * 2;
|
||||||
|
@ -640,7 +640,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
} } ,
|
} } ,
|
||||||
|
|
||||||
{ "swap by object", [=](){
|
{ "swap by object", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
|
|
||||||
Ref* swapNode1 = nodeVector->getObjectAtIndex(quantityOfNodes / 3);
|
Ref* swapNode1 = nodeVector->getObjectAtIndex(quantityOfNodes / 3);
|
||||||
Ref* swapNode2 = nodeVector->getObjectAtIndex(quantityOfNodes / 3 * 2);
|
Ref* swapNode2 = nodeVector->getObjectAtIndex(quantityOfNodes / 3 * 2);
|
||||||
|
@ -652,7 +652,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
} } ,
|
} } ,
|
||||||
|
|
||||||
{ "reverseObjects", [=](){
|
{ "reverseObjects", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
|
@ -661,7 +661,7 @@ void ArrayPerfTest::generateTestFunctions()
|
||||||
} } ,
|
} } ,
|
||||||
|
|
||||||
{ "CCARRAY_FOREACH", [=](){
|
{ "CCARRAY_FOREACH", [=](){
|
||||||
Array* nodeVector = createArray();
|
__Array* nodeVector = createArray();
|
||||||
Ref* obj;
|
Ref* obj;
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
|
|
||||||
|
@ -970,13 +970,13 @@ void DictionaryStringKeyPerfTest::generateTestFunctions()
|
||||||
Ref* obj;
|
Ref* obj;
|
||||||
CCARRAY_FOREACH(keys, obj)
|
CCARRAY_FOREACH(keys, obj)
|
||||||
{
|
{
|
||||||
auto key = static_cast<String*>(obj);
|
auto key = static_cast<__String*>(obj);
|
||||||
allKeysString += (std::string("_") + key->getCString());
|
allKeysString += (std::string("_") + key->getCString());
|
||||||
}
|
}
|
||||||
} } ,
|
} } ,
|
||||||
|
|
||||||
{ "allKeysForObject", [=](){
|
{ "allKeysForObject", [=](){
|
||||||
Dictionary* dict = Dictionary::create();
|
__Dictionary* dict = Dictionary::create();
|
||||||
|
|
||||||
Node** nodes = (Node**) malloc(sizeof(Node*) * quantityOfNodes);
|
Node** nodes = (Node**) malloc(sizeof(Node*) * quantityOfNodes);
|
||||||
Node* sameNode = Node::create();
|
Node* sameNode = Node::create();
|
||||||
|
@ -1003,7 +1003,7 @@ void DictionaryStringKeyPerfTest::generateTestFunctions()
|
||||||
Ref* obj;
|
Ref* obj;
|
||||||
CCARRAY_FOREACH(keys, obj)
|
CCARRAY_FOREACH(keys, obj)
|
||||||
{
|
{
|
||||||
auto key = static_cast<String*>(obj);
|
auto key = static_cast<__String*>(obj);
|
||||||
allKeysString += (std::string("_") + key->getCString());
|
allKeysString += (std::string("_") + key->getCString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1206,7 +1206,7 @@ std::string TemplateMapIntKeyPerfTest::subtitle() const
|
||||||
void DictionaryIntKeyPerfTest::generateTestFunctions()
|
void DictionaryIntKeyPerfTest::generateTestFunctions()
|
||||||
{
|
{
|
||||||
auto createDict = [this](){
|
auto createDict = [this](){
|
||||||
Dictionary* ret = Dictionary::create();
|
__Dictionary* ret = Dictionary::create();
|
||||||
|
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
{
|
{
|
||||||
|
@ -1219,7 +1219,7 @@ void DictionaryIntKeyPerfTest::generateTestFunctions()
|
||||||
|
|
||||||
TestFunction testFunctions[] = {
|
TestFunction testFunctions[] = {
|
||||||
{ "setObject", [=](){
|
{ "setObject", [=](){
|
||||||
Dictionary* dict = Dictionary::create();
|
__Dictionary* dict = Dictionary::create();
|
||||||
|
|
||||||
CC_PROFILER_START(this->profilerName());
|
CC_PROFILER_START(this->profilerName());
|
||||||
for( int i=0; i<quantityOfNodes; ++i)
|
for( int i=0; i<quantityOfNodes; ++i)
|
||||||
|
@ -1286,13 +1286,13 @@ void DictionaryIntKeyPerfTest::generateTestFunctions()
|
||||||
Ref* obj;
|
Ref* obj;
|
||||||
CCARRAY_FOREACH(keys, obj)
|
CCARRAY_FOREACH(keys, obj)
|
||||||
{
|
{
|
||||||
auto key = static_cast<Integer*>(obj);
|
auto key = static_cast<__Integer*>(obj);
|
||||||
allKeysInt += key->getValue();
|
allKeysInt += key->getValue();
|
||||||
}
|
}
|
||||||
} } ,
|
} } ,
|
||||||
|
|
||||||
{ "allKeysForObject", [=](){
|
{ "allKeysForObject", [=](){
|
||||||
Dictionary* dict = Dictionary::create();
|
__Dictionary* dict = Dictionary::create();
|
||||||
|
|
||||||
Node** nodes = (Node**) malloc(sizeof(Node*) * quantityOfNodes);
|
Node** nodes = (Node**) malloc(sizeof(Node*) * quantityOfNodes);
|
||||||
Node* sameNode = Node::create();
|
Node* sameNode = Node::create();
|
||||||
|
@ -1319,7 +1319,7 @@ void DictionaryIntKeyPerfTest::generateTestFunctions()
|
||||||
Ref* obj;
|
Ref* obj;
|
||||||
CCARRAY_FOREACH(keys, obj)
|
CCARRAY_FOREACH(keys, obj)
|
||||||
{
|
{
|
||||||
auto key = static_cast<Integer*>(obj);
|
auto key = static_cast<__Integer*>(obj);
|
||||||
allKeysInt += key->getValue();
|
allKeysInt += key->getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue