CKM: tests adjusted to tizenorg.
[platform/core/test/security-tests.git] / tests / ckm / capi-certificate-chains.cpp
index 49a366a..cf25f65 100644 (file)
@@ -235,7 +235,7 @@ typedef std::unique_ptr<ckmc_alias_list_s, void (*)(ckmc_alias_list_s*)> AliasLi
 
 ckmc_cert_s* create_cert(CertIdx idx) {
     size_t size = sizeof(CERT)/sizeof(CERT[0]);
-    RUNNER_ASSERT_MSG_BT(idx < size, "Certificate index out of range: " << idx << ">=" << size);
+    RUNNER_ASSERT_MSG(idx < size, "Certificate index out of range: " << idx << ">=" << size);
 
     ckmc_cert_s* cert = NULL;
     assert_positive(ckmc_cert_new,
@@ -244,7 +244,7 @@ ckmc_cert_s* create_cert(CertIdx idx) {
                     CKMC_FORM_PEM,
                     &cert);
 
-    RUNNER_ASSERT_MSG_BT(cert != NULL, "Cert is NULL");
+    RUNNER_ASSERT_MSG(cert != NULL, "Cert is NULL");
     return cert;
 }
 
@@ -253,7 +253,6 @@ void save_cert(const ckmc_cert_s* cert, const char* alias) {
     policy.password = NULL;
     policy.extractable = 1;
 
-    int tmp;
     assert_positive(ckmc_save_cert, alias, *cert, policy);
 }
 
@@ -270,11 +269,11 @@ AliasListPtr create_alias_list(const char* alias, ...) {
             ckmc_alias_list_s* tmp = NULL;
             assert_positive(ckmc_alias_list_new, strdup(a), &tmp);
             aliasList = AliasListPtr(tmp, ckmc_alias_list_all_free);
-            RUNNER_ASSERT_MSG_BT(!!aliasList, "Alias list is NULL");
+            RUNNER_ASSERT_MSG(!!aliasList, "Alias list is NULL");
             last = aliasList.get();
         } else {
             assert_positive(ckmc_alias_list_add, last, strdup(a), &last);
-            RUNNER_ASSERT_MSG_BT(last != NULL, "Last alias on the list is NULL");
+            RUNNER_ASSERT_MSG(last != NULL, "Last alias on the list is NULL");
         }
     }
     va_end(ap);
@@ -295,11 +294,11 @@ CertListPtr create_cert_list(ckmc_cert_s* cert, ...) {
             ckmc_cert_list_s* tmp = NULL;
             assert_positive(ckmc_cert_list_new, c, &tmp);
             certList = CertListPtr(tmp, ckmc_cert_list_all_free);
-            RUNNER_ASSERT_MSG_BT(!!certList, "Cert list is NULL");
+            RUNNER_ASSERT_MSG(!!certList, "Cert list is NULL");
             last = certList.get();
         } else {
             assert_positive(ckmc_cert_list_add, last, c, &last);
-            RUNNER_ASSERT_MSG_BT(last != NULL, "Last cert on the list is NULL");
+            RUNNER_ASSERT_MSG(last != NULL, "Last cert on the list is NULL");
         }
     }
     va_end(ap);
@@ -450,14 +449,14 @@ void ChainVerifier<T>::addCert(ckmc_cert_list_s*& list, ckmc_cert_s* cert)
     if (!list) {
         ckmc_cert_list_s* tmp = NULL;
         assert_positive(ckmc_cert_list_new, cert, &tmp);
-        RUNNER_ASSERT_MSG_BT(!!tmp, "Cert list is NULL");
+        RUNNER_ASSERT_MSG(!!tmp, "Cert list is NULL");
         list = tmp;
     } else {
         ckmc_cert_list_s* last = list;
         while(last->next)
             last = last->next;
         assert_positive(ckmc_cert_list_add, last, cert, &last);
-        RUNNER_ASSERT_MSG_BT(last != NULL, "Last cert on the list is NULL");
+        RUNNER_ASSERT_MSG(last != NULL, "Last cert on the list is NULL");
     }
 }
 
@@ -467,14 +466,14 @@ void ChainVerifier<T>::addAlias(ckmc_alias_list_s*& list, const char* alias)
     if (!list) {
         ckmc_alias_list_s* tmp = NULL;
         assert_positive(ckmc_alias_list_new, strdup(alias), &tmp);
-        RUNNER_ASSERT_MSG_BT(!!tmp, "Alias list is NULL");
+        RUNNER_ASSERT_MSG(!!tmp, "Alias list is NULL");
         list = tmp;
     } else {
         ckmc_alias_list_s* last = list;
         while(last->next)
             last = last->next;
         assert_positive(ckmc_alias_list_add, last, strdup(alias), &last);
-        RUNNER_ASSERT_MSG_BT(last != NULL, "Last alias on the list is NULL");
+        RUNNER_ASSERT_MSG(last != NULL, "Last alias on the list is NULL");
     }
 }
 
@@ -495,7 +494,7 @@ void ChainVerifier<T>::verifyPositive(CertIdx idx, size_t expected)
     size_t size = list_size(chain);
     ckmc_cert_list_all_free(chain);
     chain = NULL;
-    RUNNER_ASSERT_MSG_BT(size == expected, "Expected chain size: " << expected << " got: " << size);
+    RUNNER_ASSERT_MSG(size == expected, "Expected chain size: " << expected << " got: " << size);
 
     assert_positive(T::createChainWithAlias,
                     cert,
@@ -507,7 +506,7 @@ void ChainVerifier<T>::verifyPositive(CertIdx idx, size_t expected)
     size = list_size(chain);
     ckmc_cert_list_all_free(chain);
     chain = NULL;
-    RUNNER_ASSERT_MSG_BT(size == expected, "Expected chain size: " << expected << " got: " << size);
+    RUNNER_ASSERT_MSG(size == expected, "Expected chain size: " << expected << " got: " << size);
     ckmc_cert_free(cert);
 }
 
@@ -525,7 +524,7 @@ void ChainVerifier<T>::verifyNegative(CertIdx idx, int error)
                   m_trustedCerts,
                   m_system,
                   &chain);
-    RUNNER_ASSERT_MSG_BT(chain == NULL, "Chain is not empty");
+    RUNNER_ASSERT_MSG(chain == NULL, "Chain is not empty");
 
     assert_result(error,
                   T::createChainWithAlias,
@@ -535,7 +534,7 @@ void ChainVerifier<T>::verifyNegative(CertIdx idx, int error)
                   m_system,
                   &chain);
 
-    RUNNER_ASSERT_MSG_BT(chain == NULL, "Chain is not empty");
+    RUNNER_ASSERT_MSG(chain == NULL, "Chain is not empty");
     ckmc_cert_free(cert);
 }
 
@@ -545,7 +544,6 @@ RUNNER_TEST_GROUP_INIT(T307_CKMC_CAPI_CERTIFICATE_CHAINS);
 
 RUNNER_TEST(TCCH_0000_init)
 {
-    int temp;
     assert_positive(ckmc_unlock_user_key, 0, "test-pass");
 }
 
@@ -764,8 +762,6 @@ RUNNER_TEST(TCCH_0200_get_certificate_chain_all)
 
 RUNNER_TEST(TCCH_9999_deinit)
 {
-    int temp;
-
     assert_positive(ckmc_lock_user_key, 0);
     assert_positive(ckmc_remove_user_data, 0);
 }