add test for printInt() sign correctness

This commit is contained in:
Dennis Luxen 2015-03-30 12:37:39 +02:00
parent f553896e2d
commit 5bed7f292f

View File

@ -58,8 +58,13 @@ BOOST_AUTO_TEST_CASE(print_int)
char buffer[12];
buffer[11] = 0; // zero termination
std::string output = printInt<11, 8>(buffer, 314158976);
BOOST_CHECK_EQUAL(output, "3.14158976");
}
buffer[11] = 0;
output = printInt<11, 8>(buffer, 0);
BOOST_CHECK_EQUAL(output, "0.00000000");
output = printInt<11, 8>(buffer, -314158976);
BOOST_CHECK_EQUAL(output, "-3.14158976");}
BOOST_AUTO_TEST_SUITE_END()