ChangeSet ID: 31289
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2007/07/29 20:56:39
Modified files:
include : incl.php
unit_test : run_tests.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Purge and check session message count before and after the unit tests. The unit tests generate
a lot of session messages and we don't want to leave these around after the tests.
Patch: http://cvs.winehq.org/patch.py?id=31289
Old revision New revision Changes Path
1.45 1.46 +6 -0 appdb/include/incl.php
1.16 1.17 +7 -1 appdb/unit_test/run_tests.php
Index: appdb/include/incl.php
diff -u -p appdb/include/incl.php:1.45 appdb/include/incl.php:1.46
--- appdb/include/incl.php:1.45 30 Jul 2007 1:56:39 -0000
+++ appdb/include/incl.php 30 Jul 2007 1:56:39 -0000
@@ -273,6 +273,12 @@ function addmsg($text, $color = "black")
}
+function purgeSessionMessages()
+{
+ $sQuery = "truncate sessionMessages";
+ query_parameters($sQuery);
+}
+
/**
* output msg_buffer and clear it.
Index: appdb/unit_test/run_tests.php
diff -u -p appdb/unit_test/run_tests.php:1.16 appdb/unit_test/run_tests.php:1.17
--- appdb/unit_test/run_tests.php:1.16 30 Jul 2007 1:56:39 -0000
+++ appdb/unit_test/run_tests.php 30 Jul 2007 1:56:39 -0000
@@ -17,11 +17,13 @@ if(!defined("DISABLE_EMAIL"))
// default to the tests being successful
$bTestSuccess = true;
+// purge any session messages currently in the database
+purgeSessionMessages();
+
// retrieve counts of each of the tables so we can check again
// at the end of the
$oStartingTableCounts = new table_counts();
-
include_once("test_user.php");
echo "\n";
@@ -43,6 +45,9 @@ include_once("test_appData.php");
echo "\n";
include_once("test_testData.php");
+// purge any session messages we generated during the test
+purgeSessionMessages();
+
// retrieve counts of each of the tables after our tests
$oEndingTableCounts = new table_counts();
@@ -97,6 +102,7 @@ class table_counts
'testResults',
'user_list',
'user_privs',
+ 'sessionMessages',
'vendor');
$this->update_counts();