Loading cmds/dumpsys/dumpsys.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -230,7 +230,7 @@ int Dumpsys::main(int argc, char* const argv[]) { } } const size_t N = services.size(); const size_t N = services.size(); if (N > 1) { if (N > 1 || showListOnly) { // first print a list of the current services // first print a list of the current services std::cout << "Currently running services:" << std::endl; std::cout << "Currently running services:" << std::endl; Loading cmds/dumpsys/tests/dumpsys_test.cpp +16 −4 Original line number Original line Diff line number Diff line Loading @@ -206,10 +206,7 @@ class DumpsysTest : public Test { } } void AssertRunningServices(const std::vector<std::string>& services) { void AssertRunningServices(const std::vector<std::string>& services) { std::string expected; std::string expected = "Currently running services:\n"; if (services.size() > 1) { expected.append("Currently running services:\n"); } for (const std::string& service : services) { for (const std::string& service : services) { expected.append(" ").append(service).append("\n"); expected.append(" ").append(service).append("\n"); } } Loading Loading @@ -263,6 +260,21 @@ TEST_F(DumpsysTest, ListAllServices) { AssertRunningServices({"Locksmith", "Valet"}); AssertRunningServices({"Locksmith", "Valet"}); } } TEST_F(DumpsysTest, ListServicesOneRegistered) { ExpectListServices({"Locksmith"}); ExpectCheckService("Locksmith"); CallMain({"-l"}); AssertRunningServices({"Locksmith"}); } TEST_F(DumpsysTest, ListServicesEmpty) { CallMain({"-l"}); AssertRunningServices({}); } // Tests 'dumpsys -l' when a service is not running // Tests 'dumpsys -l' when a service is not running TEST_F(DumpsysTest, ListRunningServices) { TEST_F(DumpsysTest, ListRunningServices) { ExpectListServices({"Locksmith", "Valet"}); ExpectListServices({"Locksmith", "Valet"}); Loading Loading
cmds/dumpsys/dumpsys.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -230,7 +230,7 @@ int Dumpsys::main(int argc, char* const argv[]) { } } const size_t N = services.size(); const size_t N = services.size(); if (N > 1) { if (N > 1 || showListOnly) { // first print a list of the current services // first print a list of the current services std::cout << "Currently running services:" << std::endl; std::cout << "Currently running services:" << std::endl; Loading
cmds/dumpsys/tests/dumpsys_test.cpp +16 −4 Original line number Original line Diff line number Diff line Loading @@ -206,10 +206,7 @@ class DumpsysTest : public Test { } } void AssertRunningServices(const std::vector<std::string>& services) { void AssertRunningServices(const std::vector<std::string>& services) { std::string expected; std::string expected = "Currently running services:\n"; if (services.size() > 1) { expected.append("Currently running services:\n"); } for (const std::string& service : services) { for (const std::string& service : services) { expected.append(" ").append(service).append("\n"); expected.append(" ").append(service).append("\n"); } } Loading Loading @@ -263,6 +260,21 @@ TEST_F(DumpsysTest, ListAllServices) { AssertRunningServices({"Locksmith", "Valet"}); AssertRunningServices({"Locksmith", "Valet"}); } } TEST_F(DumpsysTest, ListServicesOneRegistered) { ExpectListServices({"Locksmith"}); ExpectCheckService("Locksmith"); CallMain({"-l"}); AssertRunningServices({"Locksmith"}); } TEST_F(DumpsysTest, ListServicesEmpty) { CallMain({"-l"}); AssertRunningServices({}); } // Tests 'dumpsys -l' when a service is not running // Tests 'dumpsys -l' when a service is not running TEST_F(DumpsysTest, ListRunningServices) { TEST_F(DumpsysTest, ListRunningServices) { ExpectListServices({"Locksmith", "Valet"}); ExpectListServices({"Locksmith", "Valet"}); Loading