Packages: increased test coverage.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <simgear/package/Catalog.hxx>
|
||||
#include <simgear/package/Root.hxx>
|
||||
#include <simgear/package/Package.hxx>
|
||||
|
||||
#include <simgear/misc/sg_dir.hxx>
|
||||
|
||||
@@ -45,9 +46,28 @@ int parseTest()
|
||||
COMPARE(cat->description(), "First test catalog");
|
||||
|
||||
// check the packages too
|
||||
COMPARE(cat->packages().size(), 2);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,5 +5,29 @@
|
||||
<description>First test catalog</description>
|
||||
<url>http://download.flightgear.org/catalog1/catalog.xml</url>
|
||||
<version>8.1.*</version>
|
||||
<version>8.0.0</version>
|
||||
<version>8.2.0</version>
|
||||
|
||||
<package>
|
||||
<id>alpha</id>
|
||||
<name>Alpha package</name>
|
||||
<revision type="int">8</revision>
|
||||
<file-size-bytes type="int">1234567</file-size-bytes>
|
||||
</package>
|
||||
|
||||
<package>
|
||||
<id>c172p</id>
|
||||
<name>Cessna 172-P</name>
|
||||
<description>A plane made by Cessna</description>
|
||||
<revision type="int">42</revision>
|
||||
<file-size-bytes type="int">34567</file-size-bytes>
|
||||
|
||||
<tags>
|
||||
<tag>cessna</tag>
|
||||
<tag>ga</tag>
|
||||
<tag>piston</tag>
|
||||
<tag>ifr</tag>
|
||||
</tags>
|
||||
</package>
|
||||
</PropertyList>
|
||||
|
||||
Reference in New Issue
Block a user