MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestBoltDbStore_StoreLog

Function TestBoltDbStore_StoreLog

lib/datastore/boltdb_test.go:119–140  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

117
118}
119func TestBoltDbStore_StoreLog(t *testing.T) {
120 r, err := testBoltDatastore()
121 assert.NoError(t, err)
122
123 l1 := createRaftLog(23, "test4")
124 err = r.StoreLog(l1)
125 assert.NoError(t, err)
126 // get the logs
127 var log1, log2, log3, log5 raft.Log
128 _ = r.GetLog(1, &log1)
129 _ = r.GetLog(23, &log3)
130 assert.NoError(t, err)
131
132 assert.Equal(t, log1, raft.Log{})
133 assert.Equal(t, log2, raft.Log{})
134 assert.Equal(t, log3, *l1)
135
136 // check for errors
137 err = r.GetLog(4, &log5)
138 assert.True(t, err != nil)
139
140}
141func TestBoltDbStore_StoreLogs(t *testing.T) {
142 r, err := testBoltDatastore()
143 assert.NoError(t, err)

Callers

nothing calls this directly

Calls 4

testBoltDatastoreFunction · 0.85
createRaftLogFunction · 0.85
StoreLogMethod · 0.45
GetLogMethod · 0.45

Tested by

no test coverage detected