Skip to content

Commit

Permalink
#58 - interface unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Dec 15, 2017
1 parent 8f96e26 commit 23e5f5a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 12 deletions.
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env julia
using LazySets, Base.Test

# =======================================
# Testing common API of all LazySet types
# =======================================
@time @testset "LazySets.LazySet" begin include("unit_LazySet.jl") end
# ====================================
# Testing common API of all interfaces
# ====================================
@time @testset "LazySets.interfaces" begin include("unit_interfaces.jl") end

# =======================================
# Testing types that inherit from LazySet
Expand Down
8 changes: 0 additions & 8 deletions test/unit_LazySet.jl

This file was deleted.

46 changes: 46 additions & 0 deletions test/unit_interfaces.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# check that all interace functions are provided

# --- LazySet ---

# support vector
@test check_method_implementation(LazySet, σ,
Function[S -> (AbstractVector{Float64}, S)])
# dimension
@test check_method_implementation(LazySet, dim, Function[S -> (S,)])

# --- Polytopic ---

# vertices list
@test check_method_implementation(Polytopic, vertices_list,
Function[S -> (S{Float64},)])
@test check_method_implementation(PointSymmetric_Polytopic, vertices_list,
Function[S -> (S{Float64},)])

# --- PointSymmetric ---

# center
@test check_method_implementation(PointSymmetric, center,
Function[S -> (S{Float64},)])
@test check_method_implementation(PointSymmetric_Polytopic, center,
Function[S -> (S{Float64},)])

# --- Box ---

# radius_b (2x)
@test check_method_implementation(Box, radius_b,
Function[S -> (S{Float64},)])
@test check_method_implementation(Box, radius_b,
Function[S -> (S{Float64}, Int)])

# --- Polygonal ---

# tohrep
@test check_method_implementation(Polygonal, tohrep,
Function[S -> (S{Float64},)])
# tovrep
@test check_method_implementation(Polygonal, tovrep,
Function[S -> (S{Float64},)])

# --- HPolygonal ---

# no functions yet

0 comments on commit 23e5f5a

Please sign in to comment.