#include <simgear/package/Catalog.hxx>
#include <simgear/package/Root.hxx>
+#include <simgear/package/Package.hxx>
#include <simgear/misc/sg_dir.hxx>
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;
}
<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>
\ No newline at end of file