[nemiver] Initialize IDebugger dynmods with gconf in tests



commit 41e6eb33f48c2d109f1a74a33eab77881533c948
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sat Jan 22 19:10:05 2011 +0100

    Initialize IDebugger dynmods with gconf in tests
    
    	* src/dbgengine/nmv-debugger-utils.[h,cc]
    	(load_debugger_iface_with_gconf): New entry point.
    	* tests/test-cpptrait.cc (test_debugger)
    	* tests/test-deref.cc (test_main)
    	* tests/test-disassemble.cc (test_main)
    	* tests/test-local-vars-list.cc (test_main)
    	* tests/test-types.cc (test_main)
    	* tests/test-var-list.cc (test_main)
    	* tests/test-var-walker.cc (test_main)
    	* tests/test-variable-format.cc (test_main)
    	* tests/test-varobj-walker.cc (test_main)
    	* tests/test-vars.cc (test_main)
    	* tests/test-watchpoint.cc (test_main):
    	Use load_debugger_iface_with_gconf.
    	* tests/Makefile.am: Link all the tests loading the IDebugger
    	interface with $(top_builddir)/src/dbgengine/libdebuggerutils.la

 src/dbgengine/nmv-debugger-utils.cc |   24 ++++++
 src/dbgengine/nmv-debugger-utils.h  |    2 +
 tests/Makefile.am                   |   39 ++++++---
 tests/test-breakpoint.cc            |    4 +-
 tests/test-cpptrait.cc              |    4 +-
 tests/test-deref.cc                 |    8 +-
 tests/test-disassemble.cc           |    5 +-
 tests/test-local-vars-list.cc       |   10 +-
 tests/test-types.cc                 |    6 +-
 tests/test-var-list.cc              |   11 ++-
 tests/test-var-path-expr.cc         |    4 +-
 tests/test-var-walker.cc            |   11 +--
 tests/test-variable-format.cc       |  149 +++++++++++++++++++++++++++++++++++
 tests/test-varobj-walker.cc         |   10 +-
 tests/test-vars.cc                  |   12 ++--
 tests/test-watchpoint.cc            |    4 +-
 16 files changed, 244 insertions(+), 59 deletions(-)
---
diff --git a/src/dbgengine/nmv-debugger-utils.cc b/src/dbgengine/nmv-debugger-utils.cc
index 30bfde6..5fbc2b6 100644
--- a/src/dbgengine/nmv-debugger-utils.cc
+++ b/src/dbgengine/nmv-debugger-utils.cc
@@ -100,5 +100,29 @@ dump_variable_value (IDebugger::VariableSafePtr a_var,
     a_out_str = os.str ();
 }
 
+/// Load the debugger interface using the default
+/// DynamicModuleManager, and initialize it with the gconf
+/// based IConfMgr.
+/// \return the IDebuggerSafePtr
+IDebuggerSafePtr
+load_debugger_iface_with_gconf ()
+{
+    
+    // Load the confmgr interface
+    IConfMgrSafePtr conf_mgr =
+        common::DynamicModuleManager::load_iface_with_default_manager<IConfMgr>
+      ("gconfmgr", "IConfMgr");
+
+    // load the IDebugger interface
+    IDebuggerSafePtr debugger =
+        common::DynamicModuleManager::load_iface_with_default_manager<IDebugger>
+        ("gdbengine", "IDebugger");
+
+    // Initialize the debugger interface.
+    debugger->do_init (conf_mgr);
+
+    return debugger;
+}
+
 NEMIVER_END_NAMESPACE (debugger_utils)
 NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/dbgengine/nmv-debugger-utils.h b/src/dbgengine/nmv-debugger-utils.h
index 125368c..b0710a5 100644
--- a/src/dbgengine/nmv-debugger-utils.h
+++ b/src/dbgengine/nmv-debugger-utils.h
@@ -41,6 +41,8 @@ void dump_variable_value (IDebugger::VariableSafePtr a_var,
                           int a_indent_num,
                           std::string &a_out_str);
 
