From 79ff30cd9ec64651af8deda8f6800c1234e79449 Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Thu, 19 Jan 2023 15:22:39 +0000 Subject: separate profiling depth parameters --- .../proto_converter/proto_converter_test.cpp | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'searchlib/src/tests/engine') 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) { -- cgit v1.2.3