aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests/scoped_mmap-selftests.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/unittests/scoped_mmap-selftests.c')
-rw-r--r--gdb/unittests/scoped_mmap-selftests.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index a8f507c..d897f14 100644
--- a/gdb/unittests/scoped_mmap-selftests.c
+++ b/gdb/unittests/scoped_mmap-selftests.c
@@ -30,8 +30,10 @@
#include <unistd.h>
-namespace selftests {
-namespace scoped_mmap {
+namespace selftests
+{
+namespace scoped_mmap
+{
/* Test that the file is unmapped. */
static void
@@ -113,16 +115,18 @@ test_invalid_filename ()
{
bool threw = false;
- try {
+ try
+ {
::scoped_mmap m = ::mmap_file ("/this/file/should/not/exist");
- } catch (gdb_exception &e) {
+ }
+ catch (gdb_exception &e)
+ {
threw = true;
- }
+ }
SELF_CHECK (threw);
}
-
/* Run selftests. */
static void
run_tests ()
@@ -137,13 +141,12 @@ run_tests ()
#endif /* !defined(HAVE_SYS_MMAN_H) */
void _initialize_scoped_mmap_selftests ();
+
void
_initialize_scoped_mmap_selftests ()
{
#if defined(HAVE_SYS_MMAN_H)
- selftests::register_test ("scoped_mmap",
- selftests::scoped_mmap::run_tests);
- selftests::register_test ("mmap_file",
- selftests::mmap_file::run_tests);
+ selftests::register_test ("scoped_mmap", selftests::scoped_mmap::run_tests);
+ selftests::register_test ("mmap_file", selftests::mmap_file::run_tests);
#endif
}