+IDebuggerSafePtr load_debugger_iface_with_gconf ();
+
 NEMIVER_END_NAMESPACE (debugger_utils)
 NEMIVER_END_NAMESPACE (nemiver)
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f720cea..7153de8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -48,19 +48,24 @@ forkchild_LDADD=
 
 runtestbreakpoint_SOURCES=test-breakpoint.cc
 runtestbreakpoint_LDADD= NEMIVERCOMMON_LIBS@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestwatchpoint_SOURCES=test-watchpoint.cc
 runtestwatchpoint_LDADD= NEMIVERCOMMON_LIBS@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestvarpathexpr_SOURCES=test-var-path-expr.cc
 runtestvarpathexpr_LDADD= NEMIVERCOMMON_LIBS@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestvarobjwalker_SOURCES=test-varobj-walker.cc
-runtestvarobjwalker_LDADD= NEMIVERCOMMON_LIBS@ @BOOST_TEST_EXEC_MONITOR_LIB@ \
-$(top_builddir)/src/common/libnemivercommon.la
+runtestvarobjwalker_LDADD= NEMIVERCOMMON_LIBS@ \
+ BOOST_TEST_EXEC_MONITOR_LIB@ \
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 #runtestoverloads_SOURCES=test-overloads.cc
 #runtestoverloads_LDADD= NEMIVERCOMMON_LIBS@ @BOOST_TEST_EXEC_MONITOR_LIB@ \
@@ -77,7 +82,8 @@ $(top_builddir)/src/common/libnemivercommon.la
 runtestcpptrait_SOURCES=test-cpptrait.cc
 runtestcpptrait_LDADD= NEMIVERCOMMON_LIBS@ \
 @BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestunicode_SOURCES=test-unicode.cc
 runtestunicode_LDADD= NEMIVERCOMMON_LIBS@ \
@@ -86,23 +92,28 @@ $(top_builddir)/src/common/libnemivercommon.la
 
 runtestvars_SOURCES=test-vars.cc
 runtestvars_LDADD= NEMIVERCOMMON_LIBS@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestvarlist_SOURCES=test-var-list.cc
 runtestvarlist_LDADD= NEMIVERCOMMON_LIBS@ @BOOST_TEST_EXEC_MONITOR_LIB@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestvarwalker_SOURCES=test-var-walker.cc
 runtestvarwalker_LDADD= NEMIVERCOMMON_LIBS@ @BOOST_TEST_EXEC_MONITOR_LIB@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestderef_SOURCES=test-deref.cc
 runtestderef_LDADD= NEMIVERCOMMON_LIBS@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestlocalvarslist_SOURCES=test-local-vars-list.cc
 runtestlocalvarslist_LDADD= NEMIVERCOMMON_LIBS@  \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 #runtestglobalvariables_SOURCES=test-global-variables.cc
 #runtestglobalvariables_LDADD= NEMIVERCOMMON_LIBS@ \
@@ -134,11 +145,13 @@ $(top_builddir)/src/common/libnemivercommon.la
 runtesttypes_SOURCES=test-types.cc
 runtesttypes_LDADD= NEMIVERCOMMON_LIBS@ \
 @BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 runtestdisassemble_SOURCES=test-disassemble.cc
 runtestdisassemble_LDADD= NEMIVERCOMMON_LIBS@ \
-$(top_builddir)/src/common/libnemivercommon.la
+$(top_builddir)/src/common/libnemivercommon.la \
+$(top_builddir)/src/dbgengine/libdebuggerutils.la
 
 docore_SOURCES=do-core.cc
 docore_LDADD= NEMIVERCOMMON_LIBS@
diff --git a/tests/test-breakpoint.cc b/tests/test-breakpoint.cc
index 2c7c885..a244143 100644
--- a/tests/test-breakpoint.cc
+++ b/tests/test-breakpoint.cc
@@ -5,6 +5,7 @@
 #include "common/nmv-safe-ptr-utils.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-debugger.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -200,9 +201,8 @@ test_main (int argc, char *argv[])
 
     THROW_IF_FAIL (loop);
 
