summaryrefslogtreecommitdiffstats
path: root/tests/stdlib_test.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-03-17 16:40:26 -0700
committerChristopher Ferris <cferris@google.com>2014-03-17 16:40:26 -0700
commitf171b34cf045115b82ccb89b57feb56d3cad472b (patch)
tree60d746b63387b151f00dfd3272773f2701e93929 /tests/stdlib_test.cpp
parentf212bbf666b77777063a3a94a672bcae80b15253 (diff)
downloadbionic-f171b34cf045115b82ccb89b57feb56d3cad472b.zip
bionic-f171b34cf045115b82ccb89b57feb56d3cad472b.tar.gz
bionic-f171b34cf045115b82ccb89b57feb56d3cad472b.tar.bz2
Use the float/double assert macros.
The normal ASSERT_EQ macros don't work quite right for float/double values, and result in false failures. Use the correct macros instead. Bug: 13511379 Change-Id: Ic2feee7f3d3569f57b6453b8fa95222846c625cd
Diffstat (limited to 'tests/stdlib_test.cpp')
-rw-r--r--tests/stdlib_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp
index 7bdb685..3a3fe28 100644
--- a/tests/stdlib_test.cpp
+++ b/tests/stdlib_test.cpp
@@ -188,17 +188,17 @@ TEST(stdlib, system) {
}
TEST(stdlib, atof) {
- ASSERT_EQ(1.23, atof("1.23"));
+ ASSERT_DOUBLE_EQ(1.23, atof("1.23"));
}
TEST(stdlib, strtod) {
- ASSERT_EQ(1.23, strtod("1.23", NULL));
+ ASSERT_DOUBLE_EQ(1.23, strtod("1.23", NULL));
}
TEST(stdlib, strtof) {
- ASSERT_EQ(1.23, strtod("1.23", NULL));
+ ASSERT_FLOAT_EQ(1.23, strtof("1.23", NULL));
}
TEST(stdlib, strtold) {
- ASSERT_EQ(1.23, strtold("1.23", NULL));
+ ASSERT_DOUBLE_EQ(1.23, strtold("1.23", NULL));
}