[Liblas-commits] hg: pull forward rf8f3667abef into this branch
liblas-commits at liblas.org
liblas-commits at liblas.org
Fri Jan 29 12:28:41 EST 2010
changeset b696e7b2fee8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=b696e7b2fee8
summary: pull forward rf8f3667abef into this branch
diffstat:
INSTALL | 4 +-
test/unit/CMakeLists.txt | 1 -
test/unit/Makefile.am | 1 -
test/unit/common.cpp | 8 +-
test/unit/lasfile_test.cpp | 271 ---------------------------------------------
5 files changed, 6 insertions(+), 279 deletions(-)
diffs (truncated from 342 to 300 lines):
diff -r dabf631060e7 -r b696e7b2fee8 INSTALL
--- a/INSTALL Fri Jan 29 11:21:09 2010 -0600
+++ b/INSTALL Fri Jan 29 11:24:03 2010 -0600
@@ -2,7 +2,7 @@
libLAS Installation
***************************************************************
-
+
Unix
~~~~~~~~~~~~~~~~~~~
@@ -37,4 +37,4 @@
Copy the windows package zip file into a directory of your
choosing and unzip. You should be able to run the utility
-applications.
\ No newline at end of file
+applications.
diff -r dabf631060e7 -r b696e7b2fee8 test/unit/CMakeLists.txt
--- a/test/unit/CMakeLists.txt Fri Jan 29 11:21:09 2010 -0600
+++ b/test/unit/CMakeLists.txt Fri Jan 29 11:24:03 2010 -0600
@@ -11,7 +11,6 @@
common.cpp
guid_test.cpp
laserror_test.cpp
- lasfile_test.cpp
lasheader_test.cpp
laspoint_test.cpp
lasreader_iterator_test.cpp
diff -r dabf631060e7 -r b696e7b2fee8 test/unit/Makefile.am
--- a/test/unit/Makefile.am Fri Jan 29 11:21:09 2010 -0600
+++ b/test/unit/Makefile.am Fri Jan 29 11:24:03 2010 -0600
@@ -24,7 +24,6 @@
guid_test.cpp \
lasclassification_test.cpp \
laserror_test.cpp \
- lasfile_test.cpp \
lasheader_test.cpp \
lasspatialreference_test.cpp \
laspoint_test.cpp \
diff -r dabf631060e7 -r b696e7b2fee8 test/unit/common.cpp
--- a/test/unit/common.cpp Fri Jan 29 11:21:09 2010 -0600
+++ b/test/unit/common.cpp Fri Jan 29 11:24:03 2010 -0600
@@ -59,9 +59,9 @@
ensure_equals("wrong default records count",
h.GetRecordsCount(), liblas::uint32_t(0));
ensure_equals("wrong default data format id",
- h.GetDataFormatId(), LASHeader::ePointFormat0);
+ h.GetDataFormatId(), liblas::ePointFormat0);
ensure_equals("wrong default data record length",
- h.GetDataRecordLength(), LASHeader::ePointSize0);
+ h.GetDataRecordLength(), liblas::ePointSize0);
ensure_equals("wrong default point records count",
h.GetPointRecordsCount(), liblas::uint32_t(0));
@@ -139,8 +139,8 @@
ensure_equals(h.GetHeaderSize(), liblas::uint16_t(227));
ensure_equals(h.GetDataOffset(), liblas::uint32_t(229));
ensure_equals(h.GetRecordsCount(), liblas::uint32_t(0));
- ensure_equals(h.GetDataFormatId(), liblas::LASHeader::ePointFormat1);
- ensure_equals(h.GetDataRecordLength(), liblas::LASHeader::ePointSize1);
+ ensure_equals(h.GetDataFormatId(), liblas::ePointFormat1);
+ ensure_equals(h.GetDataRecordLength(), liblas::ePointSize1);
ensure_equals(h.GetPointRecordsCount(), liblas::uint32_t(8));
ensure_equals(h.GetScaleX(), double(0.01));
ensure_equals(h.GetScaleY(), double(0.01));
diff -r dabf631060e7 -r b696e7b2fee8 test/unit/lasfile_test.cpp
--- a/test/unit/lasfile_test.cpp Fri Jan 29 11:21:09 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-// $Id$
-//
-// (C) Copyright Mateusz Loskot 2008, mateusz at loskot.net
-// Distributed under the BSD License
-// (See accompanying file LICENSE.txt or copy at
-// http://www.opensource.org/licenses/bsd-license.php)
-//
-#include <liblas/lasfile.hpp>
-#include <liblas/lasheader.hpp>
-#include <liblas/lasreader.hpp>
-#include <liblas/laswriter.hpp>
-#include <tut/tut.hpp>
-#include <iostream>
-#include <stdexcept>
-#include <string>
-#include "liblas_test.hpp"
-#include "common.hpp"
-
-namespace tut
-{
-
- struct lasfile_data
- {
- std::string tmpfile_;
- std::string file10_;
-
- lasfile_data()
- : tmpfile_(g_test_data_path + "/lasfile_tmp.las"),
- file10_(g_test_data_path + "/TO_core_last_clip.las")
- {}
-
- ~lasfile_data()
- {
- // remove temporary file after each test case
- int const ret = std::remove(tmpfile_.c_str());
- if (0 != ret)
- {
- ; // ignore, file may not exist
- }
- }
- };
-
- typedef test_group<lasfile_data> tg;
- typedef tg::object to;
-
- tg test_group_lasfile("liblas::LASFile");
-
- // Test default constructor
- template<>
- template<>
- void to::test<1>()
- {
- liblas::LASFile file;
- ensure(file.IsNull());
- }
-
- // Test custom constructor
- template<>
- template<>
- void to::test<2>()
- {
- liblas::LASFile file(file10_);
- ensure_not(file.IsNull());
-
- ensure_equals(file.GetName(), file10_);
- ensure_equals(file.GetMode(), liblas::LASFile::eRead);
-
- liblas::LASHeader const& header1 = file.GetHeader();
- test_file10_header(header1);
-
- liblas::LASReader& reader = file.GetReader();
- liblas::LASHeader const& header2 = reader.GetHeader();
- test_file10_header(header2);
-
- try
- {
- liblas::LASWriter& writer = file.GetWriter();
- ensure_equals(writer.GetVersion(), liblas::eLASVersion10);
- ensure("std::runtime_error not thrown", false);
- }
- catch (std::runtime_error const& e)
- {
- ensure_equals(std::string(e.what()).substr(0, 6), std::string("Writer"));
- }
- }
-
- // Test custom constructor
- template<>
- template<>
- void to::test<3>()
- {
- liblas::LASHeader header;
-
- try
- {
- liblas::LASFile file(tmpfile_, header, liblas::LASFile::eRead);
- ensure_equals(file.GetName(), tmpfile_);
- ensure("std::runtime_error not thrown", false);
- }
- catch (std::runtime_error const& e)
- {
- ensure_equals(std::string(e.what()),
- std::string("File mode must be eWrite or eAppend"));
- }
- }
-
- // Test custom constructor
- template<>
- template<>
- void to::test<4>()
- {
- liblas::LASHeader header;
- liblas::LASFile file(tmpfile_, header, liblas::LASFile::eWrite);
- ensure_not(file.IsNull());
- ensure_equals(file.GetName(), tmpfile_);
- ensure_equals(file.GetMode(), liblas::LASFile::eWrite);
-
- liblas::LASHeader const& header1 = file.GetHeader();
- test_default_header(header1);
-
- liblas::LASWriter& writer = file.GetWriter();
- liblas::LASHeader const& header2 = writer.GetHeader();
- test_default_header(header2);
-
- try
- {
- liblas::LASReader& reader = file.GetReader();
- ensure_equals(reader.GetVersion(), liblas::eLASVersion10);
- ensure("std::runtime_error not thrown", false);
- }
- catch (std::runtime_error const& e)
- {
- ensure_equals(std::string(e.what()).substr(0, 6), std::string("Reader"));
- }
- }
-
- // Test copy constructor on default initialized object
- template<>
- template<>
- void to::test<5>()
- {
- liblas::LASFile file;
- ensure(file.IsNull());
-
- liblas::LASFile file2(file);
- ensure(file2.IsNull());
- }
-
- // Test assignment operator
- template<>
- template<>
- void to::test<6>()
- {
- liblas::LASFile file;
- ensure(file.IsNull());
-
- liblas::LASFile file2;
- file2 = file;
- ensure(file2.IsNull());
- }
-
- // Test copy constructor on read-only file
- template<>
- template<>
- void to::test<7>()
- {
- liblas::LASFile file(file10_);
-
- ensure_not(file.IsNull());
- ensure_equals(file.GetName(), file10_);
- ensure_equals(file.GetMode(), liblas::LASFile::eRead);
-
- liblas::LASHeader const& header1 = file.GetHeader();
- test_file10_header(header1);
-
- liblas::LASFile file2(file);
-
- ensure_not(file2.IsNull());
- ensure_equals(file2.GetName(), file10_);
- ensure_equals(file2.GetMode(), liblas::LASFile::eRead);
-
- liblas::LASHeader const& header2 = file2.GetHeader();
- test_file10_header(header2);
- }
-
- // Test assignment operator on read-only file
- template<>
- template<>
- void to::test<8>()
- {
- liblas::LASFile file2;
-
- {
- liblas::LASFile file(file10_);
-
- ensure_not(file.IsNull());
- ensure_equals(file.GetName(), file10_);
- ensure_equals(file.GetMode(), liblas::LASFile::eRead);
-
- liblas::LASHeader const& header1 = file.GetHeader();
- test_file10_header(header1);
-
- file2 = file;
-
- // file object is deallocated here
- }
-
- ensure_not(file2.IsNull());
- ensure_equals(file2.GetName(), file10_);
- ensure_equals(file2.GetMode(), liblas::LASFile::eRead);
-
- liblas::LASHeader const& header1 = file2.GetHeader();
- test_file10_header(header1);
- }
-
- // Test assignment operator on write-only file
- template<>
- template<>
- void to::test<9>()
- {
- liblas::LASHeader header;
- liblas::LASFile file(tmpfile_, header, liblas::LASFile::eWrite);
-
- ensure_not(file.IsNull());
- ensure_equals(file.GetName(), tmpfile_);
- ensure_equals(file.GetMode(), liblas::LASFile::eWrite);
-
- liblas::LASHeader const& header1 = file.GetHeader();
- test_default_header(header1);
More information about the Liblas-commits
mailing list