-    DynamicModuleManager module_manager;
     IDebuggerSafePtr debugger =
-            module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
+        debugger_utils::load_debugger_iface_with_gconf ();
 
     debugger->set_event_loop_context (loop->get_context ());
 
diff --git a/tests/test-cpptrait.cc b/tests/test-cpptrait.cc
index 511342a..24aeaa8 100644
--- a/tests/test-cpptrait.cc
+++ b/tests/test-cpptrait.cc
@@ -3,6 +3,7 @@
 #include "common/nmv-exception.h"
 #include "nmv-i-lang-trait.h"
 #include "nmv-i-debugger.h"
+#include "nmv-debugger-utils.h"
 
 using namespace std;
 using nemiver::common::Initializer;
@@ -45,8 +46,7 @@ void test_debugger ()
     using nemiver::IDebugger;
     using nemiver::IDebuggerSafePtr;
     IDebuggerSafePtr debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-            ("gdbengine", "IDebugger");
+        nemiver::debugger_utils::load_debugger_iface_with_gconf ();
     BOOST_REQUIRE (debugger);
     ILangTrait &trait = debugger->get_language_trait ();
     BOOST_REQUIRE (trait.get_name () == "cpptrait");
diff --git a/tests/test-deref.cc b/tests/test-deref.cc
index bb4787d..2edbcc3 100644
--- a/tests/test-deref.cc
+++ b/tests/test-deref.cc
@@ -4,6 +4,7 @@
 #include "nmv-i-debugger.h"
 #include "nmv-i-lang-trait.h"
 #include "common/nmv-initializer.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -129,15 +130,14 @@ test_main (int argc, char **argv)
 {
     if (argc || argv) {}
 
-    NEMIVER_TRY
+    NEMIVER_TRY;
 
     Initializer::do_init ();
     BOOST_REQUIRE (loop);
 
     IDebuggerSafePtr debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-                                                                ("gdbengine",
-                                                                 "IDebugger");
+      debugger_utils::load_debugger_iface_with_gconf ();
+
     //setup the debugger with the glib mainloop
     debugger->set_event_loop_context (Glib::MainContext::get_default ());
 
diff --git a/tests/test-disassemble.cc b/tests/test-disassemble.cc
index 6210c24..24f0a1c 100644
--- a/tests/test-disassemble.cc
+++ b/tests/test-disassemble.cc
@@ -32,6 +32,7 @@
 #include "common/nmv-asm-utils.h"
 #include "nmv-i-debugger.h"
 #include "nmv-dbg-common.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -138,9 +139,7 @@ test_main (int, char**)
 
     THROW_IF_FAIL (loop);
 
-    DynamicModuleManager module_manager;
-    debugger = module_manager.load_iface<IDebugger> ("gdbengine",
-                                                     "IDebugger");
+    debugger = debugger_utils::load_debugger_iface_with_gconf ();
 
     debugger->set_event_loop_context (loop->get_context ());
 
diff --git a/tests/test-local-vars-list.cc b/tests/test-local-vars-list.cc
index 8bd929d..faf185d 100644
--- a/tests/test-local-vars-list.cc
+++ b/tests/test-local-vars-list.cc
@@ -4,6 +4,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-var-list.h"
+#include "nmv-debugger-utils.h"
 
 using namespace std;
 using namespace nemiver;
@@ -126,15 +127,14 @@ test_main (int argc, char **argv)
 {
     if (argc || argv) {/*keep compiler happy*/}
 
-    NEMIVER_TRY
+    NEMIVER_TRY;
 
     Initializer::do_init ();
 
     //load the IDebugger interface
     debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-                                                                ("gdbengine",
-                                                                 "IDebugger");
+      debugger_utils::load_debugger_iface_with_gconf ();
+
     //setup the debugger with the glib mainloop
     debugger->set_event_loop_context (Glib::MainContext::get_default ());
 
@@ -165,7 +165,7 @@ test_main (int argc, char **argv)
     debugger->run ();
 
     loop->run ();
-    NEMIVER_CATCH_AND_RETURN_NOX (-1)
+    NEMIVER_CATCH_AND_RETURN_NOX (-1);
 
     return 0;
 }
diff --git a/tests/test-types.cc b/tests/test-types.cc
index cdfaee1..b855764 100644
--- a/tests/test-types.cc
+++ b/tests/test-types.cc
@@ -4,6 +4,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-safe-ptr-utils.h"
 #include "nmv-i-debugger.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -77,9 +78,8 @@ test_main (int, char **)
     Initializer::do_init();
     THROW_IF_FAIL (loop);
 
-    DynamicModuleManager module_manager;
     IDebuggerSafePtr debugger =
-            module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
+      debugger_utils::load_debugger_iface_with_gconf ();
 
     debugger->set_event_loop_context (loop->get_context ());
 
@@ -107,5 +107,3 @@ test_main (int, char **)
     NEMIVER_CATCH_NOX
     return 0;
 }
