]> OCCT Git - occt.git/commitdiff
Testing - GCC bug workaround for test NCollection_LocalArrayTest, CustomType #549
authorDmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com>
Mon, 19 May 2025 18:32:46 +0000 (19:32 +0100)
committerGitHub <noreply@github.com>
Mon, 19 May 2025 18:32:46 +0000 (19:32 +0100)
Test was failing on Ubuntu, gcc 13.3.0, debug, due to incorrect linkage.
Fixed by renaming TestStruct to NCollection_LocalArray_TestStruct.

src/FoundationClasses/TKernel/GTests/NCollection_LocalArray_Test.cxx

index c5de4b019707e1c7e3996a7df36c7cb51dd1d85a..fe3f8255a0148b1efe2ebd982d37f16d90cd0f92 100644 (file)
@@ -124,20 +124,23 @@ TEST(NCollection_LocalArrayTest, CustomMaxArraySize)
 }
 
 // Test with custom type
-struct TestStruct
+struct NCollection_LocalArray_TestStruct
 {
   int    a;
   double b;
 
-  bool operator==(const TestStruct& other) const { return a == other.a && b == other.b; }
+  bool operator==(const NCollection_LocalArray_TestStruct& other) const
+  {
+    return a == other.a && b == other.b;
+  }
 };
 
 TEST(NCollection_LocalArrayTest, CustomType)
 {
-  NCollection_LocalArray<TestStruct> array(5);
+  NCollection_LocalArray<NCollection_LocalArray_TestStruct> array(5);
   EXPECT_EQ(5, array.Size());
 
-  TestStruct ts{10, 3.14};
+  NCollection_LocalArray_TestStruct ts{10, 3.14};
 
   // Set and retrieve values
   array[0] = ts;