Skip to content

Commit 634b718

Browse files
committed
Move host tests to anonymous namespace
Bug: b/503100488
1 parent 4c78587 commit 634b718

36 files changed

Lines changed: 78 additions & 11 deletions

base/cvd/cuttlefish/host/commands/assemble_cvd/unittest/utils_tests.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "launch_cvd.pb.h"
2323

2424
namespace cuttlefish {
25+
namespace {
2526

2627
TEST(DisplayConfigTest, ParseProto) {
2728
std::string flag_value = "ChoKCgi4CBDYBBh4IDwKDAi4CBDYBBh4IDwqAA==";
@@ -42,4 +43,5 @@ TEST(DisplayConfigTest, ParseProto) {
4243
ASSERT_TRUE(result);
4344
}
4445

46+
} // namespace
4547
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/frontline_parser_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "cuttlefish/result/result_matchers.h"
2222

2323
namespace cuttlefish {
24+
namespace {
2425

2526
TEST(FrontlineParserTest, SelectorArgs) {
2627
cvd_common::Args input{"cvd", "--instance_name=1", "status"};
@@ -32,4 +33,5 @@ TEST(FrontlineParserTest, SelectorArgs) {
3233
ASSERT_EQ(input, (std::vector<std::string>{"cvd", "status"}));
3334
}
3435

36+
} // namespace
3537
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/configs_inheritance_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "cuttlefish/host/commands/cvd/cli/parser/test_common.h"
2424

2525
namespace cuttlefish {
26+
namespace {
2627

2728
TEST(FlagsInheritanceTest, MergeTwoIndependentJson) {
2829
const char* dst_string = R""""(
@@ -140,4 +141,5 @@ TEST(FlagsInheritanceTest, MergeTwoOverlappedJson) {
140141
EXPECT_EQ(dst_object["instances"][0]["vm"]["memory_mb"], 2048);
141142
}
142143

144+
} // namespace
143145
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/flags_parser_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "cuttlefish/host/commands/cvd/cli/parser/test_common.h"
2323

2424
namespace cuttlefish {
25+
namespace {
2526

2627
TEST(FlagsParserTest, ParseInvalidJson) {
2728
const char* test_string = R""""(
@@ -170,4 +171,5 @@ TEST(BootFlagsParserTest, ParseNetSimFlagEnabled) {
170171
<< "netsim_uwb flag is missing or wrongly formatted";
171172
}
172173

174+
} // namespace
173175
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/boot_configs_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "cuttlefish/host/commands/cvd/cli/parser/test_common.h"
2222

2323
namespace cuttlefish {
24+
namespace {
2425

2526
TEST(BootFlagsParserTest, ParseTwoInstancesBootAnimationFlagEmptyJson) {
2627
const char* test_string = R""""(
@@ -352,4 +353,5 @@ TEST(BootFlagsParserTest, ParseTwoInstancesEnforceSecurityFlagFullJson) {
352353
<< "guest_enforce_security flag is missing or wrongly formatted";
353354
}
354355

356+
} // namespace
355357
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/disk_configs_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "cuttlefish/host/commands/cvd/cli/parser/test_common.h"
2222

2323
namespace cuttlefish {
24+
namespace {
2425

2526
TEST(BootFlagsParserTest, ParseTwoInstancesBlankDataImageEmptyJson) {
2627
const char* test_string = R""""(
@@ -108,4 +109,5 @@ TEST(BootFlagsParserTest, ParseTwoInstancesBlankDataImageFullJson) {
108109
<< "blank_data_image_mb flag is missing or wrongly formatted";
109110
}
110111

112+
} // namespace
111113
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/graphics_configs_test.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131
#include "cuttlefish/host/commands/cvd/cli/parser/test_common.h"
3232
#include "cuttlefish/result/result_matchers.h"
3333

34+
namespace cuttlefish {
35+
namespace {
36+
3437
using google::protobuf::Message;
3538
using google::protobuf::util::MessageDifferencer;
3639

37-
namespace cuttlefish {
38-
3940
// TODO: schuffelen - make this into a matcher
4041
static void AssertProtoEquals(const Message& expected, const Message& actual) {
4142
MessageDifferencer diff;
@@ -241,4 +242,5 @@ TEST(BootFlagsParserTest, ParseTwoInstancesAutoTabletDisplaysFlag) {
241242
AssertProtoEquals(expected, (*display).value());
242243
}
243244

245+
} // namespace
244246
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/instance/vm_configs_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "cuttlefish/result/result_matchers.h"
2727

2828
namespace cuttlefish {
29+
namespace {
2930

3031
TEST(VmFlagsParserTest, ParseTwoInstancesCpuFlagEmptyJson) {
3132
const char* test_string = R""""(
@@ -994,4 +995,5 @@ TEST(VmFlagsParserTest, ParseTwoInstancesCustomActionsFlagPartialJson) {
994995
EXPECT_THAT(ParseJson(custom_actions[0]), IsOkAndValue(expected_actions));
995996
}
996997

998+
} // namespace
997999
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/parser/metrics_configs_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "cuttlefish/result/result_matchers.h"
2626

2727
namespace cuttlefish {
28+
namespace {
2829

2930
using ::testing::IsTrue;
3031
using ::testing::Not;
@@ -125,4 +126,5 @@ TEST(MetricsFlagsParserTest, ParseTwoInstancesMetricsReportFlagEmptyJson) {
125126
<< "report_anonymous_usage_stats flag is missing or wrongly formatted";
126127
}
127128

129+
} // namespace
128130
} // namespace cuttlefish

base/cvd/cuttlefish/host/commands/cvd/cli/selector/creation_analyzer_test.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ std::string AutoGeneratedHome(const std::string& subdir) {
4545
return parent + "/" + std::to_string(getuid()) + "/" + subdir;
4646
}
4747

48-
} // namespace
49-
5048
static auto home_test_inputs = testing::Values(
5149
InputOutput{
5250
.cmd_args = "cvd start --daemon",
@@ -284,5 +282,6 @@ TEST(AutoHomeTest, DefaultFollowedByNonDefaultTest) {
284282
<< result_2nd_non_default.error().Trace();
285283
}
286284

285+
} // namespace
287286
} // namespace selector
288287
} // namespace cuttlefish

0 commit comments

Comments
 (0)