-
-
diff --git a/tests/test-var-list.cc b/tests/test-var-list.cc
index 44ca7c7..5e9ac13 100644
--- a/tests/test-var-list.cc
+++ b/tests/test-var-list.cc
@@ -4,6 +4,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-var-list.h"
+#include "nmv-debugger-utils.h"
 
 using namespace std;
 using namespace nemiver;
@@ -191,15 +192,15 @@ NEMIVER_API int
 test_main (int argc, char **argv)
 {
     if (argc || argv) {/*keep compiler happy*/}
-    NEMIVER_TRY
+
+    NEMIVER_TRY;
 
     Initializer::do_init ();
 
     //load the IDebugger interface
     IDebuggerSafePtr debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-                                                                ("gdbengine",
-                                                                 "IDebugger");
+        debugger_utils::load_debugger_iface_with_gconf ();
+
     //setup the debugger with the glib mainloop
     debugger->set_event_loop_context (Glib::MainContext::get_default ());
 
@@ -255,7 +256,7 @@ test_main (int argc, char **argv)
     //run the event loop.
     //****************************************
     s_loop->run ();
-    NEMIVER_CATCH_AND_RETURN_NOX (-1)
+    NEMIVER_CATCH_AND_RETURN_NOX (-1);
     return 0;
 }
 
diff --git a/tests/test-var-path-expr.cc b/tests/test-var-path-expr.cc
index bcdf3e4..8dda71d 100644
--- a/tests/test-var-path-expr.cc
+++ b/tests/test-var-path-expr.cc
@@ -5,6 +5,7 @@
 #include "common/nmv-safe-ptr-utils.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-debugger.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -118,9 +119,8 @@ test_main (int argc, char *argv[])
 
     THROW_IF_FAIL (loop);
 
-    DynamicModuleManager module_manager;
     IDebuggerSafePtr debugger =
-            module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
+        debugger_utils::load_debugger_iface_with_gconf ();
 
     debugger->set_event_loop_context (loop->get_context ());
 
diff --git a/tests/test-var-walker.cc b/tests/test-var-walker.cc
index 3264594..ab847c8 100644
--- a/tests/test-var-walker.cc
+++ b/tests/test-var-walker.cc
@@ -7,6 +7,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-var-list-walker.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -181,16 +182,14 @@ test_main (int argc, char **argv)
 {
     if (argc || argv) {/*keep compiler happy*/}
 
-    NEMIVER_TRY
+    NEMIVER_TRY;
 
     Initializer::do_init ();
 
-
     //load the IDebugger interface
     IDebuggerSafePtr debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-                                                                ("gdbengine",
-                                                                 "IDebugger");
+        debugger_utils::load_debugger_iface_with_gconf ();
+
     //setup the debugger with the glib mainloop
     debugger->set_event_loop_context (Glib::MainContext::get_default ());
 
@@ -263,7 +262,7 @@ test_main (int argc, char **argv)
         BOOST_FAIL (str.c_str ());
     }
 
-    NEMIVER_CATCH_AND_RETURN_NOX (-1)
+    NEMIVER_CATCH_AND_RETURN_NOX (-1);
 
     return 0;
 }
