[nemiver/gtk2-branch] Fix tests/pointer-deref.c regression
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/gtk2-branch] Fix tests/pointer-deref.c regression
- Date: Sun, 4 Sep 2011 10:48:18 +0000 (UTC)
commit be9a5f83cfed6bcec569f2c9a83d57b59073df93
Author: Dodji Seketeli <dodji seketeli org>
Date: Sun Sep 4 10:44:39 2011 +0200
Fix tests/pointer-deref.c regression
* tests/test-local-vars-list.cc (on_stopped_signal): Acknowledge
that we now have 4 local variables, not 3 like before. Expect
that the types of 4 variables got set. Not 3 anymore. Step
further - until after the new variable gets instantiated - before
querying the state of the local variables.
(on_var_type_set): Acknowledge that we have a new local variable
called "b".
tests/pointer-deref.cc | 3 ++-
tests/test-local-vars-list.cc | 11 ++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/tests/pointer-deref.cc b/tests/pointer-deref.cc
index 76cfeb1..6e4c6ee 100644
--- a/tests/pointer-deref.cc
+++ b/tests/pointer-deref.cc
@@ -135,6 +135,7 @@ main ()
foo *foo_ptr = new foo;
bar *bar_ptr = new bar;
baz *baz_ptr = new baz;
+ baz b;
baz_ptr->set_a (10);
baz_ptr->set_b (11);
@@ -157,7 +158,7 @@ main ()
;
}
- baz b;
+
if (b.m_b) {
;
}
diff --git a/tests/test-local-vars-list.cc b/tests/test-local-vars-list.cc
index 33b613f..ebed94a 100644
--- a/tests/test-local-vars-list.cc
+++ b/tests/test-local-vars-list.cc
@@ -34,9 +34,9 @@ on_stopped_signal (IDebugger::StopReason a_reason,
if (a_reason == IDebugger::EXITED_NORMALLY) {
//okay, time to get out. Let's check if the overall test
//went like we want
- BOOST_REQUIRE (nb_var_type_set == 3);
+ BOOST_REQUIRE (nb_var_type_set == 4);
BOOST_REQUIRE (nb_var_value_set == 3);
- BOOST_REQUIRE (a_var_list->get_raw_list ().size () == 3);
+ BOOST_REQUIRE (a_var_list->get_raw_list ().size () == 4);
IDebugger::VariableSafePtr var;
BOOST_REQUIRE (a_var_list->find_variable ("foo_ptr", var));
BOOST_REQUIRE (var);
@@ -62,7 +62,7 @@ on_stopped_signal (IDebugger::StopReason a_reason,
++nb_stops;
if (nb_stops == 1) {
debugger->list_local_variables ();
- } else if (nb_stops == 4) {
+ } else if (nb_stops == 6) {
a_var_list->update_state ();
debugger->do_continue ();
return;
@@ -96,8 +96,9 @@ on_var_type_set (const IDebugger::VariableSafePtr &a_var)
BOOST_REQUIRE (a_var->type () != "");
if (a_var->name () == "foo_ptr"
- ||a_var->name () == "bar_ptr"
- ||a_var->name () == "baz_ptr") {
+ || a_var->name () == "bar_ptr"
+ || a_var->name () == "baz_ptr"
+ || a_var->name () == "b") {
++nb_var_type_set;
MESSAGE ("variable type set: "
<<a_var->name () << ":" << a_var->type ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]