diff options
author | JackLivio <jack@livio.io> | 2018-10-19 15:05:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 15:05:09 -0400 |
commit | d36316738785c96dab2ee892762ed08c059fffde (patch) | |
tree | 168a7c0705b5bc8f0dee7ce4b511ccf71759d9b4 /src/components/application_manager/test/resumption_sql_queries_test.cc | |
parent | 7f7fcbb998fb17f2954fd103349af67ea9b71a3f (diff) | |
parent | 83c5e805346d55ec7fb9f4ba8b6f6855d992273e (diff) | |
download | sdl_core-hotfix/templates_updates.tar.gz |
Merge pull request #2572 from smartdevicelink/release/5.0.05.0.0hotfix/templates_updatesfeature/show_app_menufeature/progress_bar_seekfeature/open-menu-rpcfeature/open-menu-rfeature/button
Release 5.0.0
Diffstat (limited to 'src/components/application_manager/test/resumption_sql_queries_test.cc')
-rw-r--r-- | src/components/application_manager/test/resumption_sql_queries_test.cc | 239 |
1 files changed, 180 insertions, 59 deletions
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc index 08fa0a3eb5..0ec902085f 100644 --- a/src/components/application_manager/test/resumption_sql_queries_test.cc +++ b/src/components/application_manager/test/resumption_sql_queries_test.cc @@ -79,7 +79,7 @@ const string kDeleteData = "DELETE FROM `applicationCommandsArray`; " "DELETE FROM `applicationFilesArray`; " "DELETE FROM `applicationSubMenuArray`; " - "DELETE FROM `applicationSubscribtionsArray`; " + "DELETE FROM `applicationSubscriptionsArray`; " "DELETE FROM `_internal_data`; " "COMMIT; " "VACUUM;"; @@ -197,8 +197,9 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int64_t glob_prop_key); SQLQuery& FillImageTable(SQLQuery& query, - const int imageType, - const string& value); + const int image_type, + const string& value, + const bool is_template); SQLQuery& FillTableLimitedCharacterListTable( SQLQuery& query, const string& limitedCharacterList); @@ -326,7 +327,7 @@ class ResumptionSqlQueriesTest : public ::testing::Test { db_schema.push_back("applicationCommandsArray"); db_schema.push_back("applicationFilesArray"); db_schema.push_back("applicationSubMenuArray"); - db_schema.push_back("applicationSubscribtionsArray"); + db_schema.push_back("applicationSubscriptionsArray"); db_schema.push_back("_internal_data"); std::sort(db_schema.begin(), db_schema.end()); } @@ -456,11 +457,13 @@ void ResumptionSqlQueriesTest::CheckSelectQuery(const string& query_to_check, } SQLQuery& ResumptionSqlQueriesTest::FillImageTable(SQLQuery& query, - const int imageType, - const string& value) { + const int image_type, + const string& value, + const bool is_template) { EXPECT_TRUE(query.Prepare(kInsertImage)); - query.Bind(0, imageType); + query.Bind(0, image_type); query.Bind(1, value); + query.Bind(2, is_template); EXPECT_TRUE(query.Exec()); return query; } @@ -802,7 +805,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksResumptionData_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -829,7 +835,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -854,7 +863,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -879,7 +891,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -904,7 +919,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -930,7 +948,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -956,7 +977,10 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -990,7 +1014,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectIgnOffTime_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1015,7 +1042,10 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1032,7 +1062,9 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) { device_id, key); - key = FillImageTable(temp_query, 1, "tst_img2").LastInsertId(); + key = FillImageTable( + temp_query, 1 /* image_type */, "tst_img2", true /* is_template */) + .LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1056,7 +1088,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectDataForLoadResumeData_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1084,7 +1119,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1117,7 +1155,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) { TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1148,7 +1189,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) { TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1189,7 +1233,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectApplicationsIgnOffCount_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1229,7 +1276,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1258,7 +1308,10 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) { TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1288,7 +1341,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationFilesArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1324,7 +1380,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1355,7 +1414,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationSubMenuArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) .LastInsertId(); @@ -1386,10 +1448,13 @@ TEST_F(ResumptionSqlQueriesTest, } TEST_F(ResumptionSqlQueriesTest, - kDeleteApplicationSubscribtionsArray_ExpectDataDeleted) { + kDeleteApplicationSubscriptionsArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); key1 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1410,12 +1475,12 @@ TEST_F(ResumptionSqlQueriesTest, key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId(); FillAppSubscriptionsArrayTable(temp_query, 7, 2, key1); // Check - const std::string select_count_applicationSubscribtionsArray = - "SELECT COUNT(*) FROM applicationSubscribtionsArray;"; + const std::string select_count_applicationSubscriptionsArray = + "SELECT COUNT(*) FROM applicationSubscriptionsArray;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_applicationSubscribtionsArray, - kDeleteApplicationSubscribtionsArray, + CheckDeleteQuery(select_count_applicationSubscriptionsArray, + kDeleteApplicationSubscriptionsArray, p1, p2, 1, @@ -1426,7 +1491,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); key1 = FillGlobalPropertiesTable( @@ -1456,7 +1524,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); key1 = FillGlobalPropertiesTable( @@ -1490,7 +1561,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); @@ -1522,7 +1596,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationCommandsArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); @@ -1560,7 +1637,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillChoiceTable(temp_query, 2, "tst_menu_name", @@ -1595,7 +1675,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommandsFromChoiceSet_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillChoiceTable( temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) @@ -1638,7 +1721,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillChoiceTable( temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) @@ -1775,7 +1861,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromGlobalProperties_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1804,7 +1893,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -1834,7 +1926,10 @@ TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); + int64_t key1 = FillImageTable(temp_query, + /*image_type=*/1, + test_image, + /*is_template=*/true).LastInsertId(); int64_t key2 = FillGlobalPropertiesTable( temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) .LastInsertId(); @@ -2051,7 +2146,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) { TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - FillImageTable(temp_query, 2, "tst_image"); + FillImageTable( + temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true); ValToPosPair p1(0, "tst_image"); ValToPosPair p2(1, ""); // Check @@ -2061,7 +2157,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); ValToPosPair p1(0, "tst_image"); ValToPosPair p2(1, ""); // Check @@ -2071,7 +2170,8 @@ TEST_F(ResumptionSqlQueriesTest, kSelectPrimaryKeyImage_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kInsertImage_ExpectDataInserted) { // Arrange SQLQuery temp_query(db()); - FillImageTable(temp_query, 2, "tst_image"); + FillImageTable( + temp_query, /*image_type=*/2, "tst_image", /*is_template=*/true); const std::string select_count_image = "SELECT COUNT(*) FROM image;"; // Check CheckSelectQuery(select_count_image, 1, 0); @@ -2211,17 +2311,17 @@ TEST_F(ResumptionSqlQueriesTest, kInsertSubscriptions_ExpectDataInserted) { SQLQuery temp_query(db()); FillAppSubscriptionsArrayTable(temp_query, 2, 3, 4); // Checks - const std::string select_count_applicationSubscribtionsArray = - "SELECT COUNT(*) FROM applicationSubscribtionsArray;"; - CheckSelectQuery(select_count_applicationSubscribtionsArray, 1, 0); + const std::string select_count_applicationSubscriptionsArray = + "SELECT COUNT(*) FROM applicationSubscriptionsArray;"; + CheckSelectQuery(select_count_applicationSubscriptionsArray, 1, 0); const std::string select_idApplication = - "SELECT idApplication FROM applicationSubscribtionsArray;"; + "SELECT idApplication FROM applicationSubscriptionsArray;"; CheckSelectQuery(select_idApplication, 4, 0); const std::string select_vehicleValue = - "SELECT vehicleValue FROM applicationSubscribtionsArray;"; + "SELECT vehicleValue FROM applicationSubscriptionsArray;"; CheckSelectQuery(select_vehicleValue, 2, 0); const std::string select_ButtonNameValue = - "SELECT ButtonNameValue FROM applicationSubscribtionsArray;"; + "SELECT ButtonNameValue FROM applicationSubscriptionsArray;"; CheckSelectQuery(select_ButtonNameValue, 3, 0); } @@ -2616,7 +2716,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) { app_id1, device_id, 9).LastInsertId(); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); FillChoiceTable( temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) @@ -2656,7 +2759,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) { app_id1, device_id, 9).LastInsertId(); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t choice_key = FillChoiceTable( @@ -2776,7 +2882,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) { app_id1, device_id, 9).LastInsertId(); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t choice_key = FillChoiceTable( temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) @@ -2808,7 +2917,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectImage_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); // Check ValToPosPair p1(0, IntToString(image_key)); ValToPosPair p2(1, ""); @@ -2846,7 +2958,10 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + test_image, + /*is_template=*/true).LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -2883,7 +2998,10 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) @@ -2900,7 +3018,10 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); + int64_t image_key = FillImageTable(temp_query, + /*image_type=*/2, + "tst_image", + /*is_template=*/true).LastInsertId(); int64_t glob_prop_key = FillGlobalPropertiesTable( temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) |