diff --git a/tests/test-variable-format.cc b/tests/test-variable-format.cc
new file mode 100644
index 0000000..1268d64
--- /dev/null
+++ b/tests/test-variable-format.cc
@@ -0,0 +1,149 @@
+#include <iostream>
+#include <sstream>
+#include <map>
+#include <string>
+#include <boost/test/test_tools.hpp>
+#include <boost/test/minimal.hpp>
+#include <glibmm.h>
+#include "common/nmv-initializer.h"
+#include "common/nmv-exception.h"
+#include "nmv-i-var-list-walker.h"
+#include "nmv-debugger-utils.h"
+
+using namespace nemiver;
+using namespace nemiver::common;
+
+Glib::RefPtr<Glib::MainLoop> s_loop =
+    Glib::MainLoop::create (Glib::MainContext::get_default ());
+
+static bool s_got_format;
+static bool s_got_value;
+
+static void
+on_engine_died_signal ()
+{
+    s_loop->quit ();
+}
+
+static void
+on_program_finished_signal ()
+{
+    s_loop->quit ();
+}
+
+static void
+on_var_format (const IDebugger::VariableSafePtr a_var,
+	       IDebuggerSafePtr /*a_debugger*/)
+{
+    BOOST_REQUIRE (a_var);
+    BOOST_REQUIRE (a_var->format () ==
+		   IDebugger::Variable::HEXADECIMAL_FORMAT);
+    s_got_format = true;
+}
+
+static void
+on_var_evaluated (const IDebugger::VariableSafePtr a_var,
+		  IDebuggerSafePtr /*a_debugger*/)
+{
+    BOOST_REQUIRE (a_var);
+    BOOST_REQUIRE (a_var->format () ==
+		   IDebugger::Variable::HEXADECIMAL_FORMAT);
+    BOOST_REQUIRE (a_var->value () == "0x12");
+    s_got_value = true;
+    s_loop->quit ();
+}
+
+static void
+on_variable_created (const IDebugger::VariableSafePtr a_var,
+                     IDebuggerSafePtr a_debugger)
+{
+    BOOST_REQUIRE (a_var);
+    BOOST_REQUIRE (a_debugger);
+    a_debugger->step_over ();
+    a_debugger->set_variable_format
+      (a_var, IDebugger::Variable::HEXADECIMAL_FORMAT);
+    a_debugger->query_variable_format (a_var,
+                                       sigc::bind (&on_var_format,
+                                                   a_debugger));
+    a_debugger->evaluate_variable_expr (a_var,
+					sigc::bind
+					(&on_var_evaluated,
+					 a_debugger));
+}
+
+static void
+on_stopped_signal (IDebugger::StopReason a_reason,
+                   bool /*a_has_frame*/,
+                   const IDebugger::Frame &a_frame,
+                   int /*a_thread_id*/,
+                   int /*bp num*/,
+                   const UString &/*a_cookie*/,
+                   IDebuggerSafePtr &a_debugger)
+{
+    NEMIVER_TRY
+
+    BOOST_REQUIRE (a_debugger);
+
+    if (a_reason == IDebugger::BREAKPOINT_HIT) {
+        if (a_frame.function_name () == "main") {
+            MESSAGE ("broke in main, setting breakoint "
+		     "into func1_1");
+            a_debugger->set_breakpoint ("func1_1");
+            a_debugger->do_continue ();
+        } else if (a_frame.function_name () == "func1_1") {
+            MESSAGE ("broke in func1_1");
+            a_debugger->create_variable ("i_i",
+                                         sigc::bind
+					 (&on_variable_created,
+					  a_debugger));
+        }
+    } else {
+        a_debugger->do_continue ();
+    }
+
+    NEMIVER_CATCH_NOX
+}
+
+NEMIVER_API int
+test_main (int, char **)
+{
+    NEMIVER_TRY;
+
+    Initializer::do_init ();
+
+    //load the IDebugger interface
+    IDebuggerSafePtr debugger =
+        debugger_utils::load_debugger_iface_with_gconf ();
+        
+    //setup the debugger with the glib mainloop
+    debugger->set_event_loop_context (Glib::MainContext::get_default ());
+
+    //*******************************
+    //<connect to IDebugger events>
+    //******************************
+    debugger->engine_died_signal ().connect (&on_engine_died_signal);
+    debugger->program_finished_signal ().connect (&on_program_finished_signal);
+    debugger->stopped_signal ().connect (sigc::bind (&on_stopped_signal,
+                                                     debugger));
+    //*******************************
+    //</connect to IDebugger events>
+    //******************************
+
+    vector<UString> args;
+    debugger->load_program ("fooprog", args, ".");
+    debugger->set_breakpoint ("main");
+
+    debugger->run ();
+
+    //****************************************
+    //run the event loop.
+    //****************************************
+    s_loop->run ();
+
+
+    NEMIVER_CATCH_AND_RETURN_NOX (-1);
+
+    BOOST_REQUIRE (s_got_format);
+
+    return 0;
+}
diff --git a/tests/test-varobj-walker.cc b/tests/test-varobj-walker.cc
index b07460d..7518d03 100644
--- a/tests/test-varobj-walker.cc
+++ b/tests/test-varobj-walker.cc
@@ -8,6 +8,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-var-list-walker.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -151,12 +152,11 @@ test_main (int, char **)
 
     Initializer::do_init ();
 
