diff --git a/tests/testFloatingPointPrecision.cpp b/tests/testFloatingPointPrecision.cpp index 077f987..68ef4d3 100644 --- a/tests/testFloatingPointPrecision.cpp +++ b/tests/testFloatingPointPrecision.cpp @@ -69,36 +69,42 @@ int main() "8.589973e+9", 8.589973e9L, "8589973000"); std::string expected_float_1d123456789[] = { "1.1234568", -#if MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_CLANG +#if MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_CLANG \ + || MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_CLANG "1.12345684", // macOS //#elif MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_GNU -//#elif MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_CLANG #else // default MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_GNU "1.1234568", #endif "1.1234568" }; checkRoundTripConversion_txt2Val2txt("testFloatingPointPrecision-4", "1.123456789", 1.123456789f, expected_float_1d123456789[indexOS]); // 6 digits - std::string expected_double_1d1234567890123456789[] = { "1.1234567890123457", - "1.12345678901234569", // macOS - "1.1234567890123457" }; + std::string expected_double_2d1234567890123456789[] = { "2.1234567890123457", +#if MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_CLANG +//#elif MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_GNU +//#elif MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_CLANG + "2.12345678901234569", // macOS +#else // default MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_GNU + "2.1234567890123457", +#endif + "2.1234567890123457" }; checkRoundTripConversion_txt2Val2txt("testFloatingPointPrecision-5", - "1.1234567890123456789", 1.1234567890123456789, - expected_double_1d1234567890123456789[indexOS]); // 15 digits - std::string expected_longDouble_1d123456789012345678901[] = { "1.1234567890123456789", + "2.1234567890123456789", 2.1234567890123456789, + expected_double_2d1234567890123456789[indexOS]); // 15 digits + std::string expected_longDouble_3d123456789012345678901[] = { "3.1234567890123456789", #if MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_CLANG - "1.12345678901234569", + "3.12345678901234569", #elif MACH_MACOS_ARRAY_IDX == MACH_POST_MACOS14_ARM_GNU - "1.1234567890123457", + "3.1234567890123457", #elif MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_CLANG - "1.12345678901234567889", + "3.12345678901234567889", #else // default MACH_MACOS_ARRAY_IDX == MACH_PRE_MACOS14_GNU - "1.1234567890123456789", + "3.1234567890123456789", #endif - "1.1234567890123457" }; // Windows + "3.1234567890123457" }; // Windows checkRoundTripConversion_txt2Val2txt("testFloatingPointPrecision-6", - "1.123456789012345678901", 1.123456789012345678901L, - expected_longDouble_1d123456789012345678901[indexOS]); //18 digits + "3.123456789012345678901", 3.123456789012345678901L, + expected_longDouble_3d123456789012345678901[indexOS]); //18 digits checkRoundTripConversion_txt2Val2txt("testFloatingPointPrecision-7",