MCPcopy Create free account
hub / github.com/MikeLankamp/fpm / test_conversion

Method test_conversion

tests/input.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44 template <typename B, typename I, unsigned int F>
45 void test_conversion(const std::string& text, fpm::fixed<B, I, F> expected, const std::string& expected_remaining = "")
46 {
47 std::istringstream ss(text);
48 ss.imbue(m_locale);
49
50 fpm::fixed<B, I, F> value;
51 ss >> value;
52
53 // Values should match
54 EXPECT_EQ(value, expected) << "for text: \"" << text << "\"";
55 EXPECT_TRUE(ss);
56
57 EXPECT_EQ(get_remainder(ss), expected_remaining) << "for text: \"" << text << "\"";
58 }
59
60 void test_invalid_conversion(const std::string& text, const std::string& expected_remaining = "")
61 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected