* observer.c (observer_test_first_observer): New static variable.

(observer_test_second_observer): Likewise.
        (observer_test_third_observer): Likewise.
        (observer_test_first_notification_function): New static function.
        (observer_test_second_notification_function): Likewise.
        (observer_test_third_notification_function): Likewise.
This commit is contained in:
Joel Brobecker 2003-03-18 18:05:51 +00:00
parent bcd7e15f07
commit 4fbe891ea1
2 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2003-03-18 J. Brobecker <brobecker@gnat.com>
* observer.c (observer_test_first_observer): New static variable.
(observer_test_second_observer): Likewise.
(observer_test_third_observer): Likewise.
(observer_test_first_notification_function): New static function.
(observer_test_second_notification_function): Likewise.
(observer_test_third_notification_function): Likewise.
2003-03-17 J. Brobecker <brobecker@gnat.com>
* hppa-tdep.c (gdb_assert.h): Add missing #include.

View File

@ -190,3 +190,33 @@ observer_notify_normal_stop (void)
{
generic_observer_notify (normal_stop_subject, NULL);
}
/* The following code is only used to unit-test the observers from
our testsuite. DO NOT USE IT within observer.c! */
/* Since this code will not be used within GDB, it will trigger
a warning if we decide to compile with -Wunused-function.
This is ok for now. (brobecker 2003-03-18) */
static int observer_test_first_observer = 0;
static int observer_test_second_observer = 0;
static int observer_test_third_observer = 0;
static void
observer_test_first_notification_function (void)
{
observer_test_first_observer++;
}
static void
observer_test_second_notification_function (void)
{
observer_test_second_observer++;
}
static void
observer_test_third_notification_function (void)
{
observer_test_third_observer++;
}