Lines Matching refs:errc

171             assert(result.ec == errc::value_too_large);  in test_common_to_chars()
177 assert(result.ec == errc{}); in test_common_to_chars()
201 assert(from_res.ec == errc{}); in test_integer_to_chars()
408 const errc correct_ec, const optional<T> opt_correct = nullopt, in test_from_chars()
424 … if (correct_ec == errc{} || (is_floating_point_v<T> && correct_ec == errc::result_out_of_range)) { in test_from_chars()
445 constexpr errc inv_arg = errc::invalid_argument;
446 constexpr errc out_ran = errc::result_out_of_range;
486 test_from_chars<T>(string(100, '0'), base, 100, errc{}, static_cast<T>(0)); in test_integer_from_chars()
487 test_from_chars<T>(string(100, '0') + "11"s, base, 102, errc{}, static_cast<T>(base + 1)); in test_integer_from_chars()
491 test_from_chars<T>("-0", base, 2, errc{}, static_cast<T>(0)); in test_integer_from_chars()
492 test_from_chars<T>("-"s + string(100, '0'), base, 101, errc{}, static_cast<T>(0)); in test_integer_from_chars()
493 … test_from_chars<T>("-"s + string(100, '0') + "11"s, base, 103, errc{}, static_cast<T>(-base - 1)); in test_integer_from_chars()
498 test_from_chars<T>("11", base, 2, errc{}, static_cast<T>(base + 1)); in test_integer_from_chars()
499 test_from_chars<T>("11@@@", base, 2, errc{}, static_cast<T>(base + 1)); in test_integer_from_chars()
515 … test_from_chars<T>(string(1, static_cast<char>('A' + i)), 36, 1, errc{}, static_cast<T>(10 + i)); in test_integer_from_chars()
516 … test_from_chars<T>(string(1, static_cast<char>('a' + i)), 36, 1, errc{}, static_cast<T>(10 + i)); in test_integer_from_chars()
520 test_from_chars<T>("0x1729", 16, 1, errc{}, static_cast<T>(0)); // reads '0', stops at 'x' in test_integer_from_chars()
521 test_from_chars<T>("0X1729", 16, 1, errc{}, static_cast<T>(0)); // reads '0', stops at 'X' in test_integer_from_chars()
524 test_from_chars<T>("-0x1729", 16, 2, errc{}, static_cast<T>(0)); // reads "-0", stops at 'x' in test_integer_from_chars()
525 test_from_chars<T>("-0X1729", 16, 2, errc{}, static_cast<T>(0)); // reads "-0", stops at 'X' in test_integer_from_chars()
549 test_from_chars<unsigned int>("4294967289", 10, 10, errc{}, 4294967289U); // not risky in all_integer_tests()
550 … test_from_chars<unsigned int>("4294967294", 10, 10, errc{}, 4294967294U); // risky with good digit in all_integer_tests()
551 … test_from_chars<unsigned int>("4294967295", 10, 10, errc{}, 4294967295U); // risky with max digit in all_integer_tests()
555 test_from_chars<int>("2147483639", 10, 10, errc{}, 2147483639); // not risky in all_integer_tests()
556 test_from_chars<int>("2147483646", 10, 10, errc{}, 2147483646); // risky with good digit in all_integer_tests()
557 test_from_chars<int>("2147483647", 10, 10, errc{}, 2147483647); // risky with max digit in all_integer_tests()
561 test_from_chars<int>("-2147483639", 10, 11, errc{}, -2147483639); // not risky in all_integer_tests()
562 test_from_chars<int>("-2147483647", 10, 11, errc{}, -2147483647); // risky with good digit in all_integer_tests()
563 test_from_chars<int>("-2147483648", 10, 11, errc{}, -2147483647 - 1); // risky with max digit in all_integer_tests()
638 assert_message_bits(to_result.ec == errc{}, "to_result.ec", bits); in test_floating_prefix()
646 assert_message_bits(from_result.ec == errc{}, "from_result.ec", bits); in test_floating_prefix()
654 assert_message_bits(fixed_result.ec == errc{}, "fixed_result.ec", bits); in test_floating_prefix()
691 assert_message_bits(to_result.ec == errc{}, "(hex) to_result.ec", bits); in test_floating_hex_prefix()
699 assert_message_bits(from_result.ec == errc{}, "(hex) from_result.ec", bits); in test_floating_hex_prefix()
738 assert_message_bits(result.ec == errc{}, "to_chars fixed precision", bits); in test_floating_precision_prefix()
749 assert_message_bits(result.ec == errc{}, "to_chars scientific precision", bits); in test_floating_precision_prefix()
760 assert_message_bits(result.ec == errc{}, "to_chars general precision", bits); in test_floating_precision_prefix()
844 test_from_chars<T>("InF", fmt, 3, errc{}, inf);
845 test_from_chars<T>("infinite", fmt, 3, errc{}, inf);
846 test_from_chars<T>("iNfInItY", fmt, 8, errc{}, inf);
847 test_from_chars<T>("InfinityMeow", fmt, 8, errc{}, inf);
849 test_from_chars<T>("-InF", fmt, 4, errc{}, -inf);
850 test_from_chars<T>("-infinite", fmt, 4, errc{}, -inf);
851 test_from_chars<T>("-iNfInItY", fmt, 9, errc{}, -inf);
852 test_from_chars<T>("-InfinityMeow", fmt, 9, errc{}, -inf);
854 test_from_chars<T>("NaN", fmt, 3, errc{}, qnan);
855 test_from_chars<T>("nanotech", fmt, 3, errc{}, qnan);
856 test_from_chars<T>("nan(", fmt, 3, errc{}, qnan);
857 test_from_chars<T>("nan(@)", fmt, 3, errc{}, qnan);
858 test_from_chars<T>("nan(()", fmt, 3, errc{}, qnan);
859 test_from_chars<T>("nan(abc", fmt, 3, errc{}, qnan);
860 test_from_chars<T>("nan()", fmt, 5, errc{}, qnan);
861 test_from_chars<T>("nan(abc)def", fmt, 8, errc{}, qnan);
862 test_from_chars<T>("nan(_09AZaz)", fmt, 12, errc{}, qnan);
863 test_from_chars<T>("nan(int)", fmt, 8, errc{}, qnan);
864 test_from_chars<T>("nan(snap)", fmt, 9, errc{}, qnan);
866 test_from_chars<T>("-NaN", fmt, 4, errc{}, -qnan);
867 test_from_chars<T>("-nanotech", fmt, 4, errc{}, -qnan);
868 test_from_chars<T>("-nan(", fmt, 4, errc{}, -qnan);
869 test_from_chars<T>("-nan(@)", fmt, 4, errc{}, -qnan);
870 test_from_chars<T>("-nan(()", fmt, 4, errc{}, -qnan);
871 test_from_chars<T>("-nan(abc", fmt, 4, errc{}, -qnan);
872 test_from_chars<T>("-nan()", fmt, 6, errc{}, -qnan);
873 test_from_chars<T>("-nan(abc)def", fmt, 9, errc{}, -qnan);
874 test_from_chars<T>("-nan(_09AZaz)", fmt, 13, errc{}, -qnan);
875 test_from_chars<T>("-nan(int)", fmt, 9, errc{}, -qnan);
876 test_from_chars<T>("-nan(snap)", fmt, 10, errc{}, -qnan);
880 test_from_chars<T>("nan(InD)", fmt, 8, errc{}, -qnan);
881 test_from_chars<T>("-nan(InD)", fmt, 9, errc{}, -qnan);
883 test_from_chars<T>("nan(SnAn)", fmt, 9, errc{}, nullopt, TestFromCharsMode::SignalingNaN);
884 test_from_chars<T>("-nan(SnAn)", fmt, 10, errc{}, nullopt, TestFromCharsMode::SignalingNaN);
888 test_from_chars<T>("1729", fmt, 4, errc{}, T{1729});
889 test_from_chars<T>("1729e3", fmt, 6, errc{}, T{1729000});
890 test_from_chars<T>("10", fmt, 2, errc{}, T{10});
891 test_from_chars<T>("11.", fmt, 3, errc{}, T{11});
892 … test_from_chars<T>("12.13", fmt, 5, errc{}, static_cast<T>(12.13)); // avoid truncation warning
893 test_from_chars<T>(".14", fmt, 3, errc{}, static_cast<T>(.14)); // avoid truncation warning
894 test_from_chars<T>("20e5", fmt, 4, errc{}, T{2000000});
895 test_from_chars<T>("21.e5", fmt, 5, errc{}, T{2100000});
896 test_from_chars<T>("22.23e5", fmt, 7, errc{}, T{2223000});
897 test_from_chars<T>(".24e5", fmt, 5, errc{}, T{24000});
898 test_from_chars<T>("33e+5", fmt, 5, errc{}, T{3300000});
899 … test_from_chars<T>("33e-5", fmt, 5, errc{}, static_cast<T>(.00033)); // avoid truncation warning
900 test_from_chars<T>("4E7", fmt, 3, errc{}, T{40000000});
901 test_from_chars<T>("-00123abc", fmt, 6, errc{}, T{-123});
902 … test_from_chars<T>(".0045000", fmt, 8, errc{}, static_cast<T>(.0045)); // avoid truncation warning
903 test_from_chars<T>("000", fmt, 3, errc{}, T{0});
904 test_from_chars<T>("0e9999", fmt, 6, errc{}, T{0});
905 test_from_chars<T>("0e-9999", fmt, 7, errc{}, T{0});
906 test_from_chars<T>("-000", fmt, 4, errc{}, T{-0.0});
907 test_from_chars<T>("-0e9999", fmt, 7, errc{}, T{-0.0});
908 test_from_chars<T>("-0e-9999", fmt, 8, errc{}, T{-0.0});
909 test_from_chars<T>("1e9999", fmt, 6, errc::result_out_of_range, inf);
910 test_from_chars<T>("-1e9999", fmt, 7, errc::result_out_of_range, -inf);
911 test_from_chars<T>("1e-9999", fmt, 7, errc::result_out_of_range, T{0});
912 test_from_chars<T>("-1e-9999", fmt, 8, errc::result_out_of_range, T{-0.0});
913 test_from_chars<T>("1" + string(6000, '0'), fmt, 6001, errc::result_out_of_range, inf);
914 test_from_chars<T>("-1" + string(6000, '0'), fmt, 6002, errc::result_out_of_range, -inf);
915 … test_from_chars<T>("." + string(6000, '0') + "1", fmt, 6002, errc::result_out_of_range, T{0});
916 … test_from_chars<T>("-." + string(6000, '0') + "1", fmt, 6003, errc::result_out_of_range, T{-0.0});
917 test_from_chars<T>("1" + string(500, '0'), fmt, 501, errc::result_out_of_range, inf);
918 test_from_chars<T>("-1" + string(500, '0'), fmt, 502, errc::result_out_of_range, -inf);
919 test_from_chars<T>("." + string(500, '0') + "1", fmt, 502, errc::result_out_of_range, T{0});
920 … test_from_chars<T>("-." + string(500, '0') + "1", fmt, 503, errc::result_out_of_range, T{-0.0});
924 test_from_chars<T>("1729e3", fmt, 6, errc{}, T{1729000});
927 test_from_chars<T>("1729", fmt, 4, errc{}, T{1729});
928 test_from_chars<T>("1729e3", fmt, 4, errc{}, T{1729});
931 test_from_chars<T>("0x123", fmt, 1, errc{}, T{0});
932 test_from_chars<T>("a0", fmt, 2, errc{}, T{160});
933 test_from_chars<T>("a1.", fmt, 3, errc{}, T{161});
934 test_from_chars<T>("a2.a3", fmt, 5, errc{}, T{162.63671875});
935 test_from_chars<T>(".a4", fmt, 3, errc{}, T{0.640625});
936 test_from_chars<T>("a0p5", fmt, 4, errc{}, T{5120});
937 test_from_chars<T>("a1.p5", fmt, 5, errc{}, T{5152});
938 test_from_chars<T>("a2.a3p5", fmt, 7, errc{}, T{5204.375});
939 test_from_chars<T>(".a4p5", fmt, 5, errc{}, T{20.5});
940 test_from_chars<T>("a0p+5", fmt, 5, errc{}, T{5120});
941 test_from_chars<T>("a0p-5", fmt, 5, errc{}, T{5});
942 test_from_chars<T>("ABCDEFP3", fmt, 8, errc{}, T{90075000});
943 test_from_chars<T>("-00cdrom", fmt, 5, errc{}, T{-205});
944 test_from_chars<T>(".00ef000", fmt, 8, errc{}, T{0.0036468505859375});
945 test_from_chars<T>("000", fmt, 3, errc{}, T{0});
946 test_from_chars<T>("0p9999", fmt, 6, errc{}, T{0});
947 test_from_chars<T>("0p-9999", fmt, 7, errc{}, T{0});
948 test_from_chars<T>("-000", fmt, 4, errc{}, T{-0.0});
949 test_from_chars<T>("-0p9999", fmt, 7, errc{}, T{-0.0});
950 test_from_chars<T>("-0p-9999", fmt, 8, errc{}, T{-0.0});
951 test_from_chars<T>("1p9999", fmt, 6, errc::result_out_of_range, inf);
952 test_from_chars<T>("-1p9999", fmt, 7, errc::result_out_of_range, -inf);
953 test_from_chars<T>("1p-9999", fmt, 7, errc::result_out_of_range, T{0});
954 test_from_chars<T>("-1p-9999", fmt, 8, errc::result_out_of_range, T{-0.0});
955 test_from_chars<T>("1" + string(2000, '0'), fmt, 2001, errc::result_out_of_range, inf);
956 test_from_chars<T>("-1" + string(2000, '0'), fmt, 2002, errc::result_out_of_range, -inf);
957 … test_from_chars<T>("." + string(2000, '0') + "1", fmt, 2002, errc::result_out_of_range, T{0});
958 … test_from_chars<T>("-." + string(2000, '0') + "1", fmt, 2003, errc::result_out_of_range, T{-0.0});
959 test_from_chars<T>("1" + string(300, '0'), fmt, 301, errc::result_out_of_range, inf);
960 test_from_chars<T>("-1" + string(300, '0'), fmt, 302, errc::result_out_of_range, -inf);
961 test_from_chars<T>("." + string(300, '0') + "1", fmt, 302, errc::result_out_of_range, T{0});
962 … test_from_chars<T>("-." + string(300, '0') + "1", fmt, 303, errc::result_out_of_range, T{-0.0});
1005 test_from_chars<float>(lwg_2403, chars_format::general, 56, errc{}, correct_float); in all_floating_tests()
1006 test_from_chars<double>(lwg_2403, chars_format::general, 56, errc{}, correct_double); in all_floating_tests()
1012 …test_from_chars<float>(p.first, chars_format::general, strlen(p.first), errc{}, _Bit_cast<float>(p… in all_floating_tests()
1016 …test_from_chars<double>(p.first, chars_format::general, strlen(p.first), errc{}, _Bit_cast<double>… in all_floating_tests()