-
Notifications
You must be signed in to change notification settings - Fork 69
/
options_write_test.go
38 lines (28 loc) · 990 Bytes
/
options_write_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package grocksdb
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestWriteOptions(t *testing.T) {
t.Parallel()
wo := NewDefaultWriteOptions()
defer wo.Destroy()
require.EqualValues(t, false, wo.IsSync())
wo.SetSync(true)
require.EqualValues(t, true, wo.IsSync())
require.EqualValues(t, false, wo.IsDisableWAL())
wo.DisableWAL(true)
require.EqualValues(t, true, wo.IsDisableWAL())
require.EqualValues(t, false, wo.IgnoreMissingColumnFamilies())
wo.SetIgnoreMissingColumnFamilies(true)
require.EqualValues(t, true, wo.IgnoreMissingColumnFamilies())
require.EqualValues(t, false, wo.IsNoSlowdown())
wo.SetNoSlowdown(true)
require.EqualValues(t, true, wo.IsNoSlowdown())
require.EqualValues(t, false, wo.IsLowPri())
wo.SetLowPri(true)
require.EqualValues(t, true, wo.IsLowPri())
require.EqualValues(t, false, wo.MemtableInsertHintPerBatch())
wo.SetMemtableInsertHintPerBatch(true)
require.EqualValues(t, true, wo.MemtableInsertHintPerBatch())
}