fix build break caused by libwebappenc API change 13/46713/2
authorDongsun Lee <ds73.lee@samsung.com>
Tue, 25 Aug 2015 07:32:55 +0000 (16:32 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Tue, 25 Aug 2015 07:38:43 +0000 (16:38 +0900)
Change-Id: I5e6073196d267bb15ef41395dbbeab531b2503df
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
src/libwebappenc-tests/test_cases.cpp

index c6c26a2ee6ee0ff9ca524d7d14c5e6c232b71e20..052fb37b930808fb9441208e367e2a048e0c52d9 100644 (file)
@@ -114,8 +114,8 @@ error:
 RUNNER_TEST_GROUP_INIT(libwebappenc)
 
 RUNNER_TEST(T01_init) {
-    wae_remove_app_dek(TEST_PKGID_1);
-    wae_remove_app_dek(TEST_PKGID_2);
+    wae_remove_app_dek(TEST_PKGID_1, WAE_DOWNLOADED_GLOBAL_APP);
+    wae_remove_app_dek(TEST_PKGID_2, WAE_PRELOADED_APP);
 }
 
 RUNNER_CHILD_TEST(T02_downloaded_web_app_enc){
@@ -126,9 +126,9 @@ RUNNER_CHILD_TEST(T02_downloaded_web_app_enc){
     unsigned char* encrypted = NULL;
     size_t encLen = 0;
 
-    int isPreloaded = 0; // Downloaded
+    wae_app_type_e appType = WAE_DOWNLOADED_GLOBAL_APP;
 
-    ret = wae_encrypt_web_application(pkgId, isPreloaded,
+    ret = wae_encrypt_web_application(pkgId, appType,
                                       (const unsigned char*)plaintext, plaintextLen,
                                       &encrypted, &encLen);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_encrypt_web_application. ret=" << ret);
@@ -147,15 +147,15 @@ RUNNER_CHILD_TEST(T03_downloaded_web_app_dec){
     unsigned char* decrypted = NULL;
     size_t decLen = 0;
 
-    int isPreloaded = 0; // Downloaded
+    wae_app_type_e appType = WAE_DOWNLOADED_GLOBAL_APP;
 
     ret = _read_from_file(DOWNLOADED_ENC_FILE, &encrypted, &encLen);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: _read_from_file. ret=" << ret);
 
-    ret = wae_decrypt_web_application(pkgId, isPreloaded, encrypted, encLen, &decrypted, &decLen);
+    ret = wae_decrypt_web_application(pkgId, appType, encrypted, encLen, &decrypted, &decLen);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_decrypt_web_application. ret=" << ret);
 
-    RUNNER_ASSERT_MSG(plaintextLen == decLen, 
+    RUNNER_ASSERT_MSG(plaintextLen == decLen,
                       "FAIL: plaintext_len("<<plaintextLen<<") != decrypted_len(" <<decLen<<")");
     RUNNER_ASSERT_MSG(strncmp(plaintext, (char *)decrypted, decLen) == 0,
                       "FAIL: plaintext("<<plaintext <<") != decrypted("<<(char *)decrypted <<")");
@@ -170,9 +170,9 @@ RUNNER_CHILD_TEST(T04_preloaded_web_app_enc){
     unsigned char* encrypted = NULL;
     size_t encLen = 0;
 
-    int isPreloaded = 1; // Preloaded
+    wae_app_type_e appType = WAE_PRELOADED_APP;
 
-    ret = wae_encrypt_web_application(pkgId, isPreloaded, 
+    ret = wae_encrypt_web_application(pkgId, appType,
                                       (const unsigned char*)plaintext, plaintextLen,
                                       &encrypted, &encLen);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_encrypt_web_application. ret=" << ret);
@@ -196,15 +196,15 @@ RUNNER_CHILD_TEST(T06_preloaded_web_app_dec){
     unsigned char* decrypted = NULL;
     size_t decLen = 0;
 
-    int isPreloaded = 1; // Preloaded
+    wae_app_type_e appType = WAE_PRELOADED_APP;
 
     ret = _read_from_file(PRELOADED_ENC_FILE, &encrypted, &encLen);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: _read_from_file. ret=" << ret);
 
-    ret = wae_decrypt_web_application(pkgId, isPreloaded, encrypted, encLen, &decrypted, &decLen);
+    ret = wae_decrypt_web_application(pkgId, appType, encrypted, encLen, &decrypted, &decLen);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_decrypt_web_application. ret=" << ret);
 
-    RUNNER_ASSERT_MSG(plaintextLen == decLen, 
+    RUNNER_ASSERT_MSG(plaintextLen == decLen,
                       "FAIL: plaintext_len("<<plaintextLen<<") != decrypted_len(" <<decLen<<")");
     RUNNER_ASSERT_MSG(strncmp(plaintext, (char *)decrypted, decLen) == 0,
                       "FAIL: plaintext("<<plaintext <<") != decrypted("<<(char *)decrypted <<")");
@@ -214,9 +214,9 @@ RUNNER_CHILD_TEST(T06_preloaded_web_app_dec){
 RUNNER_CHILD_TEST(T07_remove_app_dek) {
     int ret = WAE_ERROR_NONE;
 
-    ret = wae_remove_app_dek(TEST_PKGID_1);
+    ret = wae_remove_app_dek(TEST_PKGID_1, WAE_DOWNLOADED_GLOBAL_APP);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_remove_app_dek. ret=" << ret);
-   
-    ret = wae_remove_app_dek(TEST_PKGID_2);
+
+    ret = wae_remove_app_dek(TEST_PKGID_2, WAE_PRELOADED_APP);
     RUNNER_ASSERT_MSG(ret == WAE_ERROR_NONE, "FAIL: wae_remove_app_dek. ret=" << ret);
 }