diff options
Diffstat (limited to 'src/hub/src/spreadspace.org/sfive/s5store_test.go')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive/s5store_test.go | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5store_test.go b/src/hub/src/spreadspace.org/sfive/s5store_test.go index 14be34d..022d662 100644 --- a/src/hub/src/spreadspace.org/sfive/s5store_test.go +++ b/src/hub/src/spreadspace.org/sfive/s5store_test.go @@ -35,21 +35,26 @@ func TestAppend(t *testing.T) { t.Errorf("Failed to append: %v", err) } - clientCnt := store.CountClients(nil) - if 3 != clientCnt { - t.Errorf("Failed fo append, invalid number of clients, 3 != %v", clientCnt) + stats, err := store.GetStats(nil) + clientCount := int(*stats.ClientCount) + updateCount := *stats.UpdateCount + if 3 != clientCount { + t.Errorf("Failed fo append, invalid number of clients, 3 != %v", clientCount) } - - updateCnt, err := store.CountUpdateEntries(nil) - if 1 != updateCnt { - t.Errorf("Failed to append, invalid number of updates, 1 != %v", updateCnt) + if 1 != updateCount { + t.Errorf("Failed to append, invalid number of updates, 1 != %v", updateCount) } queryStartTime := time.Date(2015, time.December, 24, 1, 1, 1, 0, time.UTC) filterStruct := StatsFilter{start: &queryStartTime} - updateCnt, err = store.CountUpdateEntries(&filterStruct) - if 0 != updateCnt { - t.Errorf("Failed to filter entries by start time, 0 != %v", updateCnt) + stats, err = store.GetStats(&filterStruct) + if err != nil { + t.Errorf("Failed to get stats: %v", err) + } else { + updateCount = *stats.UpdateCount + if 0 != updateCount { + t.Errorf("Failed to filter entries by start time, 0 != %v", updateCount) + } } } @@ -60,7 +65,9 @@ func IgnoreTestCount(t *testing.T) { } defer store.Close() - if 0 != store.CountClients(nil) { + stats, err := store.GetStats(nil) + clientCount := int(*stats.ClientCount) + if 0 != clientCount { t.Errorf("Failed to count correctly.") } } |