[mutter] tests/monitor-unit-tests: Clear config history before each test
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests/monitor-unit-tests: Clear config history before each test
- Date: Mon, 21 Aug 2017 04:47:30 +0000 (UTC)
commit 8b92ad1d4bfcac1e9f4978d9dc4cf26256002c86
Author: Jonas Ådahl <jadahl gmail com>
Date: Fri Aug 18 00:53:32 2017 +0800
tests/monitor-unit-tests: Clear config history before each test
To not let different tests interfere with each other, clear the config
history before each run.
src/tests/monitor-unit-tests.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c
index 59a0af4..6a8626b 100644
--- a/src/tests/monitor-unit-tests.c
+++ b/src/tests/monitor-unit-tests.c
@@ -4793,11 +4793,24 @@ meta_test_monitor_migrated_rotated (void)
}
static void
+test_case_setup (void **fixture,
+ const void *data)
+{
+ MetaBackend *backend = meta_get_backend ();
+ MetaMonitorManager *monitor_manager =
+ meta_backend_get_monitor_manager (backend);
+ MetaMonitorConfigManager *config_manager = monitor_manager->config_manager;
+
+ meta_monitor_config_manager_set_current (config_manager, NULL);
+ meta_monitor_config_manager_clear_history (config_manager);
+}
+
+static void
add_monitor_test (const char *test_path,
GTestFunc test_func)
{
g_test_add (test_path, gpointer, NULL,
- NULL,
+ test_case_setup,
(void (* ) (void **, const void *)) test_func,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]