MCPcopy Create free account
hub / github.com/apache/arrow / CheckDecimalFromRealIntegerString

Function CheckDecimalFromRealIntegerString

cpp/src/arrow/util/decimal_test.cc:823–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821
822template <typename Decimal, typename Real>
823void CheckDecimalFromRealIntegerString(Real real, int32_t precision, int32_t scale,
824 const std::string& expected) {
825 ASSERT_OK_AND_ASSIGN(auto dec, Decimal::FromReal(real, precision, scale));
826 EXPECT_EQ(dec.ToIntegerString(), expected);
827 const std::string expected_neg = (dec) ? "-" + expected : expected;
828 ASSERT_OK_AND_ASSIGN(dec, Decimal::FromReal(-real, precision, scale));
829 EXPECT_EQ(dec.ToIntegerString(), expected_neg);
830}
831
832template <typename Real>
833struct FromRealTestParam {

Callers

nothing calls this directly

Calls 2

ToIntegerStringMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70

Tested by

no test coverage detected