Changeset 645:7f8f1f16dfe1
- Timestamp:
- 05/14/08 15:47:43 (2 years ago)
- Branch:
- default
- Convert:
- svn:1766ff46-f334-0410-ab20-d63176f87757/trunk@712
- Files:
-
- 3 edited
-
include/liblas/lasrecordheader.hpp (modified) (2 diffs)
-
src/lasrecordheader.cpp (modified) (3 diffs)
-
test/unit/lasrecordheader_test.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
include/liblas/lasrecordheader.hpp
r644 r645 82 82 /// The character data is up to 16 bytes long. 83 83 /// \exception No throw 84 std::string GetUserId(bool pad /*= false*/) ;84 std::string GetUserId(bool pad /*= false*/) const; 85 85 86 86 void SetUserId(std::string const&); … … 102 102 /// The character data is up to 32 bytes long. 103 103 /// \exception No throw 104 std::string GetDescription(bool pad /*= false*/) ;104 std::string GetDescription(bool pad /*= false*/) const; 105 105 106 106 void SetDescription(std::string const&); -
src/lasrecordheader.cpp
r644 r645 116 116 } 117 117 118 std::string LASVLR::GetUserId(bool pad /*= false*/) 118 std::string LASVLR::GetUserId(bool pad /*= false*/) const 119 119 { 120 120 // copy array of chars and trim zeros if smaller than 32 bytes … … 161 161 } 162 162 163 std::string LASVLR::GetDescription(bool pad /*= false*/) 163 std::string LASVLR::GetDescription(bool pad /*= false*/) const 164 164 { 165 165 // copy array of chars and trim zeros if smaller than 32 bytes … … 201 201 { 202 202 return (m_recordId == other.m_recordId 203 && m_userId == other.m_userId204 && m_desc == other.m_desc203 && std::string(m_userId) == std::string(other.m_userId) 204 && std::string(m_desc) == std::string(other.m_desc) 205 205 && m_reserved == other.m_reserved 206 206 && m_recordLength == other.m_recordLength); -
test/unit/lasrecordheader_test.cpp
r460 r645 15 15 struct lasrecordheader_data 16 16 { 17 liblas::LAS RecordHeaderm_default;17 liblas::LASVLR m_default; 18 18 19 void test_default(liblas::LAS RecordHeaderconst& h)19 void test_default(liblas::LASVLR const& h) 20 20 { 21 21 ensure_equals("wrong default reserved bytes", … … 26 26 27 27 ensure_equals("wrong default record length", 28 h.Ge RecordLength(), liblas::uint16_t());28 h.GetRecordLength(), liblas::uint16_t()); 29 29 30 30 ensure_equals("wrong default user identifier", 31 h.GetUserId( ), std::string());31 h.GetUserId(true).c_str(), std::string()); 32 32 33 33 ensure_equals("wrong default description", 34 h.Get UserId(), std::string());34 h.GetDescription(true).c_str(), std::string()); 35 35 } 36 36 }; … … 39 39 typedef tg::object to; 40 40 41 tg test_group_lasrecordheader("liblas::LAS RecordHeader");41 tg test_group_lasrecordheader("liblas::LASVLR"); 42 42 43 43 // Test default constructor … … 54 54 void to::test<2>() 55 55 { 56 liblas::LAS RecordHeaderhdr_copy(m_default);56 liblas::LASVLR hdr_copy(m_default); 57 57 test_default(hdr_copy); 58 58 } … … 63 63 void to::test<3>() 64 64 { 65 liblas::LAS RecordHeaderhdr_copy;65 liblas::LASVLR hdr_copy; 66 66 test_default(hdr_copy); 67 67 … … 75 75 void to::test<4>() 76 76 { 77 liblas::LAS RecordHeaderhdr;77 liblas::LASVLR hdr; 78 78 ensure("two default headers not equal", m_default.equal(hdr)); 79 79 80 liblas::LAS RecordHeaderhdr_copy(m_default);80 liblas::LASVLR hdr_copy(m_default); 81 81 ensure("copy of default header not equal", hdr.equal(m_default)); 82 82 } … … 87 87 void to::test<5>() 88 88 { 89 liblas::LAS RecordHeaderhdr;89 liblas::LASVLR hdr; 90 90 ensure("two default headers not equal", m_default == hdr); 91 91 92 liblas::LAS RecordHeaderhdr_copy(m_default);92 liblas::LASVLR hdr_copy(m_default); 93 93 ensure("copy of default header not equal", hdr == m_default); 94 94 } … … 99 99 void to::test<6>() 100 100 { 101 liblas::LAS RecordHeaderhdr;101 liblas::LASVLR hdr; 102 102 ensure_not("two default headers not equal", m_default != hdr); 103 103 104 liblas::LAS RecordHeaderhdr_copy(m_default);104 liblas::LASVLR hdr_copy(m_default); 105 105 ensure_not("copy of default header not equal", hdr != m_default); 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.
