aboutsummaryrefslogtreecommitdiff
path: root/gdb/selftest.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-08-18 09:20:43 +0100
committerYao Qi <yao.qi@linaro.org>2017-08-18 09:20:43 +0100
commit7649770c8e52afe2696a70bb50ac3039c844d381 (patch)
treec04e12f6c672590e9df9888a80ed3fa23b7cb3a9 /gdb/selftest.c
parentde25939739ffe9a9ad7cec07a35bb2a1e430fe39 (diff)
downloadgdb-7649770c8e52afe2696a70bb50ac3039c844d381.zip
gdb-7649770c8e52afe2696a70bb50ac3039c844d381.tar.gz
gdb-7649770c8e52afe2696a70bb50ac3039c844d381.tar.bz2
Put selftests api into selftests namespace
This patch changes register_self_test to selftests::register_test, and run_self_tests to selftest::run_tests. gdb: 2017-08-18 Yao Qi <yao.qi@linaro.org> * selftest.c (register_self_test): Rename it to selftests::register_test. (run_self_tests): selftest::run_tests. * selftest.h: Update declarations. * selftest-arch.c (register_self_test_foreach_arch): Rename it to selftests::register_test_foreach_arch. * selftest-arch.h: Update declaration. * aarch64-tdep.c: Update. * arm-tdep.c: Likewise. * disasm-selftests.c: Likewise. * dwarf2loc.c: Likewise. * dwarf2-frame.c: Likewise. * findvar.c: Likewise. * gdbarch-selftests.c: Likewise. * maint.c (maintenance_selftest): Likewise. * regcache.c: Likewise. * rust-exp.y: Likewise. * selftest-arch.c: Likewise. * unittests/environ-selftests.c: Likewise. * unittests/function-view-selftests.c: Likewise. * unittests/offset-type-selftests.c: Likewise. * unittests/optional-selftests.c: Likewise. * unittests/scoped_restore-selftests.c: Likewise. * utils-selftests.c: Likewise.
Diffstat (limited to 'gdb/selftest.c')
-rw-r--r--gdb/selftest.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/selftest.c b/gdb/selftest.c
index 14b76f6..31d16af 100644
--- a/gdb/selftest.c
+++ b/gdb/selftest.c
@@ -20,6 +20,9 @@
#include "selftest.h"
#include <vector>
+namespace selftests
+{
+
/* All the tests that have been registered. */
static std::vector<self_test_function *> tests;
@@ -27,7 +30,7 @@ static std::vector<self_test_function *> tests;
/* See selftest.h. */
void
-register_self_test (self_test_function *function)
+register_test (self_test_function *function)
{
tests.push_back (function);
}
@@ -35,7 +38,7 @@ register_self_test (self_test_function *function)
/* See selftest.h. */
void
-run_self_tests (void)
+run_tests (void)
{
int failed = 0;
@@ -62,3 +65,4 @@ run_self_tests (void)
printf_filtered (_("Ran %lu unit tests, %d failed\n"),
(long) tests.size (), failed);
}
+} // namespace selftests