Convert system/core to Result::ok()
No functionality changes, this is a mechanical cleanup.
Test: m
Test: cd system/core && atest
Change-Id: Ifdaa3ce1947ed578f656d5a446978726eb416c36
diff --git a/init/service_test.cpp b/init/service_test.cpp
index c158b0a..22ee844 100644
--- a/init/service_test.cpp
+++ b/init/service_test.cpp
@@ -76,15 +76,15 @@
TEST(service, make_temporary_oneshot_service_invalid_syntax) {
std::vector<std::string> args;
// Nothing.
- ASSERT_FALSE(Service::MakeTemporaryOneshotService(args));
+ ASSERT_FALSE(Service::MakeTemporaryOneshotService(args).ok());
// No arguments to 'exec'.
args.push_back("exec");
- ASSERT_FALSE(Service::MakeTemporaryOneshotService(args));
+ ASSERT_FALSE(Service::MakeTemporaryOneshotService(args).ok());
// No command in "exec --".
args.push_back("--");
- ASSERT_FALSE(Service::MakeTemporaryOneshotService(args));
+ ASSERT_FALSE(Service::MakeTemporaryOneshotService(args).ok());
}
TEST(service, make_temporary_oneshot_service_too_many_supplementary_gids) {
@@ -98,7 +98,7 @@
}
args.push_back("--");
args.push_back("/system/bin/id");
- ASSERT_FALSE(Service::MakeTemporaryOneshotService(args));
+ ASSERT_FALSE(Service::MakeTemporaryOneshotService(args).ok());
}
static void Test_make_temporary_oneshot_service(bool dash_dash, bool seclabel, bool uid, bool gid,
@@ -124,7 +124,7 @@
args.push_back("/system/bin/toybox");
args.push_back("id");
auto service_ret = Service::MakeTemporaryOneshotService(args);
- ASSERT_TRUE(service_ret);
+ ASSERT_RESULT_OK(service_ret);
auto svc = std::move(*service_ret);
if (seclabel) {
@@ -134,14 +134,14 @@
}
if (uid) {
auto decoded_uid = DecodeUid("log");
- ASSERT_TRUE(decoded_uid);
+ ASSERT_RESULT_OK(decoded_uid);
ASSERT_EQ(*decoded_uid, svc->uid());
} else {
ASSERT_EQ(0U, svc->uid());
}
if (gid) {
auto decoded_uid = DecodeUid("shell");
- ASSERT_TRUE(decoded_uid);
+ ASSERT_RESULT_OK(decoded_uid);
ASSERT_EQ(*decoded_uid, svc->gid());
} else {
ASSERT_EQ(0U, svc->gid());
@@ -150,11 +150,11 @@
ASSERT_EQ(2U, svc->supp_gids().size());
auto decoded_uid = DecodeUid("system");
- ASSERT_TRUE(decoded_uid);
+ ASSERT_RESULT_OK(decoded_uid);
ASSERT_EQ(*decoded_uid, svc->supp_gids()[0]);
decoded_uid = DecodeUid("adb");
- ASSERT_TRUE(decoded_uid);
+ ASSERT_RESULT_OK(decoded_uid);
ASSERT_EQ(*decoded_uid, svc->supp_gids()[1]);
} else {
ASSERT_EQ(0U, svc->supp_gids().size());