[spice-server v2 4/7] test: Add test_destroy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows to chain several test cases by using
test_new()/test_destroy().
---
 server/tests/test-display-base.c | 7 +++++++
 server/tests/test-display-base.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/server/tests/test-display-base.c b/server/tests/test-display-base.c
index 55e37a5..636c505 100644
--- a/server/tests/test-display-base.c
+++ b/server/tests/test-display-base.c
@@ -908,6 +908,13 @@ Test *test_new(SpiceCoreInterface *core)
     return test;
 }
 
+void test_destroy(Test *test)
+{
+    test->core->timer_remove(test->wakeup_timer);
+    spice_server_destroy(test->server);
+    free(test);
+}
+
 static void init_automated(void)
 {
     struct sigaction sa;
diff --git a/server/tests/test-display-base.h b/server/tests/test-display-base.h
index 7b5b509..bdf7a11 100644
--- a/server/tests/test-display-base.h
+++ b/server/tests/test-display-base.h
@@ -137,6 +137,7 @@ void test_set_command_list(Test *test, Command *command, int num_commands);
 void test_add_display_interface(Test *test);
 void test_add_agent_interface(SpiceServer *server); // TODO - Test *test
 Test* test_new(SpiceCoreInterface* core);
+void test_destroy(Test *test);
 
 uint32_t test_get_width(void);
 uint32_t test_get_height(void);
-- 
2.9.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]