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 | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5store_test.go b/src/hub/src/spreadspace.org/sfive/s5store_test.go index a34633e..ed49175 100644 --- a/src/hub/src/spreadspace.org/sfive/s5store_test.go +++ b/src/hub/src/spreadspace.org/sfive/s5store_test.go @@ -5,22 +5,11 @@ import ( "time" ) -func ignoreTestGetFilter(t *testing.T) { - queryStartTime := time.Date(2015, time.December, 24, 1, 1, 1, 0, time.UTC) - filterStruct := StatsFilter{start: &queryStartTime} - fe, np := getFilteredDataUpdateSelect(&filterStruct) - if fe != "(select * from DataUpdates where StartTime >= :filterstart)" { - t.Errorf("get filter sql failed: fe: %v", fe) - } - if queryStartTime.Unix() != np["filterstart"].(int64) { - t.Errorf("get filter sql failed: np: %v != %v", np["filterstart"], queryStartTime) - } -} - func TestAppend(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() @@ -33,16 +22,21 @@ func TestAppend(t *testing.T) { err = store.Append(dat) if err != nil { t.Errorf("Failed to append: %v", err) + return } 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) - } - if 1 != updateCount { - t.Errorf("Failed to append, invalid number of updates, 1 != %v", updateCount) + if err != nil { + t.Errorf("Failed to get stats: %v", err) + } else { + clientCount := int(stats.ClientCount) + updateCount := stats.UpdateCount + if 3 != clientCount { + t.Errorf("Failed fo append, invalid number of clients, 3 != %v", clientCount) + } + 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) @@ -51,14 +45,14 @@ func TestAppend(t *testing.T) { if err != nil { t.Errorf("Failed to get stats: %v", err) } else { - updateCount = stats.UpdateCount + updateCount := stats.UpdateCount if 0 != updateCount { t.Errorf("Failed to filter entries by start time, 0 != %v", updateCount) } } } -func IgnoreTestCount(t *testing.T) { +func TestCount(t *testing.T) { store, err := NewStore("file:memdb1?mode=memory&cache=shared") if err != nil { t.Errorf("Failed to initialize: %v", err) |