diff options
author | Markus Grüneis <gimpf@gimpf.org> | 2014-10-24 15:17:33 +0200 |
---|---|---|
committer | Markus Grüneis <gimpf@gimpf.org> | 2014-10-24 15:17:33 +0200 |
commit | 2682883d632aa06279eb408c4b668f6d5fa00017 (patch) | |
tree | 22bbb7738257dbb989ed1fa9c664e3ac34e85c51 /src/hub/src/spreadspace.org/sfive/s5store_test.go | |
parent | hub: Show usage when having arg -help (diff) |
hub: Fix query for GetUpdatesAfter(id)
Diffstat (limited to 'src/hub/src/spreadspace.org/sfive/s5store_test.go')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive/s5store_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5store_test.go b/src/hub/src/spreadspace.org/sfive/s5store_test.go index ed49175..49ca35e 100644 --- a/src/hub/src/spreadspace.org/sfive/s5store_test.go +++ b/src/hub/src/spreadspace.org/sfive/s5store_test.go @@ -65,3 +65,27 @@ func TestCount(t *testing.T) { t.Errorf("Failed to count correctly.") } } + +func TestGetUpdatesAfter(t *testing.T) { + store, err := NewStore("file:memdb1?mode=memory&cache=shared") + if err != nil { + t.Errorf("Failed to initialize: %v", err) + return + } + defer store.Close() + + startTime := time.Date(2014, time.August, 24, 14, 35, 33, 847282000, time.UTC) + update := DataUpdate{Data: SourceData{BytesSent: 1, ClientCount: 3, BytesReceived: 1}, StartTime: startTime, Duration: 5 * time.Millisecond} + streamId := StreamId{ContentId: "content", Format: "7bitascii", Quality: QualityHigh} + source := SourceId{Hostname: "localhost", Tags: []string{"tag1", "master"}, StreamId: streamId, Version: 1} + dat := StatisticsData{nil, nil, source, update} + + err = store.Append(dat) + if err != nil { + t.Errorf("Failed to append: %v", err) + return + } + + res, err := store.GetUpdatesAfter(2) + t.Logf("got updates (err %v):\n%#v", err, res) +} |