diff test/testSbpOperators.jl @ 703:988e9cfcd58d feature/laplace_opset

Add function for == comparison of the fields for a struct, and apply to Laplace tests
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 15 Feb 2021 17:20:03 +0100
parents 3cd582257072
children bf1387f867b8
line wrap: on
line diff
--- a/test/testSbpOperators.jl	Mon Feb 15 11:30:34 2021 +0100
+++ b/test/testSbpOperators.jl	Mon Feb 15 17:20:03 2021 +0100
@@ -358,17 +358,8 @@
             H_r = inner_product(boundary_grid(g_1D,id_r),op.quadratureClosure)
             Hb_dict = Dict(Pair(id_l,H_l),Pair(id_r,H_r))
 
-            # TODO: Not sure why this doesnt work? Comparing the fields of
-            # Laplace seems to work. Reformulate below once solved.
-            @test_broken Laplace(Δ,H,Hi,e_dict,d_dict,Hb_dict) == Laplace(g_1D, sbp_operators_path()*"standard_diagonal.toml"; order=4)
             L = Laplace(g_1D, sbp_operators_path()*"standard_diagonal.toml"; order=4)
-            @test L.D == Δ
-            @test L.H == H
-            @test L.H_inv == Hi
-            @test L.e == e_dict
-            @test L.d == d_dict
-            @test L.H_boundary == Hb_dict
-
+            @test cmp_fields(L,Laplace(Δ,H,Hi,e_dict,d_dict,Hb_dict))
             @test L isa TensorMapping{T,1,1}  where T
             @inferred Laplace(Δ,H,Hi,e_dict,d_dict,Hb_dict)
         end
@@ -410,16 +401,8 @@
                           Pair(id_s,H_s),Pair(id_n,H_n),
                           Pair(id_b,H_b),Pair(id_t,H_t))
 
-            # TODO: Not sure why this doesnt work? Comparing the fields of
-            # Laplace seems to work. Reformulate below once solved.
-            @test_broken Laplace(Δ,H,Hi,e_dict,d_dict,Hb_dict) == Laplace(g_3D, sbp_operators_path()*"standard_diagonal.toml"; order=4)
             L = Laplace(g_3D, sbp_operators_path()*"standard_diagonal.toml"; order=4)
-            @test L.D == Δ
-            @test L.H == H
-            @test L.H_inv == Hi
-            @test L.e == e_dict
-            @test L.d == d_dict
-            @test L.H_boundary == Hb_dict
+            @test cmp_fields(L,Laplace(Δ,H,Hi,e_dict,d_dict,Hb_dict))
             @test L isa TensorMapping{T,3,3} where T
             @inferred Laplace(Δ,H,Hi,e_dict,d_dict,Hb_dict)
         end