[Liblas-commits] libpc: get tests building and working on osx with 'make test' ta...

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Feb 25 15:05:40 EST 2011


details:   http://hg.liblas.orglibpc/rev/3bf61c0aaa07
changeset: 98:3bf61c0aaa07
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Feb 25 14:05:33 2011 -0600
description:
get tests building and working on osx with 'make test' target

diffstat:

 CMakeLists.txt                 |  2 +-
 src/Dimension.cpp              |  4 ++--
 test/unit/BoundsTest.cpp       |  4 +++-
 test/unit/ColorTest.cpp        |  4 +++-
 test/unit/CropFilterTest.cpp   |  2 ++
 test/unit/LiblasReaderTest.cpp |  4 +++-
 test/unit/LiblasWriterTest.cpp |  2 ++
 test/unit/PointDataTest.cpp    |  2 ++
 test/unit/RangeTest.cpp        |  2 ++
 test/unit/SchemaTest.cpp       |  2 ++
 test/unit/UtilsTest.cpp        |  2 ++
 test/unit/VectorTest.cpp       |  2 ++
 test/unit/main.cpp             |  7 ++++---
 13 files changed, 30 insertions(+), 9 deletions(-)

diffs (179 lines):

diff -r 97f48e532edf -r 3bf61c0aaa07 CMakeLists.txt
--- a/CMakeLists.txt	Fri Feb 25 11:30:11 2011 -0800
+++ b/CMakeLists.txt	Fri Feb 25 14:05:33 2011 -0600
@@ -178,7 +178,7 @@
 endif(WIN32)
 
 # BUG: are there other Boost components we're using?
-find_package(Boost 1.45 COMPONENTS program_options thread iostreams unit_test_framework REQUIRED)
+find_package(Boost 1.45 COMPONENTS program_options thread iostreams filesystem system unit_test_framework REQUIRED)
 
 if(Boost_FOUND AND Boost_PROGRAM_OPTIONS_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
diff -r 97f48e532edf -r 3bf61c0aaa07 src/Dimension.cpp
--- a/src/Dimension.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/src/Dimension.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -371,16 +371,16 @@
 
 DimensionLayout::DimensionLayout(const Dimension& dimension)
     : m_dimension(dimension)
+    , m_byteOffset(0)
     , m_position(0)
-    , m_byteOffset(0)
 {
 }
 
 /// copy constructor
 DimensionLayout::DimensionLayout(DimensionLayout const& other) 
     : m_dimension(other.m_dimension)
+    , m_byteOffset(other.m_byteOffset)
     , m_position(other.m_position)
-    , m_byteOffset(other.m_byteOffset)
 {
 }
 
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/BoundsTest.cpp
--- a/test/unit/BoundsTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/BoundsTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 
@@ -48,7 +50,7 @@
 
     Range<int> v1(1,3);
     Range<int> v2(2,4);
-    std::vector<Range<int>> rv;
+    std::vector< Range<int> > rv;
     rv.push_back(v1);
     rv.push_back(v2);
     Bounds<int> b3(rv);
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/ColorTest.cpp
--- a/test/unit/ColorTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/ColorTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
@@ -13,7 +15,7 @@
 {
     Color c0;
     Color c1(1,2,3);
-    boost::array<boost::uint16_t,3> a = {1,2,3};
+    boost::array<boost::uint16_t,3> a = {{1,2,3}};
     Color c2(a);
     Color c3(c2);
     Color c4 = c3;
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/CropFilterTest.cpp
--- a/test/unit/CropFilterTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/CropFilterTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/LiblasReaderTest.cpp
--- a/test/unit/LiblasReaderTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/LiblasReaderTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
@@ -15,7 +17,7 @@
 
 BOOST_AUTO_TEST_CASE(test_1)
 {
-    std::istream* ifs = Utils::openFile("test/data/1.2-with-color.las");
+    std::istream* ifs = Utils::openFile("../../test/data/1.2-with-color.las");
     
     LiblasReader reader(*ifs);
 
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/LiblasWriterTest.cpp
--- a/test/unit/LiblasWriterTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/LiblasWriterTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/PointDataTest.cpp
--- a/test/unit/PointDataTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/PointDataTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/RangeTest.cpp
--- a/test/unit/RangeTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/RangeTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/SchemaTest.cpp
--- a/test/unit/SchemaTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/SchemaTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <boost/test/unit_test.hpp>
 #include <boost/cstdint.hpp>
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/UtilsTest.cpp
--- a/test/unit/UtilsTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/UtilsTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <sstream>
 
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/VectorTest.cpp
--- a/test/unit/VectorTest.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/VectorTest.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,4 +1,6 @@
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
 
 #include <sstream>
 
diff -r 97f48e532edf -r 3bf61c0aaa07 test/unit/main.cpp
--- a/test/unit/main.cpp	Fri Feb 25 11:30:11 2011 -0800
+++ b/test/unit/main.cpp	Fri Feb 25 14:05:33 2011 -0600
@@ -1,10 +1,11 @@
+//BUG FIXME: this should be driven by cmake to determine if we're using
+#ifdef _MSC_VER
 #define BOOST_TEST_DYN_LINK
+#endif
+
 #define BOOST_TEST_MODULE Main
 #include <boost/test/unit_test.hpp>
 
-#define BOOST_TEST_DYN_LINK
-
-#include <boost/test/unit_test.hpp>
 
 /* actually no code in here, this is just the main file */
 


More information about the Liblas-commits mailing list