-    //load the IDebugger interface
+    // load the IDebugger interface
     IDebuggerSafePtr debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-                                                                ("gdbengine",
-                                                                 "IDebugger");
-    //setup the debugger with the glib mainloop
+        debugger_utils::load_debugger_iface_with_gconf ();
+
+    // setup the debugger with the glib mainloop
     debugger->set_event_loop_context (Glib::MainContext::get_default ());
 
     //*******************************
diff --git a/tests/test-vars.cc b/tests/test-vars.cc
index f40e225..11e1285 100644
--- a/tests/test-vars.cc
+++ b/tests/test-vars.cc
@@ -6,6 +6,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-exception.h"
 #include "nmv-i-var-list-walker.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -244,16 +245,14 @@ NEMIVER_API int
 test_main (int argc __attribute__((unused)),
            char **argv __attribute__ ((unused)))
 {
-    NEMIVER_TRY
+    NEMIVER_TRY;
 
     Initializer::do_init ();
 
-    //load the IDebugger interface
     IDebuggerSafePtr debugger =
-        DynamicModuleManager::load_iface_with_default_manager<IDebugger>
-                                                                ("gdbengine",
-                                                                 "IDebugger");
-    //setup the debugger with the glib mainloop
+        debugger_utils::load_debugger_iface_with_gconf ();
+
+    // setup the debugger with the glib mainloop
     debugger->set_event_loop_context (Glib::MainContext::get_default ());
 
     //*******************************
@@ -270,6 +269,7 @@ test_main (int argc __attribute__((unused)),
                                                debugger));
     debugger->variable_deleted_signal ().connect
                 (sigc::bind (&on_variable_deleted_signal2, debugger));
+
     //*******************************
     //</connect to IDebugger events>
     //******************************
diff --git a/tests/test-watchpoint.cc b/tests/test-watchpoint.cc
index f945390..f24b6d1 100644
--- a/tests/test-watchpoint.cc
+++ b/tests/test-watchpoint.cc
@@ -4,6 +4,7 @@
 #include "common/nmv-initializer.h"
 #include "common/nmv-safe-ptr-utils.h"
 #include "nmv-i-debugger.h"
+#include "nmv-debugger-utils.h"
 
 using namespace nemiver;
 using namespace nemiver::common;
@@ -80,9 +81,8 @@ test_main (int, char **)
 
     THROW_IF_FAIL (loop);
 
-    DynamicModuleManager module_manager;
     IDebuggerSafePtr debugger =
-        module_manager.load_iface<IDebugger> ("gdbengine", "IDebugger");
+        debugger_utils::load_debugger_iface_with_gconf ();
 
     debugger->set_event_loop_context (loop->get_context ());
 



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