Changeset 528:248680ae10e9
- Timestamp:
- 04/23/08 15:51:32 (2 years ago)
- Branch:
- default
- Convert:
- svn:1766ff46-f334-0410-ab20-d63176f87757/trunk@593
- File:
-
- 1 edited
-
test/unit/lasheader_test.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
test/unit/lasheader_test.cpp
r523 r528 193 193 std::string sysid1("Short Sys Id"); // 12 bytes 194 194 std::string::size_type const len1 = sysid1.size(); 195 std::string sysid2("Long System Identifier - and some garbage"); // 41bytes195 std::string sysid2("Long System Identifier - XXX YYY"); // 32 bytes 196 196 std::string::size_type const len2 = sysid2.size(); 197 197 … … 203 203 ensure_equals(h.GetSystemId(true).size(), 32); 204 204 205 // TODO: Should we allow passing longer identifier than 32 bytes 206 // and truncate it implicitly, so the following test will pass? 207 //h.SetSystemId(sysid2); 208 //ensure_equals(h.GetSystemId(), sysid2.substr(0, 32)); 209 //ensure_equals(h.GetSystemId().size(), len2); 210 //ensure_equals(h.GetSystemId(true).size(), 32); 205 h.SetSystemId(sysid2); 206 ensure_equals(h.GetSystemId(), sysid2); 207 ensure_equals(h.GetSystemId().size(), len2); 208 ensure_equals(h.GetSystemId(true).size(), 32); 211 209 } 212 210 … … 218 216 using liblas::LASHeader; 219 217 220 std::string softd1("Short Soft Id"); // 13 bytes 221 std::string::size_type const len1 = softd1.size(); 218 std::string softid1("Short Soft Id"); // 13 bytes 219 std::string::size_type const len1 = softid1.size(); 220 std::string softid2("Long Software Identifier - XX YY"); // 32 bytes 221 std::string::size_type const len2 = softid2.size(); 222 222 223 223 LASHeader h; 224 h.SetSoftwareId(soft d1);225 ensure_equals(h.GetSoftwareId(), soft d1);224 h.SetSoftwareId(softid1); 225 ensure_equals(h.GetSoftwareId(), softid1); 226 226 ensure_equals(h.GetSoftwareId().size(), len1); 227 227 ensure_equals(h.GetSoftwareId(true).size(), 32); 228 228 229 // TODO: What about passing longer value and implicit truncation? 229 h.SetSoftwareId(softid2); 230 ensure_equals(h.GetSoftwareId(), softid2); 231 ensure_equals(h.GetSoftwareId().size(), len2); 232 ensure_equals(h.GetSoftwareId(true).size(), 32); 230 233 } 231 234
Note: See TracChangeset
for help on using the changeset viewer.
