From d8aa943ed99f60e4a48e5edfadb703aa9ed07d63 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 9 Jun 2022 17:56:54 +0800 Subject: [PATCH] Fix ci --- .../Classes/FileUtilsTest/FileUtilsTest.cpp | 49 ------------------- .../Classes/FileUtilsTest/FileUtilsTest.h | 10 ---- tests/cpp-tests/Classes/FontTest/FontTest.cpp | 40 --------------- tests/cpp-tests/Classes/FontTest/FontTest.h | 12 ----- 4 files changed, 111 deletions(-) diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index c45f18d50d..4411634dc4 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -30,7 +30,6 @@ FileUtilsTests::FileUtilsTests() { ADD_TEST_CASE(TestResolutionDirectories); ADD_TEST_CASE(TestSearchPath); - ADD_TEST_CASE(TestFilenameLookup); ADD_TEST_CASE(TestIsFileExist); ADD_TEST_CASE(TestIsDirectoryExist); ADD_TEST_CASE(TestFileFuncs); @@ -208,44 +207,6 @@ std::string TestSearchPath::subtitle() const return "See the console, can see a orange box and a 'about' picture, except Android"; } -// TestFilenameLookup - -void TestFilenameLookup::onEnter() -{ - FileUtilsDemo::onEnter(); - - auto sharedFileUtils = FileUtils::getInstance(); - - ValueMap dict; - dict["grossini.bmp"] = Value("Images/grossini.png"); - dict["grossini.xcf"] = Value("Images/grossini.png"); - - sharedFileUtils->setFilenameLookupDictionary(dict); - - // Instead of loading carlitos.xcf, it will load grossini.png - auto sprite = Sprite::create("grossini.xcf"); - this->addChild(sprite); - - auto s = Director::getInstance()->getWinSize(); - sprite->setPosition(s.width / 2, s.height / 2); -} - -void TestFilenameLookup::onExit() -{ - - FileUtils* sharedFileUtils = FileUtils::getInstance(); - - // reset filename lookup - sharedFileUtils->setFilenameLookupDictionary(ValueMap()); - - FileUtilsDemo::onExit(); -} - -std::string TestFilenameLookup::title() const -{ - return "FileUtils: filename lookup"; -} - // TestIsFileExist void TestIsFileExist::onEnter() @@ -276,9 +237,6 @@ void TestIsFileExist::onExit() FileUtils* sharedFileUtils = FileUtils::getInstance(); - // reset filename lookup - sharedFileUtils->setFilenameLookupDictionary(ValueMap()); - FileUtilsDemo::onExit(); } @@ -997,7 +955,6 @@ void TestUnicodePath::onExit() FileUtils* sharedFileUtils = FileUtils::getInstance(); sharedFileUtils->purgeCachedEntries(); - sharedFileUtils->setFilenameLookupDictionary(ValueMap()); FileUtilsDemo::onExit(); } @@ -1037,12 +994,6 @@ void TestIsFileExistAsync::onEnter() void TestIsFileExistAsync::onExit() { - - FileUtils* sharedFileUtils = FileUtils::getInstance(); - - // reset filename lookup - sharedFileUtils->setFilenameLookupDictionary(ValueMap()); - FileUtilsDemo::onExit(); } diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h index 1d40951028..60eefc6d03 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.h @@ -64,16 +64,6 @@ private: std::vector _defaultResolutionsOrderArray; }; -class TestFilenameLookup : public FileUtilsDemo -{ -public: - CREATE_FUNC(TestFilenameLookup); - - virtual void onEnter() override; - virtual void onExit() override; - virtual std::string title() const override; -}; - class TestIsFileExist : public FileUtilsDemo { public: diff --git a/tests/cpp-tests/Classes/FontTest/FontTest.cpp b/tests/cpp-tests/Classes/FontTest/FontTest.cpp index 115aba2a41..6aaaaf33ce 100644 --- a/tests/cpp-tests/Classes/FontTest/FontTest.cpp +++ b/tests/cpp-tests/Classes/FontTest/FontTest.cpp @@ -80,7 +80,6 @@ FontTests::FontTests() }); } ADD_TEST_CASE(FontNoReplacementTest); - ADD_TEST_CASE(FontReplacementTest); } void FontTest::showFont(std::string_view fontFile) @@ -162,7 +161,6 @@ FontNoReplacementTest* FontNoReplacementTest::create() FontNoReplacementTest::FontNoReplacementTest() { - _replace = false; } FontNoReplacementTest::~FontNoReplacementTest() @@ -176,7 +174,6 @@ FontNoReplacementTest::~FontNoReplacementTest() FontFreeType::releaseFont("fonts/Abduction.ttf"); FontAtlasCache::unloadFontAtlasTTF("fonts/Schwarzwald.ttf"); FontFreeType::releaseFont("fonts/Schwarzwald.ttf"); - FileUtils::getInstance()->setFilenameLookupDictionary(ValueMap()); } void FontNoReplacementTest::onEnter() @@ -184,17 +181,6 @@ void FontNoReplacementTest::onEnter() TestCase::onEnter(); std::string suffix; - if (_replace) - { - ValueMap dict{{"fonts/A Damn Mess.ttf", Value("fonts/arial.ttf")}, - {"fonts/Abberancy.ttf", Value("fonts/arial.ttf")}, - {"fonts/Abduction.ttf", Value("fonts/arial.ttf")}, - {"fonts/Schwarzwald.ttf", Value("fonts/arial.ttf")}}; - - FileUtils::getInstance()->setFilenameLookupDictionary(dict); - suffix = " replaced by arial.ttf"; - } - auto s = Director::getInstance()->getWinSize(); auto blockSize = Size(s.width / 3, 200); @@ -253,29 +239,3 @@ std::string FontNoReplacementTest::title() const { return "Font no replacement test"; } - -FontReplacementTest* FontReplacementTest::create() -{ - auto ret = new FontReplacementTest; - if (ret->init()) - { - ret->autorelease(); - } - else - { - delete ret; - ret = nullptr; - } - - return ret; -} - -FontReplacementTest::FontReplacementTest() -{ - _replace = true; -} - -std::string FontReplacementTest::title() const -{ - return "Font replacement test"; -} diff --git a/tests/cpp-tests/Classes/FontTest/FontTest.h b/tests/cpp-tests/Classes/FontTest/FontTest.h index 959f8f7c8d..df130b0e14 100644 --- a/tests/cpp-tests/Classes/FontTest/FontTest.h +++ b/tests/cpp-tests/Classes/FontTest/FontTest.h @@ -65,18 +65,6 @@ public: protected: FontNoReplacementTest(); - - bool _replace; -}; - -class FontReplacementTest : public FontNoReplacementTest -{ -public: - static FontReplacementTest* create(); - virtual std::string title() const override; - -protected: - FontReplacementTest(); }; #endif // _FONT_TEST_H_