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

Function TestRocksDbStore_StoreLog

lib/datastore/rocksdb_test.go:120–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

testRocksDbDatastoreFunction · 0.85
createRaftLogFunction · 0.85
StoreLogMethod · 0.45
GetLogMethod · 0.45

Tested by

no test coverage detected