summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/sql/fillTestTable.sql2
-rw-r--r--test/test-e2e.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/test/sql/fillTestTable.sql b/test/sql/fillTestTable.sql
new file mode 100644
index 0000000..188107f
--- /dev/null
+++ b/test/sql/fillTestTable.sql
@@ -0,0 +1,2 @@
+INSERT INTO session(session_id, username, user_lvl, ip_addr, port, created, modified)
+ VALUES('hashyhash', 'testuser', 'groupadm', '10.10.0.1', 2433, now(), now());
diff --git a/test/test-e2e.cpp b/test/test-e2e.cpp
index 9906a0b..1921a08 100644
--- a/test/test-e2e.cpp
+++ b/test/test-e2e.cpp
@@ -6,6 +6,7 @@
#include "testdb-postgresql.h"
#include <output/pq/updateDatabase.h>
#include <sql/createTestTable.h>
+#include <sql/fillTestTable.h>
#include <sql/selectTestTable.h>
BOOST_AUTO_TEST_CASE(e2e)
@@ -25,7 +26,9 @@ BOOST_AUTO_TEST_CASE(e2e)
BOOST_REQUIRE(src);
MyGrate::sql::createTestTable::execute(&mym);
+ MyGrate::sql::fillTestTable::execute(&mym);
out.addTable(&mym, "session");
+ out.copyTableContent(&mym, "session");
- BOOST_CHECK_EQUAL(MyGrate::sql::selectTestTable::execute(&pqm)->rows(), 0);
+ BOOST_CHECK_EQUAL(MyGrate::sql::selectTestTable::execute(&pqm)->rows(), 1);
}