src/base/str.test.cc
/** Test that a double that can be converted to int is always rounded down. */
Test that a double that can be converted to int is always rounded down.
Test that a double that can be converted to int is always rounded down .
TEST(StrTest, ToNumberUnsigned8BitIntRoundDown)
{
    uint8_t output;
    std::string input_1 = "2.99";
    EXPECT_TRUE(to_number(input_1, output));
    EXPECT_EQ(2, output);
    std::string input_2 = "3.99";
    EXPECT_TRUE(to_number(input_2, output));
    EXPECT_EQ(3, output);
}
TEST ( StrTest , ToNumberUnsigned8BitIntRoundDown ) { uint8_t output ; std :: string input_1 = " " ; EXPECT_TRUE ( to_number ( input_1 , output ) ) ; EXPECT_EQ ( 2 , output ) ; std :: string input_2 = " " ; EXPECT_TRUE ( to_number ( input_2 , output ) ) ; EXPECT_EQ ( 3 , output ) ; }
Test that a double that can be converted to int is always rounded down.
Test that a double that can be converted to int is always rounded down .