summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/features/prod_features.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-02-06 15:08:29 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-02-06 15:08:29 +0000
commitedaf5136db5f14c1a1595c4c6a9a82ea22548aca (patch)
tree7a0c6e421c9b3ee16d4f59d96a5b222ae3875a42 /searchlib/src/tests/features/prod_features.cpp
parent8e9ec7f77efecfa970b58568f024a118122b334e (diff)
- Improve sanity checking of input to distance-to-path feature.
- Keep comment
Diffstat (limited to 'searchlib/src/tests/features/prod_features.cpp')
-rw-r--r--searchlib/src/tests/features/prod_features.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/searchlib/src/tests/features/prod_features.cpp b/searchlib/src/tests/features/prod_features.cpp
index 81c46558381..4ebc94ccb8b 100644
--- a/searchlib/src/tests/features/prod_features.cpp
+++ b/searchlib/src/tests/features/prod_features.cpp
@@ -828,13 +828,12 @@ struct AirPort {
};
std::pair<int32_t, int32_t> toXY(const AirPort &p) {
- return std::make_pair((int)(p.lng * 1.0e6),
- (int)(p.lat * 1.0e6));
+ return std::make_pair(int(p.lng * 1.0e6), int(p.lat * 1.0e6));
}
GeoLocation toGL(const AirPort &p) {
- int32_t x = (int)(p.lng * 1.0e6);
- int32_t y = (int)(p.lat * 1.0e6);
+ auto x = int(p.lng * 1.0e6);
+ auto y = int(p.lat * 1.0e6);
GeoLocation::Point gp{x, y};
return GeoLocation{gp};
}
@@ -1054,6 +1053,8 @@ Test::testDistanceToPath()
pos.emplace_back(0, 0);
// invalid path
+ assertDistanceToPath(pos, "");
+ assertDistanceToPath(pos, "()");
assertDistanceToPath(pos, "a");
assertDistanceToPath(pos, "(");
assertDistanceToPath(pos, "(a");