Nest all namespaces
The compiler supports this now. We can type less going forward.
No functional changes.
Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/aos/testing/gtest_main.cc b/aos/testing/gtest_main.cc
index 2fb77fe..6071bde 100644
--- a/aos/testing/gtest_main.cc
+++ b/aos/testing/gtest_main.cc
@@ -14,16 +14,13 @@
DEFINE_string(log_file, "",
"Print all log messages to FILE instead of standard output.");
-namespace aos {
-
-namespace testing {
+namespace aos::testing {
// Actually declared/defined in //aos/testing:test_logging.
void SetLogFileName(const char *filename) __attribute__((weak));
void ForcePrintLogsDuringTests() __attribute__((weak));
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
GTEST_API_ int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
diff --git a/aos/testing/path.cc b/aos/testing/path.cc
index f63fd97..cb17c73 100644
--- a/aos/testing/path.cc
+++ b/aos/testing/path.cc
@@ -2,8 +2,7 @@
#include "absl/strings/str_cat.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Returns the path to the provided artifact which works when built both as an
// external target and in the repo.
@@ -13,5 +12,4 @@
return absl::StrCat("../org_frc971/", path);
}
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
diff --git a/aos/testing/prevent_exit.cc b/aos/testing/prevent_exit.cc
index b640fe7..7c8da60 100644
--- a/aos/testing/prevent_exit.cc
+++ b/aos/testing/prevent_exit.cc
@@ -6,8 +6,7 @@
#include "glog/logging.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
namespace {
void TerminateExitHandler() { _exit(EXIT_SUCCESS); }
@@ -16,5 +15,4 @@
void PreventExit() { CHECK_EQ(atexit(TerminateExitHandler), 0); }
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
diff --git a/aos/testing/prevent_exit.h b/aos/testing/prevent_exit.h
index ee39fdb..75e8a1a 100644
--- a/aos/testing/prevent_exit.h
+++ b/aos/testing/prevent_exit.h
@@ -1,8 +1,7 @@
#ifndef AOS_TESTING_PREVENT_EXIT_H_
#define AOS_TESTING_PREVENT_EXIT_H_
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Registers an exit handler (using atexit(3)) which will call _exit(2).
// Intended to be called in a freshly fork(2)ed process where it will run before
@@ -10,7 +9,6 @@
// being run.
void PreventExit();
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_PREVENT_EXIT_H_
diff --git a/aos/testing/random_seed.cc b/aos/testing/random_seed.cc
index 8f26d07..302612e 100644
--- a/aos/testing/random_seed.cc
+++ b/aos/testing/random_seed.cc
@@ -2,8 +2,7 @@
#include <cstdlib>
-namespace aos {
-namespace testing {
+namespace aos::testing {
int RandomSeed() {
const char *from_environment = getenv("TEST_RANDOM_SEED");
@@ -13,5 +12,4 @@
return 1;
}
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
diff --git a/aos/testing/random_seed.h b/aos/testing/random_seed.h
index 825e7b1..11bfe99 100644
--- a/aos/testing/random_seed.h
+++ b/aos/testing/random_seed.h
@@ -1,15 +1,13 @@
#ifndef AOS_TESTING_RANDOM_SEED_H_
#define AOS_TESTING_RANDOM_SEED_H_
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Returns the random seed to use for testing.
//
// This is ${TEST_RANDOM_SEED} if it is set or 1.
int RandomSeed();
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_RANDOM_SEED_H_
diff --git a/aos/testing/test_logging.cc b/aos/testing/test_logging.cc
index a2042e2..56875bb 100644
--- a/aos/testing/test_logging.cc
+++ b/aos/testing/test_logging.cc
@@ -11,8 +11,7 @@
using ::aos::logging::LogMessage;
-namespace aos {
-namespace testing {
+namespace aos::testing {
namespace {
class TestLogImplementation : public logging::HandleMessageLogImplementation {
@@ -138,5 +137,4 @@
TestLogImplementation::GetInstance()->PrintMessagesAsTheyComeIn();
}
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
diff --git a/aos/testing/test_logging_test.cc b/aos/testing/test_logging_test.cc
index f39c6cf..5731545 100644
--- a/aos/testing/test_logging_test.cc
+++ b/aos/testing/test_logging_test.cc
@@ -6,8 +6,7 @@
#include "aos/logging/logging.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Tests logging from multiple threads.
// tsan used to complain about this.
@@ -25,5 +24,4 @@
thread.join();
}
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
diff --git a/aos/testing/test_shm.cc b/aos/testing/test_shm.cc
index 8dc189a..1b168ea 100644
--- a/aos/testing/test_shm.cc
+++ b/aos/testing/test_shm.cc
@@ -7,8 +7,7 @@
#include "aos/logging/logging.h"
#include "aos/testing/test_logging.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
namespace {
const size_t kCoreSize = 0x100000;
@@ -35,5 +34,4 @@
global_core = NULL;
}
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
diff --git a/aos/testing/tmpdir.cc b/aos/testing/tmpdir.cc
index 7287603..0953a21 100644
--- a/aos/testing/tmpdir.cc
+++ b/aos/testing/tmpdir.cc
@@ -5,8 +5,7 @@
#include "aos/ipc_lib/shm_base.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
namespace {
std::string TestTmpDirOr(std::string fallback) {
@@ -22,5 +21,4 @@
void SetTestShmBase() { SetShmBase(TestTmpDirOr(FLAGS_shm_base)); }
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing