Commit 1130351d authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Store test placeholders in a set rather than a vector.

Previously, test placeholders were extracted from test_locations_, a std::map,
which implicitly deduplicated the keys. After creating test_placeholders_, I
stored them in a vector. Unfortunately, this causes duplicate entries to occur
when iterations > 1. Storing them in a set returns the previous behavior.

Bug: 934996
Change-Id: I81825b1f95064ac59594b3531cfd8409c631e8f8
Reviewed-on: https://chromium-review.googlesource.com/c/1484074Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634868}
parent 97f29e1d
...@@ -234,7 +234,7 @@ void TestResultsTracker::AddTestLocation(const std::string& test_name, ...@@ -234,7 +234,7 @@ void TestResultsTracker::AddTestLocation(const std::string& test_name,
} }
void TestResultsTracker::AddTestPlaceholder(const std::string& test_name) { void TestResultsTracker::AddTestPlaceholder(const std::string& test_name) {
test_placeholders_.push_back(test_name); test_placeholders_.insert(test_name);
} }
void TestResultsTracker::AddTestResult(const TestResult& result) { void TestResultsTracker::AddTestResult(const TestResult& result) {
......
...@@ -141,7 +141,7 @@ class TestResultsTracker { ...@@ -141,7 +141,7 @@ class TestResultsTracker {
std::map<std::string, CodeLocation> test_locations_; std::map<std::string, CodeLocation> test_locations_;
// Name of tests that will run and produce results. // Name of tests that will run and produce results.
std::vector<std::string> test_placeholders_; std::set<std::string> test_placeholders_;
// Set of all disabled tests in the current executable. // Set of all disabled tests in the current executable.
std::set<std::string> disabled_tests_; std::set<std::string> disabled_tests_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment