[Liblas-commits] hg: add test for setting color in ePointFormat2

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Feb 24 16:45:02 EST 2011


details:   http://hg.liblas.orghg/rev/6e452f646556
changeset: 2892:6e452f646556
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Feb 24 15:44:20 2011 -0600
description:
add test for setting color in ePointFormat2
Subject: hg: add test for reserved value in variable record

details:   http://hg.liblas.orghg/rev/365e523cb6d0
changeset: 2893:365e523cb6d0
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Feb 24 15:44:33 2011 -0600
description:
add test for reserved value in variable record

diffstat:

 test/unit/point_test.cpp          |  27 ++++++++++++++++++++++++++-
 test/unit/variablerecord_test.cpp |   2 +-
 2 files changed, 27 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r a72bfb922cf5 -r 365e523cb6d0 test/unit/point_test.cpp
--- a/test/unit/point_test.cpp	Thu Feb 24 11:53:15 2011 -0800
+++ b/test/unit/point_test.cpp	Thu Feb 24 15:44:33 2011 -0600
@@ -489,5 +489,30 @@
             (int) x2, 78900);          
         
     }
+
+    template<>
+    template<>
+    void to::test<19>()
+    {
+        liblas::Header header;
+        header.SetDataFormatId(liblas::ePointFormat2);
+        liblas::HeaderPtr hdr = liblas::HeaderPtr(new liblas::Header(header));
+        
+        liblas::Point p;
+        p.SetHeaderPtr(hdr);
+        
+        liblas::Color c;
+        c.SetRed(123);
+        c.SetGreen(456);
+        c.SetBlue(789);
+        
+        p.SetColor(c);
+        
+        liblas::Color new_c = p.GetColor();
+        ensure_equals("red not equal", new_c.GetRed(), c.GetRed());
+        ensure_equals("green not equal", new_c.GetGreen(), c.GetGreen());
+        ensure_equals("blue not equal", new_c.GetBlue(), c.GetBlue());
+        
+    }
+
 }
-
diff -r a72bfb922cf5 -r 365e523cb6d0 test/unit/variablerecord_test.cpp
--- a/test/unit/variablerecord_test.cpp	Thu Feb 24 11:53:15 2011 -0800
+++ b/test/unit/variablerecord_test.cpp	Thu Feb 24 15:44:33 2011 -0600
@@ -21,7 +21,7 @@
         void test_default(liblas::VariableRecord const& h)
         {
             ensure_equals("wrong default reserved bytes",
-                h.GetReserved(), boost::uint16_t());
+                h.GetReserved(), 0xAABB);
 
             ensure_equals("wrong default record identifier",
                 h.GetRecordId(), boost::uint16_t());


More information about the Liblas-commits mailing list