MCPcopy Create free account
hub / github.com/PDAL/PDAL / compareFiles

Function compareFiles

test/unit/io/LasWriterTest.cpp:1053–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1051}
1052
1053void compareFiles(const std::string& name1, const std::string& name2,
1054 size_t increment = 100)
1055{
1056 Options o1;
1057 o1.add("filename", name1);
1058
1059 Options o2;
1060 o2.add("filename", name2);
1061
1062 LasReader r1;
1063 r1.setOptions(o1);
1064
1065 LasReader r2;
1066 r2.setOptions(o2);
1067
1068 PointTable t1;
1069 r1.prepare(t1);
1070 PointViewSet s1 = r1.execute(t1);
1071 EXPECT_EQ(s1.size(), 1u);
1072 PointViewPtr v1 = *s1.begin();
1073 DimTypeList d1 = v1->dimTypes();
1074 size_t size1 = v1->pointSize();
1075 std::vector<char> buf1(size1);
1076
1077 PointTable t2;
1078 r2.prepare(t2);
1079 PointViewSet s2 = r2.execute(t2);
1080 EXPECT_EQ(s2.size(), 1u);
1081 PointViewPtr v2 = *s2.begin();
1082 DimTypeList d2 = v2->dimTypes();
1083 size_t size2 = v2->pointSize();
1084 std::vector<char> buf2(size2);
1085
1086 EXPECT_EQ(v1->size(), v2->size());
1087 EXPECT_EQ(d1.size(), d2.size());
1088 EXPECT_EQ(size1, size2);
1089
1090 for (PointId i = 0; i < (std::min)(size1, size2); i += increment)
1091 {
1092 v1->getPackedPoint(d1, i, buf1.data());
1093 v2->getPackedPoint(d2, i, buf2.data());
1094 EXPECT_EQ(memcmp(buf1.data(), buf2.data(), (std::min)(size1, size2)), 0);
1095 }
1096}
1097
1098TEST(LasWriterTest, stream)
1099{

Callers 1

TESTFunction · 0.70

Calls 9

setOptionsMethod · 0.80
pointSizeMethod · 0.80
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
dimTypesMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected