From 62c43a13ee843a0bbae862035fd77b1f26816277 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 8 Oct 2024 18:54:41 +0300 Subject: Update GHA runner to macos-14 due to the deprecation of macos-12 (actions/runner-images#10721) --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a287f29b95..fda6545e83 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -47,7 +47,7 @@ jobs: continue-on-error: ${{ matrix.experimental }} strategy: matrix: - runner: [windows-large, macos-12-xl] + runner: [windows-large, macos-14-xlarge] configuration: ${{ fromJSON(needs.setup.outputs.configurations) }} experimental: [false] include: @@ -73,7 +73,7 @@ jobs: # autobuild-package.xml. AUTOBUILD_VCS_INFO: "true" AUTOBUILD_VSVER: "170" - DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode_14.3.1.app/Contents/Developer" # Ensure that Linden viewer builds engage Bugsplat. BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }} build_coverity: false -- cgit v1.2.3 From 1fde269ac6e98ff23fd896cb2fbf8a570cbee398 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 4 Oct 2024 12:53:38 -0400 Subject: Use approximate equality for failing v3dmath test. Modernize lltut.h. Allow both F32 and F64 for ensure_approximately_equals() etc. Use std::string_view instead of const char* for message string to allow passing std::string as well. Use stringize() instead of explicit std::stringstream idiom. --- indra/llmath/tests/v3dmath_test.cpp | 13 ++--------- indra/test/lltut.h | 45 ++++++++++++++----------------------- 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/indra/llmath/tests/v3dmath_test.cpp b/indra/llmath/tests/v3dmath_test.cpp index db08419012..36ad1067a2 100644 --- a/indra/llmath/tests/v3dmath_test.cpp +++ b/indra/llmath/tests/v3dmath_test.cpp @@ -504,14 +504,11 @@ namespace tut template<> template<> void v3dmath_object::test<24>() { -#if LL_WINDOWS && _MSC_VER < 1400 - skip("This fails on VS2003!"); -#else F64 x = 10., y = 20., z = -15.; F64 angle1, angle2; LLVector3d vec3Da(x,y,z), vec3Db(x,y,z); angle1 = angle_between(vec3Da, vec3Db); - ensure("1:angle_between: Fail ", (0 == angle1)); + ensure_approximately_equals_range("1:angle_between: Fail ", angle1, 0., 1.5e-8); F64 x1 = -1., y1 = -20., z1 = -1.; vec3Da.clearVec(); vec3Da.setVec(x1,y1,z1); @@ -520,12 +517,6 @@ namespace tut vec3Da.normVec(); F64 angle = vec3Db*vec3Da; angle = acos(angle); -#if LL_WINDOWS && _MSC_VER > 1900 - skip("This fails on VS2017!"); -#else - ensure("2:angle_between: Fail ", (angle == angle2)); -#endif - -#endif + ensure_equals("2:angle_between: Fail ", angle, angle2); } } diff --git a/indra/test/lltut.h b/indra/test/lltut.h index fbf60444be..3855eae7a2 100644 --- a/indra/test/lltut.h +++ b/indra/test/lltut.h @@ -30,8 +30,10 @@ #define LL_LLTUT_H #include "is_approx_equal_fraction.h" // instead of llmath.h +#include "stringize.h" #include #include +#include #include class LLDate; @@ -89,49 +91,38 @@ namespace tut // The functions BELOW this point actually consume tut.hpp functionality. namespace tut { - inline void ensure_approximately_equals(const char* msg, F64 actual, F64 expected, U32 frac_bits) + template // replace with C++20 floating-point concept + inline void ensure_approximately_equals(std::string_view msg, F actual, F expected, U32 frac_bits) { if(!is_approx_equal_fraction(actual, expected, frac_bits)) { - std::stringstream ss; - ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected; - throw tut::failure(ss.str().c_str()); + throw tut::failure(stringize(msg, (msg.empty()?"":": "), "not equal actual: ", + actual, " expected: ", expected)); } } - inline void ensure_approximately_equals(const char* msg, F32 actual, F32 expected, U32 frac_bits) + template // replace with C++20 floating-point concept + inline void ensure_approximately_equals(F actual, F expected, U32 frac_bits) { - if(!is_approx_equal_fraction(actual, expected, frac_bits)) - { - std::stringstream ss; - ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected; - throw tut::failure(ss.str().c_str()); - } - } - - inline void ensure_approximately_equals(F32 actual, F32 expected, U32 frac_bits) - { - ensure_approximately_equals(NULL, actual, expected, frac_bits); + ensure_approximately_equals("", actual, expected, frac_bits); } - inline void ensure_approximately_equals_range(const char *msg, F32 actual, F32 expected, F32 delta) + template // replace with C++20 floating-point concept + inline void ensure_approximately_equals_range(std::string_view msg, F actual, F expected, F delta) { if (fabs(actual-expected)>delta) { - std::stringstream ss; - ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected << " tolerance: " << delta; - throw tut::failure(ss.str().c_str()); + throw tut::failure(stringize(msg, (msg.empty()?"":": "), "not equal actual: ", + actual, " expected: ", expected, " tolerance: ", delta)); } } - inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) + inline void ensure_memory_matches(std::string_view msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len) { if((expected_len != actual_len) || (std::memcmp(actual, expected, actual_len) != 0)) { - std::stringstream ss; - ss << (msg?msg:"") << (msg?": ":"") << "not equal"; - throw tut::failure(ss.str().c_str()); + throw tut::failure(stringize(msg, (msg.empty()?"":": "), "not equal")); } } @@ -141,13 +132,11 @@ namespace tut } template - void ensure_not_equals(const char* msg,const Q& actual,const T& expected) + void ensure_not_equals(std::string_view msg,const Q& actual,const T& expected) { if( expected == actual ) { - std::stringstream ss; - ss << (msg?msg:"") << (msg?": ":"") << "both equal " << expected; - throw tut::failure(ss.str().c_str()); + throw tut::failure(stringize(msg, (msg.empty()?"":": "), "both equal ", expected)); } } -- cgit v1.2.3 From 700f1319ee4ac7373a1ffd136d8b71af1b588861 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 8 Oct 2024 18:22:01 +0300 Subject: Follow-up test fix --- indra/test/lltut.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/test/lltut.h b/indra/test/lltut.h index 3855eae7a2..986bdd0619 100644 --- a/indra/test/lltut.h +++ b/indra/test/lltut.h @@ -143,7 +143,7 @@ namespace tut template void ensure_not_equals(const Q& actual,const T& expected) { - ensure_not_equals(NULL, actual, expected); + ensure_not_equals("", actual, expected); } } -- cgit v1.2.3