• Home
  • Raw
  • Download

Lines Matching refs:fn

437 void TestSingleWcsToInt(WcsToIntFn<T> fn, const wchar_t* str, int base,  in TestSingleWcsToInt()  argument
440 ASSERT_EQ(expected_value, fn(str, &p, base)); in TestSingleWcsToInt()
445 void TestWcsToInt(WcsToIntFn<T> fn) { in TestWcsToInt() argument
446 TestSingleWcsToInt(fn, L"123", 10, static_cast<T>(123), 3); in TestWcsToInt()
447 TestSingleWcsToInt(fn, L"123", 0, static_cast<T>(123), 3); in TestWcsToInt()
448 TestSingleWcsToInt(fn, L"123#", 10, static_cast<T>(123), 3); in TestWcsToInt()
449 TestSingleWcsToInt(fn, L"01000", 8, static_cast<T>(512), 5); in TestWcsToInt()
450 TestSingleWcsToInt(fn, L"01000", 0, static_cast<T>(512), 5); in TestWcsToInt()
451 TestSingleWcsToInt(fn, L" 123 45", 0, static_cast<T>(123), 6); in TestWcsToInt()
452 TestSingleWcsToInt(fn, L" -123", 0, static_cast<T>(-123), 6); in TestWcsToInt()
453 TestSingleWcsToInt(fn, L"0x10000", 0, static_cast<T>(65536), 7); in TestWcsToInt()
457 void TestWcsToIntLimits(WcsToIntFn<T> fn, const wchar_t* min_str, in TestWcsToIntLimits() argument
460 ASSERT_EQ(std::numeric_limits<T>::min(), fn(min_str, nullptr, 0)) << min_str; in TestWcsToIntLimits()
465 ASSERT_EQ(std::numeric_limits<T>::max(), fn(min_str, nullptr, 0)) << min_str; in TestWcsToIntLimits()
467 ASSERT_EQ(std::numeric_limits<T>::max(), fn(max_str, nullptr, 0)) << max_str; in TestWcsToIntLimits()
801 void TestSingleWcsToFloat(WcsToFloatFn<T> fn, const wchar_t* str, in TestSingleWcsToFloat() argument
804 ASSERT_EQ(expected_value, fn(str, &p)); in TestSingleWcsToFloat()
809 void TestWcsToFloat(WcsToFloatFn<T> fn) { in TestWcsToFloat() argument
810 TestSingleWcsToFloat(fn, L"123", static_cast<T>(123.0L), 3); in TestWcsToFloat()
811 TestSingleWcsToFloat(fn, L"123#", static_cast<T>(123.0L), 3); in TestWcsToFloat()
812 TestSingleWcsToFloat(fn, L" 123 45", static_cast<T>(123.0L), 6); in TestWcsToFloat()
813 TestSingleWcsToFloat(fn, L"9.0", static_cast<T>(9.0L), 3); in TestWcsToFloat()
814 TestSingleWcsToFloat(fn, L"-9.0", static_cast<T>(-9.0L), 4); in TestWcsToFloat()
815 TestSingleWcsToFloat(fn, L" \t\v\f\r\n9.0", static_cast<T>(9.0L), 9); in TestWcsToFloat()
819 void TestWcsToFloatHexFloats(WcsToFloatFn<T> fn) { in TestWcsToFloatHexFloats() argument
820 TestSingleWcsToFloat(fn, L"0.9e1", static_cast<T>(9.0L), 5); in TestWcsToFloatHexFloats()
821 TestSingleWcsToFloat(fn, L"0x1.2p3", static_cast<T>(9.0L), 7); in TestWcsToFloatHexFloats()
822 TestSingleWcsToFloat(fn, L"+1e+100", static_cast<T>(1e100L), 7); in TestWcsToFloatHexFloats()
823 TestSingleWcsToFloat(fn, L"0x10000.80", static_cast<T>(65536.50L), 10); in TestWcsToFloatHexFloats()
827 void TestWcsToFloatInfNan(WcsToFloatFn<T> fn) { in TestWcsToFloatInfNan() argument
828 ASSERT_TRUE(isnan(fn(L"+nan", nullptr))); in TestWcsToFloatInfNan()
829 ASSERT_TRUE(isnan(fn(L"nan", nullptr))); in TestWcsToFloatInfNan()
830 ASSERT_TRUE(isnan(fn(L"-nan", nullptr))); in TestWcsToFloatInfNan()
832 ASSERT_TRUE(isnan(fn(L"+nan(0xff)", nullptr))); in TestWcsToFloatInfNan()
833 ASSERT_TRUE(isnan(fn(L"nan(0xff)", nullptr))); in TestWcsToFloatInfNan()
834 ASSERT_TRUE(isnan(fn(L"-nan(0xff)", nullptr))); in TestWcsToFloatInfNan()
837 ASSERT_TRUE(isnan(fn(L"+nanny", &p))); in TestWcsToFloatInfNan()
839 ASSERT_TRUE(isnan(fn(L"nanny", &p))); in TestWcsToFloatInfNan()
841 ASSERT_TRUE(isnan(fn(L"-nanny", &p))); in TestWcsToFloatInfNan()
844 ASSERT_EQ(0, fn(L"muppet", &p)); in TestWcsToFloatInfNan()
846 ASSERT_EQ(0, fn(L" muppet", &p)); in TestWcsToFloatInfNan()
849 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"+inf", nullptr)); in TestWcsToFloatInfNan()
850 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"inf", nullptr)); in TestWcsToFloatInfNan()
851 ASSERT_EQ(-std::numeric_limits<T>::infinity(), fn(L"-inf", nullptr)); in TestWcsToFloatInfNan()
853 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"+infinity", nullptr)); in TestWcsToFloatInfNan()
854 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"infinity", nullptr)); in TestWcsToFloatInfNan()
855 ASSERT_EQ(-std::numeric_limits<T>::infinity(), fn(L"-infinity", nullptr)); in TestWcsToFloatInfNan()
857 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"+infinitude", &p)); in TestWcsToFloatInfNan()
859 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"infinitude", &p)); in TestWcsToFloatInfNan()
861 ASSERT_EQ(-std::numeric_limits<T>::infinity(), fn(L"-infinitude", &p)); in TestWcsToFloatInfNan()
865 ASSERT_EQ(std::numeric_limits<T>::infinity(), fn(L"InFiNiTy", nullptr)); in TestWcsToFloatInfNan()
866 ASSERT_TRUE(isnan(fn(L"NaN", nullptr))); in TestWcsToFloatInfNan()