ASSERT_FLOAT_EQ(expected, actual);ASSERT_DOUBLE_EQ(expected, actual);EXPECT_FLOAT_EQ(expected, actual);EXPECT_DOUBLE_EQ(expected, actual);
assertEquals(float expected, float actual, float delta);assertEquals(double expected, double actual, double delta);
TEST(SquareRootTest, CorrectResultForPositiveNumbers) { EXPECT_FLOAT_EQ(2.0f, FloatSquareRoot(4.0f)); EXPECT_FLOAT_EQ(23.3333f, FloatSquareRoot(544.44444f)); EXPECT_DOUBLE_EQ(2.0, DoubleSquareRoot(4.0)); EXPECT_DOUBLE_EQ(23.33333333333333, DoubleSquareRoot(544.44444444444444)); // the above succeeds EXPECT_EQ(2.0, DoubleSquareRoot(4.0)); // the above fails EXPECT_EQ(23.33333333333333, DoubleSquareRoot(544.44444444444444));}
can you set some default so you don't have to enter a second param each time?
The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments.
can you set some default so you don't have to enter a second param each time?
ReplyDelete