Skip to content

Commit

Permalink
Merge pull request #477 from JuliaRobotics/tk-more-srand
Browse files Browse the repository at this point in the history
Fix more random seeds.
  • Loading branch information
tkoolen authored Aug 13, 2018
2 parents 5d4fbe4 + 4e20622 commit 5c37856
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/test_contact.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testset "contact" begin
@testset "HalfSpace3D" begin
Random.seed!(1)
Random.seed!(4)
frame = CartesianFrame3D()
point = Point3D(frame, rand(), rand(), rand())
normal = FreeVector3D(frame, 0., 0., 1.)
Expand Down
2 changes: 1 addition & 1 deletion test/test_custom_collections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Base.axes(m::NonOneBasedMatrix) = ((1:m.m) .- 2, (1:m.n) .+ 1)
end

@testset "SegmentedBlockDiagonalMatrix" begin
Random.seed!(1)
Random.seed!(5)
A = rand(10, 10)
block_indices = [(1:1, 1:1), # square
(2:4, 2:2), # non-square
Expand Down
2 changes: 1 addition & 1 deletion test/test_double_pendulum.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@testset "double pendulum" begin
Random.seed!(1)
Random.seed!(6)
lc1 = -0.5
l1 = -1.
m1 = 1.
Expand Down
2 changes: 1 addition & 1 deletion test/test_frames.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@testset "frames" begin
Random.seed!(1)
Random.seed!(7)
f1name = "1"
f1 = CartesianFrame3D(f1name)
f2 = CartesianFrame3D()
Expand Down
18 changes: 9 additions & 9 deletions test/test_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)

@testset "graphs" begin
@testset "disconnected" begin
Random.seed!(1)
Random.seed!(8)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
verts = [Vertex(rand(Int64)) for i = 1 : 10]
for v in verts
Expand All @@ -23,7 +23,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)


@testset "tree graph" begin
Random.seed!(1)
Random.seed!(9)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
root = Vertex(rand(Int64))
add_vertex!(graph, root)
Expand Down Expand Up @@ -51,7 +51,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "remove_vertex!" begin
Random.seed!(1)
Random.seed!(10)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
edge = Edge(rand())
add_edge!(graph, Vertex(rand(Int64)), Vertex(rand(Int64)), edge)
Expand Down Expand Up @@ -83,7 +83,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "remove_edge!" begin
Random.seed!(1)
Random.seed!(11)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
for i = 1 : 100
add_vertex!(graph, Vertex(i))
Expand All @@ -110,7 +110,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "rewire!" begin
Random.seed!(1)
Random.seed!(12)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
for i = 1 : 100
add_vertex!(graph, Vertex(i))
Expand Down Expand Up @@ -145,7 +145,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "replace_edge!" begin
Random.seed!(1)
Random.seed!(13)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
for i = 1 : 100
add_vertex!(graph, Vertex(i))
Expand Down Expand Up @@ -175,7 +175,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "SpanningTree" begin
Random.seed!(1)
Random.seed!(14)
rootdata = 0

# graph1: tree grown incrementally
Expand Down Expand Up @@ -327,7 +327,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "reindex!" begin
Random.seed!(1)
Random.seed!(15)
graph = DirectedGraph{Vertex{Int64}, Edge{Float64}}()
for i = 1 : 100
add_vertex!(graph, Vertex(i))
Expand All @@ -345,7 +345,7 @@ Graphs.flip_direction(edge::Edge{Int32}) = Edge(-edge.data)
end

@testset "map-like constructor" begin
Random.seed!(1)
Random.seed!(16)
graph = DirectedGraph{Vertex{Int32}, Edge{Float32}}()
for i = Int32(1) : Int32(100)
add_vertex!(graph, Vertex(i))
Expand Down

0 comments on commit 5c37856

Please sign in to comment.