art: Fix bug in VariantMap::Set
Bug: 19295410
Change-Id: I7827583846d710698c0e7bc0ec1a2c3bf901bd50
diff --git a/runtime/parsed_options_test.cc b/runtime/parsed_options_test.cc
index 79dc2fa..658b656 100644
--- a/runtime/parsed_options_test.cc
+++ b/runtime/parsed_options_test.cc
@@ -98,4 +98,20 @@
EXPECT_EQ("baz=qux", properties_list[1]);
}
+TEST_F(ParsedOptionsTest, ParsedOptionsGc) {
+ RuntimeOptions options;
+ options.push_back(std::make_pair("-Xgc:MC", nullptr));
+
+ RuntimeArgumentMap map;
+ std::unique_ptr<ParsedOptions> parsed(ParsedOptions::Create(options, false, &map));
+ ASSERT_TRUE(parsed.get() != NULL);
+ ASSERT_NE(0u, map.Size());
+
+ using Opt = RuntimeArgumentMap;
+
+ EXPECT_TRUE(map.Exists(Opt::GcOption));
+
+ XGcOption xgc = map.GetOrDefault(Opt::GcOption);
+ EXPECT_EQ(gc::kCollectorTypeMC, xgc.collector_type_);}
+
} // namespace art