[Autofill] Rewrite test cases to use INSTANTIATE_TEST_CASE_P |
|||
Issue description
There are various places in the Autofill components_unittests where something like this is done:
...
const struct {
const char* input;
bool expected_result;
} kTestCases[] = {
{"ab", true},
{"abc", true},
{"abde", true}
};
for (const auto& test_case : kTestCases) {
EXPECT_EQ(test_case.expected_result,
SomeFunction(test_case.input));
}
... (this example is from [1])
This should rather use the INSTANTIATE_TEST_CASE_P mechanism that we have for tests. It will make 1 test for each test case. An example of that is here [2].
The full list of pathological cases can be gleaned from [3]
[1] https://cs.chromium.org/chromium/src/components/autofill/core/common/autofill_util_unittest.cc?rcl=587f430144e9a2ad778649dff1c297b09977c2a3&l=28
[2] https://cs.chromium.org/chromium/src/components/autofill/core/browser/validation_unittest.cc?rcl=587f430144e9a2ad778649dff1c297b09977c2a3&l=189
[3] Some cases can be found here https://cs.chromium.org/search/?q=file:autofill.%2Bunittest.cc+struct.%2B%7B&type=cs
,
Mar 15 2017
Are we done or is there some cleanup?
,
Jul 26 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Mar 14 2017