Added tests for chrome_extensions table. (#6126)

This commit is contained in:
Rachel Cipkins 2019-12-13 19:03:20 -05:00 committed by Teddy Reed
parent 532435d15e
commit 3f632aaea2

View File

@ -22,30 +22,21 @@ class chromeExtensions : public testing::Test {
};
TEST_F(chromeExtensions, test_sanity) {
// 1. Query data
auto const data = execute_query("select * from chrome_extensions");
// 2. Check size before validation
// ASSERT_GE(data.size(), 0ul);
// ASSERT_EQ(data.size(), 1ul);
// ASSERT_EQ(data.size(), 0ul);
// 3. Build validation map
// See helper.h for avaialbe flags
// Or use custom DataCheck object
// ValidationMap row_map = {
// {"uid", IntType},
// {"name", NonEmptyString},
// {"identifier", NonEmptyString},
// {"version", NonEmptyString},
// {"description", NormalType},
// {"locale", NormalType},
// {"update_url", NonEmptyString},
// {"author", NormalType},
// {"persistent", IntType},
// {"path", NonEmptyString},
// {"permissions", NormalType},
// {"profile", NonEmptyString}};
// 4. Perform validation
// validate_rows(data, row_map);
ASSERT_GE(data.size(), 0ul);
ValidationMap row_map = {{"uid", IntType},
{"name", NonEmptyString},
{"identifier", NonEmptyString},
{"version", NonEmptyString},
{"description", NormalType},
{"locale", NormalType},
{"update_url", NonEmptyString},
{"author", NormalType},
{"persistent", IntType},
{"path", NonEmptyString},
{"permissions", NormalType},
{"profile", NonEmptyString}};
validate_rows(data, row_map);
}
} // namespace table_tests