Skip to content

Commit b95544a

Browse files
committed
fix data or blob tests
1 parent 8b6c5e3 commit b95544a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/testBlocks.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Dates
44
using Manifolds
55

66
import Base: convert
7-
import DistributedFactorGraphs: reconstFactorData
7+
import DistributedFactorGraphs: reconstFactorData, getData, addData!, updateData!, deleteData!
88

99
# Test InferenceVariable Types
1010
# struct TestVariableType1 <: InferenceVariable
@@ -987,6 +987,7 @@ function blobsStoresTestBlock!(fg)
987987

988988
#add
989989
var1 = getVariable(fg, :a)
990+
var2 = getVariable(fg, :b)
990991
@test addBlobEntry!(var1, de1) == de1
991992
updateVariable!(fg, var1)
992993
@test addBlobEntry!(fg, :a, de2) == de2
@@ -996,7 +997,7 @@ function blobsStoresTestBlock!(fg)
996997
#get
997998
@test deepcopy(de1) == getBlobEntry(var1, :label1)
998999
@test deepcopy(de2) == getBlobEntry(fg, :a, :label2)
999-
@test_throws ErrorException getBlobEntry(v2, :label1)
1000+
@test_throws ErrorException getBlobEntry(var2, :label1)
10001001
@test_throws ErrorException getBlobEntry(fg, :b, :label1)
10011002

10021003
#update
@@ -1043,19 +1044,19 @@ function blobsStoresTestBlock!(fg)
10431044
# Data functions
10441045
testData = rand(UInt8, 50)
10451046
# Adding
1046-
newData = addBlob!(fg, fs.key, :a, :testing, testData)
1047+
newData = addData!(fg, fs.key, :a, :testing, testData) # convenience wrapper over addBlob!
10471048
# Listing
10481049
@test :testing in listBlobEntries(fg, :a)
10491050
# Getting
1050-
data = getBlob(fg, fs, :a, :testing)
1051+
data = getData(fg, fs, :a, :testing) # convenience wrapper over getBlob
10511052
@test data[1].hash == newData[1].hash
10521053
@test data[2] == newData[2]
10531054
# Updating
1054-
updateData = updateBlob!(fg, fs, :a, newData[1], rand(UInt8, 50))
1055+
updateData = updateData!(fg, fs, :a, newData[1], rand(UInt8, 50)) # convenience wrapper around updateBlob!
10551056
@test updateData[1].hash != data[1].hash
10561057
@test updateData[2] != data[2]
10571058
# Deleting
1058-
retData = deleteBlob!(fg, :a, :testing)
1059+
retData = deleteData!(fg, :a, :testing) # convenience wrapper around deleteBlob!
10591060

10601061
end
10611062

0 commit comments

Comments
 (0)