Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/base_tests/math_test.cpp')
-rw-r--r--base/base_tests/math_test.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/base/base_tests/math_test.cpp b/base/base_tests/math_test.cpp
index 16eb1e5f9c..cc79055856 100644
--- a/base/base_tests/math_test.cpp
+++ b/base/base_tests/math_test.cpp
@@ -158,3 +158,25 @@ UNIT_TEST(GCD_Test)
TEST_EQUAL(my::GCD(8, 3), 1, ());
TEST_EQUAL(my::GCD(9, 3), 3, ());
}
+
+UNIT_TEST(LCM_Test)
+{
+ TEST_EQUAL(my::LCM(6, 3), 6, ());
+ TEST_EQUAL(my::LCM(14, 7), 14, ());
+ TEST_EQUAL(my::LCM(100, 100), 100, ());
+ TEST_EQUAL(my::LCM(7, 3), 21, ());
+ TEST_EQUAL(my::LCM(8, 3), 24, ());
+ TEST_EQUAL(my::LCM(9, 3), 9, ());
+}
+
+UNIT_TEST(Sign_test)
+{
+ TEST_EQUAL(1, my::Sign(1), ());
+ TEST_EQUAL(1, my::Sign(10.4), ());
+
+ TEST_EQUAL(0, my::Sign(0), ());
+ TEST_EQUAL(0, my::Sign(0.0), ());
+
+ TEST_EQUAL(-1, my::Sign(-11), ());
+ TEST_EQUAL(-1, my::Sign(-10.4), ());
+}