]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/CSSBorder_test.cxx
Update doxgen config and some comments.
[simgear.git] / simgear / misc / CSSBorder_test.cxx
index 29d43366b2ef9d1283a408d088f329135f943f34..bfb0cb79774a003b3c53367600ee5f038fa737af 100644 (file)
@@ -55,14 +55,21 @@ int main (int ac, char ** av)
   COMPARE(o.b, 15);
   COMPARE(o.l, 20);
 
+  b = CSSBorder::parse("5 10 15 20");
+  o = b.getRelOffsets(SGRect<int>(0,0,100,200));
+  COMPARE(o.t, 0.025);
+  COMPARE(o.r, 0.1);
+  COMPARE(o.b, 0.075);
+  COMPARE(o.l, 0.2);
+
   b = CSSBorder::parse("5% 10% 15% 20%");
-  o = b.getAbsOffsets(SGRect<int>(0,0,200,200));
+  o = b.getAbsOffsets(SGRect<int>(0,0,100,200));
   COMPARE(o.t, 10);
-  COMPARE(o.r, 20);
+  COMPARE(o.r, 10);
   COMPARE(o.b, 30);
-  COMPARE(o.l, 40);
+  COMPARE(o.l, 20);
 
-  o = b.getRelOffsets(SGRect<int>(0,0,200,200));
+  o = b.getRelOffsets(SGRect<int>(0,0,100,200));
   COMPARE(o.t, 0.05);
   COMPARE(o.r, 0.1);
   COMPARE(o.b, 0.15);
@@ -86,6 +93,19 @@ int main (int ac, char ** av)
   VERIFY(b.getKeyword().empty());
   VERIFY(b.isNone());
 
+  CSSBorder b2;
+  VERIFY(!b2.isValid());
+  o = b.getAbsOffsets(SGRect<int>(0,0,200,200));
+  COMPARE(o.t, 0);
+  COMPARE(o.r, 0);
+  COMPARE(o.b, 0);
+  COMPARE(o.l, 0);
+  o = b.getRelOffsets(SGRect<int>(0,0,200,200));
+  COMPARE(o.t, 0);
+  COMPARE(o.r, 0);
+  COMPARE(o.b, 0);
+  COMPARE(o.l, 0);
+
   std::cout << "all tests passed successfully!" << std::endl;
   return 0;
 }