]> git.mxchange.org Git - simgear.git/commitdiff
Packages: increased test coverage.
authorJames Turner <zakalawe@mac.com>
Wed, 22 Apr 2015 22:49:51 +0000 (23:49 +0100)
committerJames Turner <zakalawe@mac.com>
Wed, 22 Apr 2015 22:50:08 +0000 (23:50 +0100)
simgear/package/CatalogTest.cxx
simgear/package/catalogTest1/catalog.xml

index ef7da7a652249fe77d4dbfb60ff5d1f663e0b73b..e2b98aca74557fa254ce480795169f5d6f2ca7de 100644 (file)
@@ -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);
 
-    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;
 }
 
index c557bfe6fa38a8f99360d3843aafd59ce6125d71..80e9983ffcb9afe074d23712993c9398c7db1eb7 100644 (file)
@@ -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>
     
\ No newline at end of file