Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ullingerc committed Oct 1, 2024
1 parent 1378bc5 commit f50a959
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions test/engine/SpatialJoinTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,66 @@ std::vector<std::vector<std::string>> expectedMaxDist10000000_rows_diff{
mergeToRow(unordered_rows.at(4), unordered_rows_small.at(3),
expectedDistEifLib)};

std::vector<std::vector<std::string>> expectedNearestNeighbors1{
mergeToRow(unordered_rows.at(0), unordered_rows.at(0), expectedDistSelf),
mergeToRow(unordered_rows.at(1), unordered_rows.at(1), expectedDistSelf),
mergeToRow(unordered_rows.at(2), unordered_rows.at(2), expectedDistSelf),
mergeToRow(unordered_rows.at(3), unordered_rows.at(3), expectedDistSelf),
mergeToRow(unordered_rows.at(4), unordered_rows.at(4), expectedDistSelf)};

std::vector<std::vector<std::string>> expectedNearestNeighbors2{
mergeToRow(unordered_rows.at(0), unordered_rows.at(0), expectedDistSelf),
mergeToRow(unordered_rows.at(1), unordered_rows.at(1), expectedDistSelf),
mergeToRow(unordered_rows.at(2), unordered_rows.at(2), expectedDistSelf),
mergeToRow(unordered_rows.at(3), unordered_rows.at(3), expectedDistSelf),
mergeToRow(unordered_rows.at(4), unordered_rows.at(4), expectedDistSelf),
mergeToRow(unordered_rows.at(0), unordered_rows.at(1), expectedDistUniMun),
mergeToRow(unordered_rows.at(1), unordered_rows.at(0), expectedDistUniMun),
mergeToRow(unordered_rows.at(2), unordered_rows.at(4), expectedDistEyeEif),
mergeToRow(unordered_rows.at(3), unordered_rows.at(2), expectedDistEyeLib),
mergeToRow(unordered_rows.at(4), unordered_rows.at(2), expectedDistEyeEif)};

std::vector<std::vector<std::string>> expectedNearestNeighbors2_400000{
mergeToRow(unordered_rows.at(0), unordered_rows.at(0), expectedDistSelf),
mergeToRow(unordered_rows.at(1), unordered_rows.at(1), expectedDistSelf),
mergeToRow(unordered_rows.at(2), unordered_rows.at(2), expectedDistSelf),
mergeToRow(unordered_rows.at(3), unordered_rows.at(3), expectedDistSelf),
mergeToRow(unordered_rows.at(4), unordered_rows.at(4), expectedDistSelf),
mergeToRow(unordered_rows.at(0), unordered_rows.at(1), expectedDistUniMun),
mergeToRow(unordered_rows.at(1), unordered_rows.at(0), expectedDistUniMun),
mergeToRow(unordered_rows.at(2), unordered_rows.at(4), expectedDistEyeEif),
mergeToRow(unordered_rows.at(4), unordered_rows.at(2), expectedDistEyeEif)};

std::vector<std::vector<std::string>> expectedNearestNeighbors2_4000{
mergeToRow(unordered_rows.at(0), unordered_rows.at(0), expectedDistSelf),
mergeToRow(unordered_rows.at(1), unordered_rows.at(1), expectedDistSelf),
mergeToRow(unordered_rows.at(2), unordered_rows.at(2), expectedDistSelf),
mergeToRow(unordered_rows.at(3), unordered_rows.at(3), expectedDistSelf),
mergeToRow(unordered_rows.at(4), unordered_rows.at(4), expectedDistSelf),
mergeToRow(unordered_rows.at(0), unordered_rows.at(1), expectedDistUniMun),
mergeToRow(unordered_rows.at(1), unordered_rows.at(0), expectedDistUniMun)};

std::vector<std::vector<std::string>> expectedNearestNeighbors2_40{
mergeToRow(unordered_rows.at(0), unordered_rows.at(0), expectedDistSelf),
mergeToRow(unordered_rows.at(1), unordered_rows.at(1), expectedDistSelf),
mergeToRow(unordered_rows.at(2), unordered_rows.at(2), expectedDistSelf),
mergeToRow(unordered_rows.at(3), unordered_rows.at(3), expectedDistSelf),
mergeToRow(unordered_rows.at(4), unordered_rows.at(4), expectedDistSelf)};

std::vector<std::vector<std::string>> expectedNearestNeighbors3_500000{
mergeToRow(unordered_rows.at(0), unordered_rows.at(0), expectedDistSelf),
mergeToRow(unordered_rows.at(1), unordered_rows.at(1), expectedDistSelf),
mergeToRow(unordered_rows.at(2), unordered_rows.at(2), expectedDistSelf),
mergeToRow(unordered_rows.at(3), unordered_rows.at(3), expectedDistSelf),
mergeToRow(unordered_rows.at(4), unordered_rows.at(4), expectedDistSelf),
mergeToRow(unordered_rows.at(0), unordered_rows.at(1), expectedDistUniMun),
mergeToRow(unordered_rows.at(1), unordered_rows.at(0), expectedDistUniMun),
mergeToRow(unordered_rows.at(1), unordered_rows.at(4), expectedDistMunEif),
mergeToRow(unordered_rows.at(0), unordered_rows.at(4), expectedDistUniEif),
mergeToRow(unordered_rows.at(2), unordered_rows.at(4), expectedDistEyeEif),
mergeToRow(unordered_rows.at(4), unordered_rows.at(2), expectedDistEyeEif),
mergeToRow(unordered_rows.at(4), unordered_rows.at(0), expectedDistUniEif)};

// test the compute result method on small examples
TEST(SpatialJoin, computeResultSmallDatasetLargeChildren) {
std::vector<std::string> columnNames = {
Expand Down Expand Up @@ -855,6 +915,22 @@ TEST(SpatialJoin, computeResultSmallDatasetLargeChildren) {
buildAndTestSmallTestSetLargeChildren("<max-distance-in-meters:10000000>",
false, expectedMaxDist10000000_rows,
columnNames);
buildAndTestSmallTestSetLargeChildren("<nearest-neighbors:1>", true,
expectedNearestNeighbors1, columnNames);
buildAndTestSmallTestSetLargeChildren("<nearest-neighbors:2>", true,
expectedNearestNeighbors2, columnNames);
buildAndTestSmallTestSetLargeChildren("<nearest-neighbors:2:400000>", true,
expectedNearestNeighbors2_400000,
columnNames);
buildAndTestSmallTestSetLargeChildren("<nearest-neighbors:2:4000>", true,
expectedNearestNeighbors2_4000,
columnNames);
buildAndTestSmallTestSetLargeChildren("<nearest-neighbors:2:40>", true,
expectedNearestNeighbors2_40,
columnNames);
buildAndTestSmallTestSetLargeChildren("<nearest-neighbors:3:500000>", true,
expectedNearestNeighbors3_500000,
columnNames);
}

TEST(SpatialJoin, computeResultSmallDatasetSmallChildren) {
Expand Down

0 comments on commit f50a959

Please sign in to comment.