[Liblas-commits] hg-main-tree: lint
liblas-commits at liblas.org
liblas-commits at liblas.org
Mon Aug 15 15:15:26 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/55e4d13317d5
changeset: 1096:55e4d13317d5
user: Michael P. Gerlek <mpg at flaxen.com>
date: Mon Aug 15 12:08:59 2011 -0700
description:
lint
Subject: hg-main-tree: patch for probably-not-to-be-fixed liblas writer test
details: http://hg.libpc.orghg-main-tree/rev/19e41307eaa8
changeset: 1097:19e41307eaa8
user: Michael P. Gerlek <mpg at flaxen.com>
date: Mon Aug 15 12:15:08 2011 -0700
description:
patch for probably-not-to-be-fixed liblas writer test
diffstat:
test/data/laszip/laszip-generated_with2bytespadding.laz | 0
test/unit/LiblasWriterTest.cpp | 2 +-
test/unit/Support.cpp | 9 +++++++--
3 files changed, 8 insertions(+), 3 deletions(-)
diffs (33 lines):
diff -r 357144aac7f8 -r 19e41307eaa8 test/data/laszip/laszip-generated_with2bytespadding.laz
Binary file test/data/laszip/laszip-generated_with2bytespadding.laz has changed
diff -r 357144aac7f8 -r 19e41307eaa8 test/unit/LiblasWriterTest.cpp
--- a/test/unit/LiblasWriterTest.cpp Mon Aug 15 12:03:11 2011 -0700
+++ b/test/unit/LiblasWriterTest.cpp Mon Aug 15 12:15:08 2011 -0700
@@ -158,7 +158,7 @@
FileUtils::closeFile(ofs);
bool filesSame = Support::compare_files(Support::temppath("LiblasWriterTest_test_simple_laz.laz"),
- Support::datapath("laszip/laszip-generated.laz"));
+ Support::datapath("laszip/laszip-generated_with2bytespadding.laz"));
BOOST_CHECK(filesSame);
if (filesSame)
diff -r 357144aac7f8 -r 19e41307eaa8 test/unit/Support.cpp
--- a/test/unit/Support.cpp Mon Aug 15 12:03:11 2011 -0700
+++ b/test/unit/Support.cpp Mon Aug 15 12:15:08 2011 -0700
@@ -69,8 +69,13 @@
pdal::Schema const& b_schema = b.getSchema();
if (a_schema != b_schema) return false;
- boost::uint64_t a_num_points = a.getNumPoints();
- boost::uint64_t b_num_points = b.getNumPoints();
+ boost::uint64_t a_num_points64 = a.getNumPoints();
+ boost::uint64_t b_num_points64 = b.getNumPoints();
+ if (a_num_points64 > std::numeric_limits<boost::uint32_t>::max() ||
+ b_num_points64 > std::numeric_limits<boost::uint32_t>::max())
+ throw pdal::pdal_error("unable to do compare_stage_data for > 2^32 points");
+ boost::uint32_t a_num_points = static_cast<boost::uint32_t>(a_num_points64);
+ boost::uint32_t b_num_points = static_cast<boost::uint32_t>(b_num_points64);
if (a_num_points != b_num_points) return false;
pdal::StageSequentialIterator* a_itr = a.createSequentialIterator();
More information about the Liblas-commits
mailing list