From: James Turner Date: Wed, 22 Apr 2015 22:49:51 +0000 (+0100) Subject: Packages: increased test coverage. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d12d1b2c3ac5ae4981665a65f49a34c465063f02;p=simgear.git Packages: increased test coverage. --- diff --git a/simgear/package/CatalogTest.cxx b/simgear/package/CatalogTest.cxx index ef7da7a6..e2b98aca 100644 --- a/simgear/package/CatalogTest.cxx +++ b/simgear/package/CatalogTest.cxx @@ -26,6 +26,7 @@ #include #include +#include #include @@ -45,9 +46,28 @@ int parseTest() COMPARE(cat->description(), "First test catalog"); // check the packages too + COMPARE(cat->packages().size(), 2); - delete root; + pkg::PackageRef p1 = cat->packages().front(); + COMPARE(p1->catalog(), cat.ptr()); + + COMPARE(p1->id(), "alpha"); + COMPARE(p1->qualifiedId(), "org.flightgear.test.catalog1.alpha"); + COMPARE(p1->name(), "Alpha package"); + COMPARE(p1->revision(), 8); + COMPARE(p1->fileSizeBytes(), 1234567); + + + pkg::PackageRef p2 = cat->getPackageById("c172p"); + VERIFY(p2.valid()); + COMPARE(p2->qualifiedId(), "org.flightgear.test.catalog1.c172p"); + COMPARE(p2->description(), "A plane made by Cessna"); + + +// test filtering / searching too + + delete root; return EXIT_SUCCESS; } diff --git a/simgear/package/catalogTest1/catalog.xml b/simgear/package/catalogTest1/catalog.xml index c557bfe6..80e9983f 100644 --- a/simgear/package/catalogTest1/catalog.xml +++ b/simgear/package/catalogTest1/catalog.xml @@ -5,5 +5,29 @@ First test catalog http://download.flightgear.org/catalog1/catalog.xml 8.1.* + 8.0.0 + 8.2.0 + + + alpha + Alpha package + 8 + 1234567 + + + + c172p + Cessna 172-P + A plane made by Cessna + 42 + 34567 + + + cessna + ga + piston + ifr + + \ No newline at end of file