aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests/utils-selftests.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:36:23 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2023-02-08 15:46:02 -0500
commitc583a2520616c2736cffc389c89a48b159366e6c (patch)
treeb4925f26506fcee96c16119431c01760f05db95d /gdb/unittests/utils-selftests.c
parentca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff)
downloadgdb-users/simark/clang-format.zip
gdb-users/simark/clang-format.tar.gz
gdb-users/simark/clang-format.tar.bz2
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdb/unittests/utils-selftests.c')
-rw-r--r--gdb/unittests/utils-selftests.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gdb/unittests/utils-selftests.c b/gdb/unittests/utils-selftests.c
index 70609aa..a01bbc7 100644
--- a/gdb/unittests/utils-selftests.c
+++ b/gdb/unittests/utils-selftests.c
@@ -21,20 +21,21 @@
#include "utils.h"
#include "gdbsupport/selftest.h"
-namespace selftests {
-namespace utils {
+namespace selftests
+{
+namespace utils
+{
static void
test_substitute_path_component ()
{
auto test = [] (std::string s, const char *from, const char *to,
- const char *expected)
- {
- char *temp = xstrdup (s.c_str ());
- substitute_path_component (&temp, from, to);
- SELF_CHECK (strcmp (temp, expected) == 0);
- xfree (temp);
- };
+ const char *expected) {
+ char *temp = xstrdup (s.c_str ());
+ substitute_path_component (&temp, from, to);
+ SELF_CHECK (strcmp (temp, expected) == 0);
+ xfree (temp);
+ };
test ("/abc/$def/g", "abc", "xyz", "/xyz/$def/g");
test ("abc/$def/g", "abc", "xyz", "xyz/$def/g");
@@ -48,10 +49,11 @@ test_substitute_path_component ()
test ("/abc/$def/abc", "abc", "xyz", "/xyz/$def/xyz");
}
-}
-}
+} // namespace utils
+} // namespace selftests
void _initialize_utils_selftests ();
+
void
_initialize_utils_selftests ()
{