This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 11f9f5f [chore][be-test] Link gtest_main to provide default main
function definition. (#8631)
11f9f5f is described below
commit 11f9f5fe4d7b3865fcb12980b6a8de752651453d
Author: Adonis Ling <[email protected]>
AuthorDate: Mon Mar 28 10:14:48 2022 +0800
[chore][be-test] Link gtest_main to provide default main function
definition. (#8631)
---
be/CMakeLists.txt | 4 ++++
be/test/util/quantile_state_test.cpp | 10 +++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 110bbf5..4c1c9e8 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -152,6 +152,9 @@ set_target_properties(protoc PROPERTIES IMPORTED_LOCATION
${THIRDPARTY_DIR}/lib/
add_library(gtest STATIC IMPORTED)
set_target_properties(gtest PROPERTIES IMPORTED_LOCATION
${THIRDPARTY_DIR}/lib/libgtest.a)
+add_library(gtest_main STATIC IMPORTED)
+set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION
${THIRDPARTY_DIR}/lib/libgtest_main.a)
+
add_library(benchmark STATIC IMPORTED)
set_target_properties(benchmark PROPERTIES IMPORTED_LOCATION
${THIRDPARTY_DIR}/lib/libbenchmark.a)
@@ -681,6 +684,7 @@ set (TEST_LINK_LIBS ${DORIS_LINK_LIBS}
Test_util
gmock
gtest
+ gtest_main
${WL_END_GROUP}
)
diff --git a/be/test/util/quantile_state_test.cpp
b/be/test/util/quantile_state_test.cpp
index 05d3e1e..efc8cb7 100644
--- a/be/test/util/quantile_state_test.cpp
+++ b/be/test/util/quantile_state_test.cpp
@@ -32,7 +32,7 @@ TEST(QuantileStateTest, merge) {
empty.add_value(4);
empty.add_value(5);
ASSERT_EQ(1, empty.get_value_by_percentile(0));
- ASSERT_EQ(2.5, empty.get_value_by_percentile(0.5));
+ ASSERT_EQ(3, empty.get_value_by_percentile(0.5));
ASSERT_EQ(5, empty.get_value_by_percentile(1));
DoubleQuantileState another;
@@ -41,9 +41,9 @@ TEST(QuantileStateTest, merge) {
another.add_value(8);
another.add_value(9);
another.add_value(10);
- ASSERT_EQ(6, empty.get_value_by_percentile(0));
- ASSERT_EQ(7.5, empty.get_value_by_percentile(0.5));
- ASSERT_EQ(10, empty.get_value_by_percentile(1));
+ ASSERT_EQ(6, another.get_value_by_percentile(0));
+ ASSERT_EQ(8, another.get_value_by_percentile(0.5));
+ ASSERT_EQ(10, another.get_value_by_percentile(1));
another.merge(empty);
ASSERT_EQ(1, another.get_value_by_percentile(0));
@@ -51,4 +51,4 @@ TEST(QuantileStateTest, merge) {
ASSERT_EQ(10, another.get_value_by_percentile(1));
}
-} // namespace doris
\ No newline at end of file
+} // namespace doris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]