summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp')
-rw-r--r--searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp b/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
index bd40a4566cd..ad20684bd04 100644
--- a/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
+++ b/searchlib/src/tests/engine/proto_converter/proto_converter_test.cpp
@@ -69,7 +69,28 @@ TEST_F(SearchRequestTest, require_that_trace_level_is_converted) {
TEST_F(SearchRequestTest, require_that_profile_depth_is_converted) {
proto.set_profile_depth(7);
convert();
- EXPECT_EQ(request.trace().getProfileDepth(), 7);
+ EXPECT_EQ(request.trace().match_profile_depth(), 7);
+ EXPECT_EQ(request.trace().first_phase_profile_depth(), 7);
+ EXPECT_EQ(request.trace().second_phase_profile_depth(), 7);
+}
+
+TEST_F(SearchRequestTest, require_that_profiling_params_are_converted) {
+ proto.mutable_profiling()->mutable_match()->set_depth(4);
+ proto.mutable_profiling()->mutable_first_phase()->set_depth(5);
+ proto.mutable_profiling()->mutable_second_phase()->set_depth(6);
+ convert();
+ EXPECT_EQ(request.trace().match_profile_depth(), 4);
+ EXPECT_EQ(request.trace().first_phase_profile_depth(), 5);
+ EXPECT_EQ(request.trace().second_phase_profile_depth(), 6);
+}
+
+TEST_F(SearchRequestTest, require_that_profile_depth_is_fallback) {
+ proto.mutable_profiling()->mutable_first_phase()->set_depth(5);
+ proto.set_profile_depth(7);
+ convert();
+ EXPECT_EQ(request.trace().match_profile_depth(), 7);
+ EXPECT_EQ(request.trace().first_phase_profile_depth(), 5);
+ EXPECT_EQ(request.trace().second_phase_profile_depth(), 7);
}
TEST_F(SearchRequestTest, require_that_sorting_is_converted) {