void ZipArchiveTests::testFindNonRecursive() { ZipArchive arch(testPath, "Zip"); arch.load(); StringVectorPtr vec = arch.find("*.txt", false); CPPUNIT_ASSERT_EQUAL((size_t)2, vec->size()); CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0)); CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1)); }
void ZipArchiveTests::testFindRecursive() { ZipArchive arch(testPath, "Zip"); arch.load(); StringVectorPtr vec = arch.find("*.material", true); CPPUNIT_ASSERT_EQUAL((size_t)4, vec->size()); CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(0)); CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(1)); CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(2)); CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(3)); }
void ZipArchiveTests::testListRecursive() { ZipArchive arch(testPath, "Zip"); arch.load(); StringVectorPtr vec = arch.list(true); CPPUNIT_ASSERT_EQUAL((size_t)6, vec->size()); CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(0)); CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(1)); CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(2)); CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(3)); CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(4)); CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(5)); }
void FileSystemArchiveTests::testListRecursive() { FileSystemArchive arch(testPath, "FileSystem"); arch.load(); StringVectorPtr vec = arch.list(true); CPPUNIT_ASSERT_EQUAL((size_t)48, vec->size()); // 48 including CVS folders! CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0)); CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1)); CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file.material"), vec->at(2)); CPPUNIT_ASSERT_EQUAL(String("level1/materials/scripts/file2.material"), vec->at(3)); CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file3.material"), vec->at(22)); CPPUNIT_ASSERT_EQUAL(String("level2/materials/scripts/file4.material"), vec->at(23)); }
void FileSystemArchiveTests::testListNonRecursive() { try { FileSystemArchive arch(testPath, "FileSystem"); arch.load(); StringVectorPtr vec = arch.list(false); CPPUNIT_ASSERT_EQUAL((unsigned int)2, (unsigned int)vec->size()); CPPUNIT_ASSERT_EQUAL(String("rootfile.txt"), vec->at(0)); CPPUNIT_ASSERT_EQUAL(String("rootfile2.txt"), vec->at(1)); } catch (Exception& e) { std::cout << e.getFullDescription(); } }
void loadScriptLibrary() { StringVectorPtr names = ResourceGroupManager::getSingleton().listResourceNames("DefaultLuaScripts"); for(int i = 0; i < names->size(); ++i) { loadScript(names->at(i)); } names.setNull(); }