]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix [complex_]block_vector_vector_assign 15798/head
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 26 Jul 2023 13:18:13 +0000 (09:18 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 26 Jul 2023 13:37:45 +0000 (09:37 -0400)
tests/lac/block_vector_vector_assign.cc
tests/lac/complex_block_vector_vector_assign.cc

index e27174fe8f420f34c91ce2f3908175839c68fe93..532d6a84f35994747aede4142b5497d5218631d0 100644 (file)
 
 #include "../tests.h"
 
-template <typename Vector1, typename Vector2>
-bool
-operator==(const Vector1 &v1, const Vector2 &v2)
+namespace dealii::Testing
 {
-  if (v1.size() != v2.size())
-    return false;
-  for (unsigned int i = 0; i < v1.size(); ++i)
-    if (v1(i) != v2(i))
+  template <typename Vector1, typename Vector2>
+  bool
+  compare_equal(const Vector1 &v1, const Vector2 &v2)
+  {
+    if (v1.size() != v2.size())
       return false;
-  return true;
-}
+    for (unsigned int i = 0; i < v1.size(); ++i)
+      if (v1(i) != v2(i))
+        return false;
+    return true;
+  }
+} // namespace dealii::Testing
 
 
 void
 test()
 {
+  using namespace dealii::Testing;
+
   std::vector<types::global_dof_index> ivector(4);
   ivector[0] = 2;
   ivector[1] = 4;
@@ -54,12 +59,12 @@ test()
     v1(i) = 1 + i * i;
 
   v2 = v1;
-  AssertThrow(v1 == v2, ExcInternalError());
+  AssertThrow(compare_equal(v1, v2), ExcInternalError());
 
   BlockVector<double> v3(ivector);
   v3 = v2;
-  AssertThrow(v3 == v2, ExcInternalError());
-  AssertThrow(v3 == v1, ExcInternalError());
+  AssertThrow(compare_equal(v3, v2), ExcInternalError());
+  AssertThrow(compare_equal(v3, v1), ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index edd49d11dc8806841b1d6261a3b829b45148d27d..9b14b3babed5a81fb053368ef50eefa97cbf51dc 100644 (file)
 
 #include "../tests.h"
 
-template <typename Vector1, typename Vector2>
-bool
-operator==(const Vector1 &v1, const Vector2 &v2)
+namespace dealii::Testing
 {
-  if (v1.size() != v2.size())
-    return false;
-  for (unsigned int i = 0; i < v1.size(); ++i)
-    if (v1(i) != v2(i))
+  template <typename Vector1, typename Vector2>
+  bool
+  compare_equal(const Vector1 &v1, const Vector2 &v2)
+  {
+    if (v1.size() != v2.size())
       return false;
-  return true;
-}
+    for (unsigned int i = 0; i < v1.size(); ++i)
+      if (v1(i) != v2(i))
+        return false;
+    return true;
+  }
+} // namespace dealii::Testing
 
 
 void
 test()
 {
+  using namespace dealii::Testing;
+
   std::vector<types::global_dof_index> ivector(4);
   ivector[0] = 2;
   ivector[1] = 4;
@@ -54,12 +59,12 @@ test()
     v1(i) = 1 + i * i;
 
   v2 = v1;
-  AssertThrow(v1 == v2, ExcInternalError());
+  AssertThrow(compare_equal(v1, v2), ExcInternalError());
 
   BlockVector<std::complex<double>> v3(ivector);
   v3 = v2;
-  AssertThrow(v3 == v2, ExcInternalError());
-  AssertThrow(v3 == v1, ExcInternalError());
+  AssertThrow(compare_equal(v3, v2), ExcInternalError());
+  AssertThrow(compare_equal(v3, v1), ExcInternalError());
 
   deallog << "OK" << std::endl;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.