Skip to content

Commit 1f2764f

Browse files
committed
update tests to reflect internal code changes
1 parent 2eb1483 commit 1f2764f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/runtests.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ using TestImages
55
using ImageCore
66
using FileIO
77
using LightGraphs
8+
using StatsBase: fit, Histogram
89

910
ENV["DATADEPS_ALWAYS_ACCEPT"] = true
1011
ENV["GKSwstype"] = "100"
@@ -70,20 +71,19 @@ end
7071
centers = collect(edges[1:end-1] .+0.05)
7172
histvals = [exp(-((c-x0)/s0)^2) for c=centers]
7273
data_tuple = (edges, histvals)
73-
74-
ss = TensorBoardLogger.histogram_summary("test", edges, histvals)
74+
hist = fit(Histogram, histvals, edges)
75+
ss = TensorBoardLogger.histogram_summary("test", hist)
7576
@test isa(ss, TensorBoardLogger.Summary_Value)
7677
@test ss.tag == "test"
7778
@test isa(ss.value.value, TensorBoardLogger.HistogramProto)
7879
@test ss.value.value.min == minimum(edges)
7980
@test ss.value.value.max == maximum(edges)
8081
@test all(ss.value.value.bucket_limit .== edges[2:end])
81-
@test all(ss.value.value.bucket .== histvals)
82+
@test ss.value.value.bucket == hist.weights
8283

8384
log_histogram(logger, "hist/cust", data_tuple, step=step)
8485
log_histogram(logger, "hist/cust", rand(100), step=step)
8586
log_histogram(logger, "hist/cust", rand(10,10), step=step)
86-
log_vector(logger, "hist/cust", rand(10), step=step)
8787

8888
close.(values(logger.all_files))
8989
end
@@ -93,7 +93,7 @@ end
9393
vals = rand(10)
9494
@test data == preprocess("test1", vals, data)
9595
@test first(data[1]) == "test1"
96-
@test last(data[1]) == vals
96+
@test last(data[1]) == fit(Histogram, collect(vec(vals)))
9797

9898
vals = rand(ComplexF32, 10)
9999
preprocess("test2", vals, data)
@@ -104,7 +104,7 @@ end
104104

105105
vals = rand(10, 10)
106106
preprocess("test2", vals, data)
107-
@test last(data[4]) == vals
107+
@test last(data[4]) == fit(Histogram, collect(vec(vals)))
108108

109109
end
110110

0 commit comments

Comments
 (0)