From b572cdff2f479f9a0f2acdec9176a2c1a1a56b21 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 19 Aug 2006 19:39:57 +0000 Subject: [PATCH] Updated SQLX test suite for plugin_end() bug --- plugins/testsuite/sqlxtest.sma | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/plugins/testsuite/sqlxtest.sma b/plugins/testsuite/sqlxtest.sma index 2e684d1f..36bcb7e3 100644 --- a/plugins/testsuite/sqlxtest.sma +++ b/plugins/testsuite/sqlxtest.sma @@ -5,6 +5,7 @@ new Handle:g_DbInfo new g_QueryNum +new bool:g_TestEnd = false public plugin_init() { @@ -13,6 +14,7 @@ public plugin_init() register_srvcmd("sqlx_test_thread", "SqlxTest_Thread") register_srvcmd("sqlx_test_old1", "SqlxTest_Old1") register_srvcmd("sqlx_test_old2", "SqlxTest_Old2") + register_srvcmd("sqlx_test_thread_end", "SqlxTest_ThreadEnd") new configsDir[64] get_configsdir(configsDir, 63) @@ -283,8 +285,34 @@ public SqlxTest_Old2() dbi_close(sql) } +public SqlxTest_ThreadEnd() +{ + if (read_argc() < 2) + { + server_print("Requires mapname!") + } else { + new mapname[64] + + read_argv(1, mapname, 63) + if (!is_map_valid(mapname)) + { + server_print("Invalid map: %s", mapname) + } else { + g_TestEnd = true + server_cmd("changelevel %s", mapname) + } + } + + return PLUGIN_HANDLED +} + public plugin_end() { - SQL_FreeHandle(g_DbInfo) + if (g_TestEnd) + { + SqlxTest_Thread() + } else { + SQL_FreeHandle(g_DbInfo) + } }