[libpeas] Don't return an already created engine in testing_util_engine_new()



commit 83307d033826e60b4d6ded09fab47935a54263ed
Author: Garrett Regier <alias301 gmail com>
Date:   Fri Mar 18 06:43:21 2011 -0700

    Don't return an already created engine in testing_util_engine_new()

 tests/testing-util/testing-util.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/tests/testing-util/testing-util.c b/tests/testing-util/testing-util.c
index 4e0d730..7360ffa 100644
--- a/tests/testing-util/testing-util.c
+++ b/tests/testing-util/testing-util.c
@@ -142,8 +142,10 @@ testing_util_init (void)
 PeasEngine *
 testing_util_engine_new (void)
 {
-  if (engine != NULL)
-    return engine;
+  /* testing_util_engine_free() checks that the
+   * engine is freed so only one engine can be created
+   */
+  g_assert (engine == NULL);
 
   testing_util_init ();
 



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