[Liblas-commits] hg-main-tree: use proper comparator elsewhere too

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Aug 11 16:33:47 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/e13709a23060
changeset: 1045:e13709a23060
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Aug 11 13:32:41 2011 -0700
description:
use proper comparator elsewhere too
Subject: hg-main-tree: merge

details:   http://hg.libpc.orghg-main-tree/rev/c81e7da692b6
changeset: 1046:c81e7da692b6
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Thu Aug 11 13:32:54 2011 -0700
description:
merge

diffstat:

 src/drivers/las/Writer.cpp            |    2 --
 test/data/laszip/laszip-generated.laz |    0 
 test/unit/FileUtilsTest.cpp           |    4 ++--
 test/unit/LasReaderTest.cpp           |    2 +-
 test/unit/LasWriterTest.cpp           |   17 +++++++++--------
 test/unit/LiblasWriterTest.cpp        |   26 +++++++++++++-------------
 6 files changed, 25 insertions(+), 26 deletions(-)

diffs (185 lines):

diff -r a1fdabfec72d -r c81e7da692b6 src/drivers/las/Writer.cpp
--- a/src/drivers/las/Writer.cpp	Thu Aug 11 13:31:17 2011 -0700
+++ b/src/drivers/las/Writer.cpp	Thu Aug 11 13:32:54 2011 -0700
@@ -90,8 +90,6 @@
 {
     Writer::initialize();
 
-    m_spatialReference = getPrevStage().getSpatialReference();
-
     m_streamManager.open();
 
     try
diff -r a1fdabfec72d -r c81e7da692b6 test/data/laszip/laszip-generated.laz
Binary file test/data/laszip/laszip-generated.laz has changed
diff -r a1fdabfec72d -r c81e7da692b6 test/unit/FileUtilsTest.cpp
--- a/test/unit/FileUtilsTest.cpp	Thu Aug 11 13:31:17 2011 -0700
+++ b/test/unit/FileUtilsTest.cpp	Thu Aug 11 13:32:54 2011 -0700
@@ -132,11 +132,11 @@
 {
     // test absolute case
     const std::string a = FileUtils::getDirectory(drive + "/a/b/foo.txt");
-    BOOST_CHECK(a == drive+"/a/b");
+    BOOST_CHECK_EQUAL(a, drive+"/a/b");
 
     // test relative case
     const std::string b = FileUtils::getDirectory("a/b/foo.txt");
-    BOOST_CHECK(b == "a/b");
+    BOOST_CHECK_EQUAL(b, "a/b");
 
     return;
 }
diff -r a1fdabfec72d -r c81e7da692b6 test/unit/LasReaderTest.cpp
--- a/test/unit/LasReaderTest.cpp	Thu Aug 11 13:31:17 2011 -0700
+++ b/test/unit/LasReaderTest.cpp	Thu Aug 11 13:32:54 2011 -0700
@@ -177,7 +177,7 @@
 
 BOOST_AUTO_TEST_CASE(test_random_laz)
 {
-    pdal::drivers::las::LasReader reader(Support::datapath("1.2-with-color.laz"));
+    pdal::drivers::las::LasReader reader(Support::datapath("laszip/laszip-generated.laz"));
     BOOST_CHECK(reader.getDescription() == "Las Reader");
     reader.initialize();
 
diff -r a1fdabfec72d -r c81e7da692b6 test/unit/LasWriterTest.cpp
--- a/test/unit/LasWriterTest.cpp	Thu Aug 11 13:31:17 2011 -0700
+++ b/test/unit/LasWriterTest.cpp	Thu Aug 11 13:32:54 2011 -0700
@@ -93,40 +93,41 @@
 BOOST_AUTO_TEST_CASE(LasWriterTest_test_simple_laz)
 {
     // remove file from earlier run, if needed
-    FileUtils::deleteFile("temp.laz");
+    FileUtils::deleteFile("laszip/LasWriterTest_test_simple_laz.laz");
 
-    pdal::drivers::las::LasReader reader(Support::datapath("1.2-with-color.las"));
+    pdal::drivers::las::LasReader reader(Support::datapath("laszip/basefile.las"));
     
-    std::ostream* ofs = FileUtils::createFile("temp.laz");
+    std::ostream* ofs = FileUtils::createFile(Support::datapath("laszip/LasWriterTest_test_simple_laz.laz"));
 
     {
         const boost::uint64_t numPoints = reader.getNumPoints();
 
         // need to scope the writer, so that's it dtor can use the stream
         pdal::drivers::las::LasWriter writer(reader, ofs);
-        writer.initialize();
-
         writer.setCompressed(true);
         writer.setDate(0, 0);
         writer.setPointFormat(::pdal::drivers::las::PointFormat3);
         writer.setSystemIdentifier("");
         writer.setGeneratingSoftware("TerraScan");
 
+        writer.initialize();
+
+
         writer.write(numPoints);
     }
 
     FileUtils::closeFile(ofs);
 
     {
-        pdal::drivers::las::LasReader reader("temp.laz");
+        pdal::drivers::las::LasReader reader(Support::datapath("laszip/LasWriterTest_test_simple_laz.laz"));
     }
 
-    bool filesSame = Support::compare_files("temp.laz", Support::datapath("1.2-with-color.laz"));
+    bool filesSame = Support::compare_files(Support::datapath("laszip/LasWriterTest_test_simple_laz.laz"), Support::datapath("laszip/laszip-generated.laz"));
     BOOST_CHECK(filesSame);
 
     if (filesSame)
     {
-        FileUtils::deleteFile("temp.laz");
+        FileUtils::deleteFile("LasWriterTest_test_simple_laz.laz");
     }
 
     return;
diff -r a1fdabfec72d -r c81e7da692b6 test/unit/LiblasWriterTest.cpp
--- a/test/unit/LiblasWriterTest.cpp	Thu Aug 11 13:31:17 2011 -0700
+++ b/test/unit/LiblasWriterTest.cpp	Thu Aug 11 13:32:54 2011 -0700
@@ -53,11 +53,11 @@
 BOOST_AUTO_TEST_CASE(LiblasWriterTest_test_simple_las)
 {
     // remove file from earlier run, if needed
-    FileUtils::deleteFile("temp.las");
+    FileUtils::deleteFile("LiblasWriterTest_test_simple_las.las");
 
     LiblasReader reader(Support::datapath("1.2-with-color.las"));
     
-    std::ostream* ofs = FileUtils::createFile("temp.las");
+    std::ostream* ofs = FileUtils::createFile("LiblasWriterTest_test_simple_las.las");
 
     {
         // need to scope the writer, so that's it dtor can use the stream
@@ -78,12 +78,12 @@
 
     FileUtils::closeFile(ofs);
 
-    bool filesSame = Support::compare_files("temp.las", Support::datapath("simple.las"));
+    bool filesSame = Support::compare_files("LiblasWriterTest_test_simple_las.las", Support::datapath("simple.las"));
     BOOST_CHECK(filesSame);
 
     if (filesSame)
     {
-        FileUtils::deleteFile("temp.las");
+        FileUtils::deleteFile("LiblasWriterTest_test_simple_las.las");
     }
 
     return;
@@ -92,9 +92,9 @@
 BOOST_AUTO_TEST_CASE(LiblasWriterTest_test_options)
 {
     // remove file from earlier run, if needed
-    FileUtils::deleteFile("temp.las");
+    FileUtils::deleteFile("LiblasWriterTest_test_options.las");
 
-    Option<std::string> opt("filename", "temp.las");
+    Option<std::string> opt("filename", "LiblasWriterTest_test_options.las");
     Options opts(opt);
 
     LiblasReader reader(Support::datapath("1.2-with-color.las"));
@@ -116,12 +116,12 @@
         writer.write(numPoints);
     }
 
-    bool filesSame = Support::compare_files("temp.las", Support::datapath("simple.las"));
+    bool filesSame = Support::compare_files("LiblasWriterTest_test_options.las", Support::datapath("simple.las"));
     BOOST_CHECK(filesSame);
 
     if (filesSame)
     {
-        FileUtils::deleteFile("temp.las");
+        FileUtils::deleteFile("LiblasWriterTest_test_options.las");
     }
 
     return;
@@ -131,11 +131,11 @@
 BOOST_AUTO_TEST_CASE(LiblasWriterTest_test_simple_laz)
 {
     // remove file from earlier run, if needed
-    FileUtils::deleteFile("temp.las");
+    FileUtils::deleteFile("laszip/LiblasWriterTest_test_simple_laz.las");
 
-    LiblasReader reader(Support::datapath("1.2-with-color.las"));
+    LiblasReader reader(Support::datapath("laszip/basefile.las"));
     
-    std::ostream* ofs = FileUtils::createFile("temp.laz");
+    std::ostream* ofs = FileUtils::createFile("laszip/LiblasWriterTest_test_simple_laz.laz");
 
     {
         // need to scope the writer, so that's it dtor can use the stream
@@ -155,12 +155,12 @@
 
     FileUtils::closeFile(ofs);
 
-    bool filesSame = Support::compare_files("temp.laz", Support::datapath("1.2-with-color.laz"));
+    bool filesSame = Support::compare_files("laszip/LiblasWriterTest_test_simple_laz.laz", Support::datapath("laszip/laszip-generated.laz"));
     BOOST_CHECK(filesSame);
 
     if (filesSame)
     {
-        FileUtils::deleteFile("temp.laz");
+        FileUtils::deleteFile("laszip/LiblasWriterTest_test_simple_laz.laz");
     }
 
     return;


More information about the Liblas-commits mailing list