diff options
Diffstat (limited to 'cmdline/cmdline_parser_test.cc')
-rw-r--r-- | cmdline/cmdline_parser_test.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index 97daafadd8..101e5c42cd 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -63,6 +63,12 @@ namespace art { return expected == actual; } + template <char Separator> + bool UsuallyEquals(const std::vector<std::string>& expected, + const ParseStringList<Separator>& actual) { + return expected == static_cast<std::vector<std::string>>(actual); + } + // Try to use memcmp to compare simple plain-old-data structs. // // This should *not* generate false positives, but it can generate false negatives. @@ -218,8 +224,13 @@ TEST_F(CmdlineParserTest, TestSimpleSuccesses) { } EXPECT_SINGLE_PARSE_EXISTS("-Xzygote", M::Zygote); - EXPECT_SINGLE_PARSE_VALUE_STR("/hello/world", "-Xbootclasspath:/hello/world", M::BootClassPath); - EXPECT_SINGLE_PARSE_VALUE("/hello/world", "-Xbootclasspath:/hello/world", M::BootClassPath); + EXPECT_SINGLE_PARSE_VALUE(std::vector<std::string>({"/hello/world"}), + "-Xbootclasspath:/hello/world", + M::BootClassPath); + EXPECT_SINGLE_PARSE_VALUE(std::vector<std::string>({"/hello", "/world"}), + "-Xbootclasspath:/hello:/world", + M::BootClassPath); + EXPECT_SINGLE_PARSE_VALUE_STR("/hello/world", "-classpath /hello/world", M::ClassPath); EXPECT_SINGLE_PARSE_VALUE(Memory<1>(234), "-Xss234", M::StackSize); EXPECT_SINGLE_PARSE_VALUE(MemoryKiB(1234*MB), "-Xms1234m", M::MemoryInitialSize); EXPECT_SINGLE_PARSE_VALUE(true, "-XX:EnableHSpaceCompactForOOM", M::EnableHSpaceCompactForOOM); |