diff options
-rw-r--r-- | p2pvr/daemon/unittests/datasources/eventOffset.sql | 8 | ||||
-rw-r--r-- | p2pvr/daemon/unittests/mockDefs.cpp | 5 | ||||
-rw-r--r-- | p2pvr/daemon/unittests/mockDefs.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/p2pvr/daemon/unittests/datasources/eventOffset.sql b/p2pvr/daemon/unittests/datasources/eventOffset.sql new file mode 100644 index 0000000..3c796ca --- /dev/null +++ b/p2pvr/daemon/unittests/datasources/eventOffset.sql @@ -0,0 +1,8 @@ +-- +-- This SQL will update events in the sample data to start today +-- + +UPDATE events SET + starttime = starttime + (SELECT current_date - min(starttime) FROM events), + stoptime = stoptime + (SELECT current_date - min(starttime) FROM events) + diff --git a/p2pvr/daemon/unittests/mockDefs.cpp b/p2pvr/daemon/unittests/mockDefs.cpp index b488024..6974569 100644 --- a/p2pvr/daemon/unittests/mockDefs.cpp +++ b/p2pvr/daemon/unittests/mockDefs.cpp @@ -10,3 +10,8 @@ StandardMockDatabase::StandardMockDatabase() : { } +StandardMockDatabasePlusOffset::StandardMockDatabasePlusOffset() : + MockDatabase("user=postgres dbname=postgres", "postgres", { "../../datasources/schema.sql", "datasources/data.sql", "datasources/eventOffset.sql" }) +{ +} + diff --git a/p2pvr/daemon/unittests/mockDefs.h b/p2pvr/daemon/unittests/mockDefs.h index 2fa1e6f..69d2af9 100644 --- a/p2pvr/daemon/unittests/mockDefs.h +++ b/p2pvr/daemon/unittests/mockDefs.h @@ -7,6 +7,7 @@ DECLAREMOCK(SchemaOnlyMockDatabase); DECLAREMOCK(StandardMockDatabase); +DECLAREMOCK(StandardMockDatabasePlusOffset); #undef DECLAREMOCK |