[Core] Correctly handle float division in Scalar.
Patch by Tom Tromey!
Differential Revision: https://reviews.llvm.org/D44693
llvm-svn: 328649
diff --git a/lldb/unittests/Core/ScalarTest.cpp b/lldb/unittests/Core/ScalarTest.cpp
index fedcd19..47fa021 100644
--- a/lldb/unittests/Core/ScalarTest.cpp
+++ b/lldb/unittests/Core/ScalarTest.cpp
@@ -132,3 +132,11 @@
EXPECT_EQ(std::to_string(std::numeric_limits<unsigned long long>::max()),
ScalarGetValue(std::numeric_limits<unsigned long long>::max()));
}
+
+TEST(ScalarTest, Division) {
+ Scalar lhs(5.0);
+ Scalar rhs(2.0);
+ Scalar r = lhs / rhs;
+ EXPECT_TRUE(r.IsValid());
+ EXPECT_EQ(r, Scalar(2.5));
+}