diff options
| author | Martin Kobetic <mkobetic@gmail.com> | 2014-04-14 19:21:15 +0000 |
|---|---|---|
| committer | Steven Normore <snormore@gmail.com> | 2014-04-16 13:27:48 +0000 |
| commit | 4e01c9fd81eec87e54ed79a6b7c04f0d2e39ea50 (patch) | |
| tree | 64956acc1d33682b56f26361f0ddaf857d740e96 /c/cursor_test.go | |
| parent | cleanup (diff) | |
| download | dedo-4e01c9fd81eec87e54ed79a6b7c04f0d2e39ea50.tar.gz dedo-4e01c9fd81eec87e54ed79a6b7c04f0d2e39ea50.tar.xz | |
fix up the C bits to compile
Diffstat (limited to '')
| -rw-r--r-- | c/cursor_test.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/c/cursor_test.go b/c/cursor_test.go index 12710d9..ff6d547 100644 --- a/c/cursor_test.go +++ b/c/cursor_test.go @@ -30,16 +30,11 @@ func TestIterate(t *testing.T) { // Iterate over all items and check consistency. var index = 0 tx, _ = db.Begin(false) - var k, v C.bolt_val c := NewCursor(tx.Bucket("widgets")) - C.bolt_cursor_first(c, &k, &v) - key := C.GoBytes(k.data, k.size) - for key != nil && index < len(items) { + for key, value := c.first(); key != nil && index < len(items); key, value = c.next() { assert.Equal(t, key, items[index].Key) - assert.Equal(t, C.GoBytes(v.data, v.size), items[index].Value) + assert.Equal(t, value, items[index].Value) index++ - C.bolt_cursor_next(c, &k, &v) - key := C.GoBytes(k.data, k.size) } assert.Equal(t, len(items), index) assert.Equal(t, len(items), index) |
