[libpeas] Assert an expectation of test_engine_get_default()



commit 4046f3b76877a43b12727ee024735f728bd4c774
Author: Garrett Regier <garrettregier gmail com>
Date:   Tue Nov 12 22:46:41 2013 -0800

    Assert an expectation of test_engine_get_default()

 tests/libpeas/engine.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/tests/libpeas/engine.c b/tests/libpeas/engine.c
index da11183..dafe758 100644
--- a/tests/libpeas/engine.c
+++ b/tests/libpeas/engine.c
@@ -63,6 +63,7 @@ test_engine_new (PeasEngine *engine)
 {
   PeasEngine *new_engine;
 
+  /* Only one testing engine can be alive */
   new_engine = peas_engine_new ();
 
   g_assert (engine != NULL);
@@ -98,7 +99,11 @@ test_engine_get_default (void)
 
   g_assert (peas_engine_get_default () == peas_engine_get_default ());
 
-  g_object_unref (peas_engine_get_default ());
+  /* Only has a single ref */
+  test_engine = peas_engine_get_default ();
+  g_object_add_weak_pointer (test_engine, &test_engine);
+  g_object_unref (test_engine);
+  g_assert (test_engine == NULL);
 
 
   /* Check that the default engine is the newly created engine


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