mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Remove local log handler and use checked handler from utest-support.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22462 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -197,8 +197,12 @@ test_dbi_business_store_and_reload( const gchar* driver, QofSession* session_1,
|
||||
|
||||
gchar *msg = "[gnc_dbi_unlock()] There was no lock entry in the Lock table";
|
||||
gchar *log_domain = "gnc.backend.dbi";
|
||||
guint loglevel = G_LOG_LEVEL_WARNING, hdlr;
|
||||
TestErrorStruct check = { loglevel, log_domain, msg };
|
||||
guint loglevel = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL, hdlr;
|
||||
TestErrorStruct check = { loglevel, log_domain, msg, 0 };
|
||||
GLogFunc dhdlr = g_log_set_default_handler ((GLogFunc)test_null_handler,
|
||||
&check);
|
||||
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler,
|
||||
&check);
|
||||
|
||||
g_test_message ( "Testing %s\n", driver );
|
||||
|
||||
@@ -224,5 +228,6 @@ test_dbi_business_store_and_reload( const gchar* driver, QofSession* session_1,
|
||||
(GLogFunc)test_checked_handler, &check);
|
||||
qof_session_end( session_3 );
|
||||
g_log_remove_handler (log_domain, hdlr);
|
||||
g_log_set_default_handler (dhdlr, NULL);
|
||||
qof_session_destroy( session_3 );
|
||||
}
|
||||
|
||||
@@ -186,8 +186,13 @@ test_dbi_store_and_reload( const gchar* driver, QofSession* session_1, const gch
|
||||
|
||||
gchar *msg = "[gnc_dbi_unlock()] There was no lock entry in the Lock table";
|
||||
gchar *log_domain = "gnc.backend.dbi";
|
||||
guint loglevel = G_LOG_LEVEL_WARNING, hdlr;
|
||||
TestErrorStruct check = { loglevel, log_domain, msg };
|
||||
guint loglevel = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL, hdlr;
|
||||
TestErrorStruct check = { loglevel, log_domain, msg, 0 };
|
||||
GLogFunc dhdlr = g_log_set_default_handler ((GLogFunc)test_null_handler,
|
||||
&check);
|
||||
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler,
|
||||
&check);
|
||||
|
||||
|
||||
g_test_message ( "Testing %s\n", driver );
|
||||
|
||||
@@ -238,6 +243,7 @@ test_dbi_store_and_reload( const gchar* driver, QofSession* session_1, const gch
|
||||
qof_session_end( session_3 );
|
||||
qof_session_destroy( session_3 );
|
||||
g_log_remove_handler (log_domain, hdlr);
|
||||
g_log_set_default_handler (dhdlr, NULL);
|
||||
}
|
||||
|
||||
/* Given an already-created url (yeah, bad testing practice: Should
|
||||
|
||||
@@ -23,11 +23,9 @@ void do_test_pgsql(void);
|
||||
#define DBI_TEST_XML_FILENAME "test-dbi.xml"
|
||||
#define FILE_NAME "sqlite3:///tmp/test-sqlite3-file"
|
||||
|
||||
static gboolean handler(const gchar* log_domain, GLogLevelFlags log_level, const gchar* message, gpointer user_data)
|
||||
typedef struct
|
||||
{
|
||||
printf("domain=%s level=%d message=%s\n", log_domain, log_level, message);
|
||||
return FALSE;
|
||||
}
|
||||
QofSession *session;
|
||||
|
||||
void
|
||||
do_test_sqlite(void)
|
||||
@@ -53,7 +51,6 @@ do_test_mysql(void)
|
||||
gchar* filename;
|
||||
QofSession* session_1;
|
||||
|
||||
g_test_log_set_fatal_handler(handler, 0);
|
||||
|
||||
// Create a session with data
|
||||
session_1 = qof_session_new();
|
||||
@@ -70,8 +67,6 @@ do_test_pgsql(void)
|
||||
gchar* filename;
|
||||
QofSession* session_1;
|
||||
|
||||
g_test_log_set_fatal_handler(handler, 0);
|
||||
|
||||
// Create a session with data
|
||||
session_1 = qof_session_new();
|
||||
qof_session_begin( session_1, DBI_TEST_XML_FILENAME, FALSE, FALSE, FALSE );
|
||||
|
||||
Reference in New Issue
Block a user