diff options
32 files changed, 79 insertions, 149 deletions
diff --git a/cmds/idmap2/idmap2/Main.cpp b/cmds/idmap2/idmap2/Main.cpp index 4012555235a8..445fac52f997 100644 --- a/cmds/idmap2/idmap2/Main.cpp +++ b/cmds/idmap2/idmap2/Main.cpp @@ -29,8 +29,8 @@ using android::idmap2::CommandLineOptions; -typedef std::map<std::string, std::function<bool(const std::vector<std::string>&, std::ostream&)>> - NameToFunctionMap; +using NameToFunctionMap = + std::map<std::string, std::function<bool(const std::vector<std::string>&, std::ostream&)>>; namespace { diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp index ef560d1ee710..49187475ccdb 100644 --- a/cmds/idmap2/idmap2/Scan.cpp +++ b/cmds/idmap2/idmap2/Scan.cpp @@ -56,8 +56,7 @@ std::unique_ptr<std::vector<std::string>> FindApkFiles(const std::vector<std::st } paths.insert(apk_paths->cbegin(), apk_paths->cend()); } - return std::unique_ptr<std::vector<std::string>>( - new std::vector<std::string>(paths.cbegin(), paths.cend())); + return std::make_unique<std::vector<std::string>>(paths.cbegin(), paths.cend()); } } // namespace @@ -138,15 +137,15 @@ bool Scan(const std::vector<std::string>& args, std::ostream& out_error) { } std::stringstream stream; - for (auto iter = interesting_apks.cbegin(); iter != interesting_apks.cend(); ++iter) { - const std::string idmap_path = Idmap::CanonicalIdmapPathFor(output_directory, *iter); + for (const auto& apk : interesting_apks) { + const std::string idmap_path = Idmap::CanonicalIdmapPathFor(output_directory, apk); std::stringstream dev_null; if (!Verify(std::vector<std::string>({"--idmap-path", idmap_path}), dev_null) && !Create(std::vector<std::string>({ "--target-apk-path", target_apk_path, "--overlay-apk-path", - *iter, + apk, "--idmap-path", idmap_path, }), diff --git a/cmds/idmap2/idmap2d/Idmap2Service.cpp b/cmds/idmap2/idmap2d/Idmap2Service.cpp index 7b16093434fb..d2e46e15fc59 100644 --- a/cmds/idmap2/idmap2d/Idmap2Service.cpp +++ b/cmds/idmap2/idmap2d/Idmap2Service.cpp @@ -56,8 +56,7 @@ Status error(const std::string& msg) { } // namespace -namespace android { -namespace os { +namespace android::os { Status Idmap2Service::getIdmapPath(const std::string& overlay_apk_path, int32_t user_id ATTRIBUTE_UNUSED, std::string* _aidl_return) { @@ -132,9 +131,8 @@ Status Idmap2Service::createIdmap(const std::string& target_apk_path, return error("failed to write to idmap path " + idmap_path); } - _aidl_return->reset(new std::string(idmap_path)); + *_aidl_return = std::make_unique<std::string>(idmap_path); return ok(); } -} // namespace os -} // namespace android +} // namespace android::os diff --git a/cmds/idmap2/idmap2d/Idmap2Service.h b/cmds/idmap2/idmap2d/Idmap2Service.h index 4e5abc9069f4..e0bc22e9e9e6 100644 --- a/cmds/idmap2/idmap2d/Idmap2Service.h +++ b/cmds/idmap2/idmap2d/Idmap2Service.h @@ -25,8 +25,8 @@ #include "android/os/BnIdmap2.h" -namespace android { -namespace os { +namespace android::os { + class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 { public: static char const* getServiceName() { @@ -46,7 +46,7 @@ class Idmap2Service : public BinderService<Idmap2Service>, public BnIdmap2 { const std::string& overlay_apk_path, int32_t user_id, std::unique_ptr<std::string>* _aidl_return); }; -} // namespace os -} // namespace android + +} // namespace android::os #endif // IDMAP2_IDMAP2D_IDMAP2SERVICE_H_ diff --git a/cmds/idmap2/include/idmap2/BinaryStreamVisitor.h b/cmds/idmap2/include/idmap2/BinaryStreamVisitor.h index 2368aeadbc9f..2c3e9d321881 100644 --- a/cmds/idmap2/include/idmap2/BinaryStreamVisitor.h +++ b/cmds/idmap2/include/idmap2/BinaryStreamVisitor.h @@ -23,8 +23,7 @@ #include "idmap2/Idmap.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { class BinaryStreamVisitor : public Visitor { public: @@ -43,7 +42,6 @@ class BinaryStreamVisitor : public Visitor { std::ostream& stream_; }; -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 #endif // IDMAP2_INCLUDE_IDMAP2_BINARYSTREAMVISITOR_H_ diff --git a/cmds/idmap2/include/idmap2/CommandLineOptions.h b/cmds/idmap2/include/idmap2/CommandLineOptions.h index f3aa68b8d1a2..b93e71631d08 100644 --- a/cmds/idmap2/include/idmap2/CommandLineOptions.h +++ b/cmds/idmap2/include/idmap2/CommandLineOptions.h @@ -23,8 +23,7 @@ #include <string> #include <vector> -namespace android { -namespace idmap2 { +namespace android::idmap2 { /* * Utility class to convert a command line, including options (--path foo.txt), @@ -65,7 +64,6 @@ class CommandLineOptions { std::string name_; }; -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 #endif // IDMAP2_INCLUDE_IDMAP2_COMMANDLINEOPTIONS_H_ diff --git a/cmds/idmap2/include/idmap2/FileUtils.h b/cmds/idmap2/include/idmap2/FileUtils.h index 84cc69a95ac5..5c41c49906cd 100644 --- a/cmds/idmap2/include/idmap2/FileUtils.h +++ b/cmds/idmap2/include/idmap2/FileUtils.h @@ -22,9 +22,7 @@ #include <string> #include <vector> -namespace android { -namespace idmap2 { -namespace utils { +namespace android::idmap2::utils { constexpr const mode_t kIdmapFilePermissionMask = 0133; // u=rw,g=r,o=r @@ -37,8 +35,6 @@ std::unique_ptr<std::string> ReadFile(int fd); std::unique_ptr<std::string> ReadFile(const std::string& path); -} // namespace utils -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2::utils #endif // IDMAP2_INCLUDE_IDMAP2_FILEUTILS_H_ diff --git a/cmds/idmap2/include/idmap2/Idmap.h b/cmds/idmap2/include/idmap2/Idmap.h index 837b7c5264d5..b989e4c3f9d1 100644 --- a/cmds/idmap2/include/idmap2/Idmap.h +++ b/cmds/idmap2/include/idmap2/Idmap.h @@ -57,8 +57,7 @@ #include "androidfw/ResourceTypes.h" #include "androidfw/StringPiece.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { class Idmap; class Visitor; @@ -271,7 +270,6 @@ class Visitor { virtual void visit(const IdmapData::TypeEntry& type_entry) = 0; }; -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 #endif // IDMAP2_INCLUDE_IDMAP2_IDMAP_H_ diff --git a/cmds/idmap2/include/idmap2/ResourceUtils.h b/cmds/idmap2/include/idmap2/ResourceUtils.h index d106f19af998..323796b05986 100644 --- a/cmds/idmap2/include/idmap2/ResourceUtils.h +++ b/cmds/idmap2/include/idmap2/ResourceUtils.h @@ -25,14 +25,10 @@ #include "idmap2/Idmap.h" #include "idmap2/Result.h" -namespace android { -namespace idmap2 { -namespace utils { +namespace android::idmap2::utils { Result<std::string> WARN_UNUSED ResToTypeEntryName(const AssetManager2& am, ResourceId resid); -} // namespace utils -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2::utils #endif // IDMAP2_INCLUDE_IDMAP2_RESOURCEUTILS_H_ diff --git a/cmds/idmap2/include/idmap2/Xml.h b/cmds/idmap2/include/idmap2/Xml.h index 9ab5ec454750..dd89dee0f64f 100644 --- a/cmds/idmap2/include/idmap2/Xml.h +++ b/cmds/idmap2/include/idmap2/Xml.h @@ -25,8 +25,7 @@ #include "androidfw/ResourceTypes.h" #include "utils/String16.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { class Xml { public: @@ -45,7 +44,6 @@ class Xml { DISALLOW_COPY_AND_ASSIGN(Xml); }; -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 #endif // IDMAP2_INCLUDE_IDMAP2_XML_H_ diff --git a/cmds/idmap2/include/idmap2/ZipFile.h b/cmds/idmap2/include/idmap2/ZipFile.h index 9edbbe0cce90..8f50e36256f6 100644 --- a/cmds/idmap2/include/idmap2/ZipFile.h +++ b/cmds/idmap2/include/idmap2/ZipFile.h @@ -21,11 +21,10 @@ #include <string> #include "android-base/macros.h" -#include "ziparchive/zip_archive.h" #include "idmap2/Result.h" +#include "ziparchive/zip_archive.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { struct MemoryChunk { size_t size; @@ -56,7 +55,6 @@ class ZipFile { DISALLOW_COPY_AND_ASSIGN(ZipFile); }; -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 #endif // IDMAP2_INCLUDE_IDMAP2_ZIPFILE_H_ diff --git a/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp b/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp index b7765bc3d836..96513283ac51 100644 --- a/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp +++ b/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp @@ -22,8 +22,7 @@ #include "idmap2/BinaryStreamVisitor.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { void BinaryStreamVisitor::Write16(uint16_t value) { uint16_t x = htodl(value); @@ -77,5 +76,4 @@ void BinaryStreamVisitor::visit(const IdmapData::TypeEntry& type_entry) { } } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/libidmap2/CommandLineOptions.cpp b/cmds/idmap2/libidmap2/CommandLineOptions.cpp index 28c3797226e1..cabc8f398c46 100644 --- a/cmds/idmap2/libidmap2/CommandLineOptions.cpp +++ b/cmds/idmap2/libidmap2/CommandLineOptions.cpp @@ -26,13 +26,11 @@ #include "idmap2/CommandLineOptions.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { std::unique_ptr<std::vector<std::string>> CommandLineOptions::ConvertArgvToVector( int argc, const char** argv) { - return std::unique_ptr<std::vector<std::string>>( - new std::vector<std::string>(argv + 1, argv + argc)); + return std::make_unique<std::vector<std::string>>(argv + 1, argv + argc); } CommandLineOptions& CommandLineOptions::OptionalFlag(const std::string& name, @@ -111,8 +109,8 @@ bool CommandLineOptions::Parse(const std::vector<std::string>& argv, std::ostrea } if (!mandatory_opts.empty()) { - for (auto iter = mandatory_opts.cbegin(); iter != mandatory_opts.cend(); ++iter) { - outError << "error: " << *iter << ": missing mandatory option" << std::endl; + for (const auto& opt : mandatory_opts) { + outError << "error: " << opt << ": missing mandatory option" << std::endl; } Usage(outError); return false; @@ -159,5 +157,4 @@ void CommandLineOptions::Usage(std::ostream& out) const { } } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/libidmap2/FileUtils.cpp b/cmds/idmap2/libidmap2/FileUtils.cpp index 88d40d1f523d..0255727fc8c6 100644 --- a/cmds/idmap2/libidmap2/FileUtils.cpp +++ b/cmds/idmap2/libidmap2/FileUtils.cpp @@ -15,10 +15,10 @@ */ #include <dirent.h> -#include <errno.h> #include <sys/types.h> #include <unistd.h> +#include <cerrno> #include <fstream> #include <memory> #include <string> @@ -27,9 +27,7 @@ #include "idmap2/FileUtils.h" -namespace android { -namespace idmap2 { -namespace utils { +namespace android::idmap2::utils { std::unique_ptr<std::vector<std::string>> FindFiles(const std::string& root, bool recurse, const FindFilesPredicate& predicate) { @@ -79,6 +77,4 @@ std::unique_ptr<std::string> ReadFile(int fd) { return r == 0 ? std::move(str) : nullptr; } -} // namespace utils -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2::utils diff --git a/cmds/idmap2/libidmap2/Idmap.cpp b/cmds/idmap2/libidmap2/Idmap.cpp index 5822745a95c3..37d6af8fa477 100644 --- a/cmds/idmap2/libidmap2/Idmap.cpp +++ b/cmds/idmap2/libidmap2/Idmap.cpp @@ -36,8 +36,7 @@ #include "idmap2/Result.h" #include "idmap2/ZipFile.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { namespace { @@ -450,5 +449,4 @@ void Idmap::accept(Visitor* v) const { } } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp b/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp index b36df24a0da7..fc9677994fc0 100644 --- a/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp +++ b/cmds/idmap2/libidmap2/PrettyPrintVisitor.cpp @@ -24,8 +24,7 @@ #include "idmap2/ResourceUtils.h" #include "idmap2/Result.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { #define RESID(pkg, type, entry) (((pkg) << 24) | ((type) << 16) | (entry)) @@ -73,5 +72,4 @@ void PrettyPrintVisitor::visit(const IdmapData::TypeEntry& type_entry) { } } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp index a6bf5fb6e687..ec2decf782e2 100644 --- a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp +++ b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp @@ -27,8 +27,7 @@ using android::ApkAssets; -namespace android { -namespace idmap2 { +namespace android::idmap2 { // verbatim copy fomr PrettyPrintVisitor.cpp, move to common utils #define RESID(pkg, type, entry) (((pkg) << 24) | ((type) << 16) | (entry)) @@ -127,5 +126,4 @@ void RawPrintVisitor::print(const std::string& value, const char* fmt, ...) { offset_ += kIdmapStringLength; } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/libidmap2/ResourceUtils.cpp b/cmds/idmap2/libidmap2/ResourceUtils.cpp index 5c897832e9d5..04e0ec756045 100644 --- a/cmds/idmap2/libidmap2/ResourceUtils.cpp +++ b/cmds/idmap2/libidmap2/ResourceUtils.cpp @@ -25,9 +25,7 @@ using android::StringPiece16; using android::util::Utf16ToUtf8; -namespace android { -namespace idmap2 { -namespace utils { +namespace android::idmap2::utils { Result<std::string> WARN_UNUSED ResToTypeEntryName(const AssetManager2& am, ResourceId resid) { AssetManager2::ResourceName name; @@ -49,6 +47,4 @@ Result<std::string> WARN_UNUSED ResToTypeEntryName(const AssetManager2& am, Reso return {out}; } -} // namespace utils -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2::utils diff --git a/cmds/idmap2/libidmap2/Xml.cpp b/cmds/idmap2/libidmap2/Xml.cpp index 5543722ce4fe..0075a922d676 100644 --- a/cmds/idmap2/libidmap2/Xml.cpp +++ b/cmds/idmap2/libidmap2/Xml.cpp @@ -21,8 +21,7 @@ #include "idmap2/Xml.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { std::unique_ptr<const Xml> Xml::Create(const uint8_t* data, size_t size, bool copyData) { std::unique_ptr<Xml> xml(new Xml()); @@ -78,5 +77,4 @@ Xml::~Xml() { xml_.uninit(); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/libidmap2/ZipFile.cpp b/cmds/idmap2/libidmap2/ZipFile.cpp index 9fb611dd8e8d..15ec3f9d3afe 100644 --- a/cmds/idmap2/libidmap2/ZipFile.cpp +++ b/cmds/idmap2/libidmap2/ZipFile.cpp @@ -20,8 +20,7 @@ #include "idmap2/Result.h" #include "idmap2/ZipFile.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { std::unique_ptr<MemoryChunk> MemoryChunk::Allocate(size_t size) { void* ptr = ::operator new(sizeof(MemoryChunk) + size); @@ -63,5 +62,4 @@ Result<uint32_t> ZipFile::Crc(const std::string& entryPath) const { return status == 0 ? Result<uint32_t>(entry.crc32) : kResultError; } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp b/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp index 3b9dbe97e894..2698ac0a734d 100644 --- a/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp +++ b/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp @@ -31,8 +31,7 @@ using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(BinaryStreamVisitorTests, CreateBinaryStreamViaBinaryStreamVisitor) { std::string raw(reinterpret_cast<const char*>(idmap_raw_data), idmap_raw_data_len); @@ -124,5 +123,4 @@ TEST(BinaryStreamVisitorTests, CreateIdmapFromApkAssetsInteropWithLoadedIdmap) { ASSERT_FALSE(success); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/CommandLineOptionsTests.cpp b/cmds/idmap2/tests/CommandLineOptionsTests.cpp index 243d23a0f2db..c27d27a16b94 100644 --- a/cmds/idmap2/tests/CommandLineOptionsTests.cpp +++ b/cmds/idmap2/tests/CommandLineOptionsTests.cpp @@ -38,8 +38,7 @@ #include "TestHelpers.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(CommandLineOptionsTests, Flag) { bool foo = true; @@ -193,5 +192,4 @@ TEST(CommandLineOptionsTests, Usage) { std::string::npos); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/FileUtilsTests.cpp b/cmds/idmap2/tests/FileUtilsTests.cpp index 6584ee32a509..4bf832a34691 100644 --- a/cmds/idmap2/tests/FileUtilsTests.cpp +++ b/cmds/idmap2/tests/FileUtilsTests.cpp @@ -29,9 +29,7 @@ using ::testing::NotNull; -namespace android { -namespace idmap2 { -namespace utils { +namespace android::idmap2::utils { TEST(FileUtilsTests, FindFilesFindEverythingNonRecursive) { const auto& root = GetTestDataPath(); @@ -71,6 +69,4 @@ TEST(FileUtilsTests, ReadFile) { close(pipefd[0]); } -} // namespace utils -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2::utils diff --git a/cmds/idmap2/tests/Idmap2BinaryTests.cpp b/cmds/idmap2/tests/Idmap2BinaryTests.cpp index 255f3c102b85..22f48e9a396f 100644 --- a/cmds/idmap2/tests/Idmap2BinaryTests.cpp +++ b/cmds/idmap2/tests/Idmap2BinaryTests.cpp @@ -46,8 +46,7 @@ using ::android::util::ExecuteBinary; using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { class Idmap2BinaryTests : public Idmap2Tests {}; @@ -313,5 +312,4 @@ TEST_F(Idmap2BinaryTests, InvalidCommandLineOptions) { ASSERT_NE(result->status, EXIT_SUCCESS); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/IdmapTests.cpp b/cmds/idmap2/tests/IdmapTests.cpp index dc80e0e145ac..963f22ec8d72 100644 --- a/cmds/idmap2/tests/IdmapTests.cpp +++ b/cmds/idmap2/tests/IdmapTests.cpp @@ -37,8 +37,7 @@ using ::testing::IsNull; using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(IdmapTests, TestCanonicalIdmapPathFor) { ASSERT_EQ(Idmap::CanonicalIdmapPathFor("/foo", "/vendor/overlay/bar.apk"), @@ -346,23 +345,23 @@ class TestVisitor : public Visitor { explicit TestVisitor(std::ostream& stream) : stream_(stream) { } - void visit(const Idmap& idmap ATTRIBUTE_UNUSED) { + void visit(const Idmap& idmap ATTRIBUTE_UNUSED) override { stream_ << "TestVisitor::visit(Idmap)" << std::endl; } - void visit(const IdmapHeader& idmap ATTRIBUTE_UNUSED) { + void visit(const IdmapHeader& idmap ATTRIBUTE_UNUSED) override { stream_ << "TestVisitor::visit(IdmapHeader)" << std::endl; } - void visit(const IdmapData& idmap ATTRIBUTE_UNUSED) { + void visit(const IdmapData& idmap ATTRIBUTE_UNUSED) override { stream_ << "TestVisitor::visit(IdmapData)" << std::endl; } - void visit(const IdmapData::Header& idmap ATTRIBUTE_UNUSED) { + void visit(const IdmapData::Header& idmap ATTRIBUTE_UNUSED) override { stream_ << "TestVisitor::visit(IdmapData::Header)" << std::endl; } - void visit(const IdmapData::TypeEntry& idmap ATTRIBUTE_UNUSED) { + void visit(const IdmapData::TypeEntry& idmap ATTRIBUTE_UNUSED) override { stream_ << "TestVisitor::visit(IdmapData::TypeEntry)" << std::endl; } @@ -391,5 +390,4 @@ TEST(IdmapTests, TestVisitor) { "TestVisitor::visit(IdmapData::TypeEntry)\n"); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/Main.cpp b/cmds/idmap2/tests/Main.cpp index 0f683ffd8eef..2b13fed8d60d 100644 --- a/cmds/idmap2/tests/Main.cpp +++ b/cmds/idmap2/tests/Main.cpp @@ -22,15 +22,13 @@ #include "TestHelpers.h" -namespace android { -namespace idmap2 { +namespace android::idmap2 { std::string GetTestDataPath() { return base::GetExecutableDirectory() + "/tests/data"; } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); diff --git a/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp b/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp index 0c4f493e9f6c..7736bc063131 100644 --- a/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp +++ b/cmds/idmap2/tests/PrettyPrintVisitorTests.cpp @@ -33,8 +33,7 @@ using ::testing::NotNull; using android::ApkAssets; -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(PrettyPrintVisitorTests, CreatePrettyPrintVisitor) { const std::string target_apk_path(GetTestDataPath() + "/target/target.apk"); @@ -78,5 +77,4 @@ TEST(PrettyPrintVisitorTests, CreatePrettyPrintVisitorWithoutAccessToApks) { ASSERT_NE(stream.str().find("0x7f020000 -> 0x7f020000\n"), std::string::npos); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/RawPrintVisitorTests.cpp b/cmds/idmap2/tests/RawPrintVisitorTests.cpp index 6285f217b21e..0318cd20a9bb 100644 --- a/cmds/idmap2/tests/RawPrintVisitorTests.cpp +++ b/cmds/idmap2/tests/RawPrintVisitorTests.cpp @@ -29,8 +29,7 @@ using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(RawPrintVisitorTests, CreateRawPrintVisitor) { const std::string target_apk_path(GetTestDataPath() + "/target/target.apk"); @@ -79,5 +78,4 @@ TEST(RawPrintVisitorTests, CreateRawPrintVisitorWithoutAccessToApks) { ASSERT_NE(stream.str().find("0000021c: 00000000 0x7f020000 -> 0x7f020000\n"), std::string::npos); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/ResourceUtilsTests.cpp b/cmds/idmap2/tests/ResourceUtilsTests.cpp index c8578d3b340a..ad78685646b4 100644 --- a/cmds/idmap2/tests/ResourceUtilsTests.cpp +++ b/cmds/idmap2/tests/ResourceUtilsTests.cpp @@ -28,8 +28,7 @@ using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { class ResourceUtilsTests : public Idmap2Tests { protected: @@ -62,5 +61,4 @@ TEST_F(ResourceUtilsTests, ResToTypeEntryNameNoSuchResourceId) { ASSERT_FALSE(name); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/TestHelpers.h b/cmds/idmap2/tests/TestHelpers.h index 356db7af1385..45525a5b7657 100644 --- a/cmds/idmap2/tests/TestHelpers.h +++ b/cmds/idmap2/tests/TestHelpers.h @@ -19,8 +19,7 @@ #include <string> -namespace android { -namespace idmap2 { +namespace android::idmap2 { const unsigned char idmap_raw_data[] = { // IDMAP HEADER @@ -162,7 +161,6 @@ class Idmap2Tests : public testing::Test { std::string idmap_path_; }; -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 #endif // IDMAP2_TESTS_TESTHELPERS_H_ diff --git a/cmds/idmap2/tests/XmlTests.cpp b/cmds/idmap2/tests/XmlTests.cpp index 40758b42e1ff..fe79d8f2c5a9 100644 --- a/cmds/idmap2/tests/XmlTests.cpp +++ b/cmds/idmap2/tests/XmlTests.cpp @@ -27,8 +27,7 @@ using ::testing::IsNull; using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(XmlTests, Create) { auto zip = ZipFile::Open(GetTestDataPath() + "/target/target.apk"); @@ -68,5 +67,4 @@ TEST(XmlTests, FindTag) { ASSERT_THAT(fail, IsNull()); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 diff --git a/cmds/idmap2/tests/ZipFileTests.cpp b/cmds/idmap2/tests/ZipFileTests.cpp index 6e4a501a51ac..79be43ce0e42 100644 --- a/cmds/idmap2/tests/ZipFileTests.cpp +++ b/cmds/idmap2/tests/ZipFileTests.cpp @@ -28,8 +28,7 @@ using ::testing::IsNull; using ::testing::NotNull; -namespace android { -namespace idmap2 { +namespace android::idmap2 { TEST(ZipFileTests, BasicOpen) { auto zip = ZipFile::Open(GetTestDataPath() + "/target/target.apk"); @@ -66,5 +65,4 @@ TEST(ZipFileTests, Uncompress) { ASSERT_THAT(fail, IsNull()); } -} // namespace idmap2 -} // namespace android +} // namespace android::idmap2 |