Adds a test property to the list. If a property with the same key as the supplied property is already represented, the value of this test_property replaces the old value for that key.
| 3552 | // supplied property is already represented, the value of this test_property |
| 3553 | // replaces the old value for that key. |
| 3554 | void TestResult::RecordProperty(const std::string& xml_element, |
| 3555 | const TestProperty& test_property) { |
| 3556 | if (!ValidateTestProperty(xml_element, test_property)) { |
| 3557 | return; |
| 3558 | } |
| 3559 | internal::MutexLock lock(&test_properites_mutex_); |
| 3560 | const std::vector<TestProperty>::iterator property_with_matching_key = |
| 3561 | std::find_if(test_properties_.begin(), test_properties_.end(), |
| 3562 | internal::TestPropertyKeyIs(test_property.key())); |
| 3563 | if (property_with_matching_key == test_properties_.end()) { |
| 3564 | test_properties_.push_back(test_property); |
| 3565 | return; |
| 3566 | } |
| 3567 | property_with_matching_key->SetValue(test_property.value()); |
| 3568 | } |
| 3569 | |
| 3570 | // The list of reserved attributes used in the <testsuites> element of XML |
| 3571 | // output. |
no test coverage detected