Skip to content

Commit

Permalink
coverage up to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojukka5 committed Jan 10, 2018
1 parent 0cc2084 commit 9548640
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/test_fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ end
@test interpolate(a, 0.0) == (1, 2)
update!(a, (2,3))
@test a == (2,3)
@test (2,3) == a

# vector field
b = DVTI(([1,2], [2,3]))
Expand Down
17 changes: 17 additions & 0 deletions test/test_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ function P2()
return P2(:incremental)
end

type P3 <: FieldProblem
end

get_unknown_field_name(p::P1) = "P1"
get_formulation_type(p::Problem{P2}) = p.properties.formulation

@testset "test get_unknown_field_name" begin
p = Problem(P3, "P3", 1)
@test get_unknown_field_name(p) == "N/A"
end

@testset "test creating new problems" begin
p1 = Problem(P1, "P1", 1)
p2 = Problem(P2, "P2", 2, "p")
Expand Down Expand Up @@ -241,3 +249,12 @@ end
@test isapprox(C, C_expected)
@test isapprox(g, g_expected)
end

@testset "test deprecated assembly procedure" begin
problem = Problem(P3, "P3", 1)
elements = [Element(Seg2, [1, 2])]
add_elements!(problem, elements)
assemble!(problem.assembly, problem, first(elements), 0.0)
assemble!(problem.assembly, problem, problem.elements, 0.0)
assemble_elements!(problem, problem.assembly, elements, 0.0)
end

0 comments on commit 9548640

Please sign in to comment.