Reorder and change test macros
[platform/core/test/security-tests.git] / tests / security-manager-tests / common / sm_db.cpp
index 4bdc8bf..083b9ae 100644 (file)
@@ -53,8 +53,8 @@ void TestSecurityManagerDatabase::test_db_after__app_install(const std::string &
     if (!m_base.is_open())
         m_base.open();
 
-    RUNNER_ASSERT_MSG_BT(!app_name.empty(), "Request is corrupted, appId is empty");
-    RUNNER_ASSERT_MSG_BT(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
+    RUNNER_ASSERT_MSG(!app_name.empty(), "Request is corrupted, appId is empty");
+    RUNNER_ASSERT_MSG(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
 
     check_app_and_pkg(app_name, pkg_name, NOT_REMOVED);
 
@@ -80,8 +80,8 @@ void TestSecurityManagerDatabase::test_db_after__app_uninstall(const std::string
     if (!m_base.is_open())
         m_base.open();
 
-    RUNNER_ASSERT_MSG_BT(!app_name.empty(), "Request is corrupted, appId is empty");
-    RUNNER_ASSERT_MSG_BT(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
+    RUNNER_ASSERT_MSG(!app_name.empty(), "Request is corrupted, appId is empty");
+    RUNNER_ASSERT_MSG(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
 
     check_app_and_pkg(app_name, pkg_name, REMOVED);
     check_pkg(pkg_name, is_pkg_removed);
@@ -97,13 +97,13 @@ void TestSecurityManagerDatabase::check_privileges(const std::string &app_name,
 {
     bool result;
 
-    RUNNER_ASSERT_MSG_BT(!app_name.empty(), "Request is corrupted, appId is empty");
-    RUNNER_ASSERT_MSG_BT(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
+    RUNNER_ASSERT_MSG(!app_name.empty(), "Request is corrupted, appId is empty");
+    RUNNER_ASSERT_MSG(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
 
     for (auto it = privileges.begin(); it != privileges.end(); ++it) {
         result = check_privilege(app_name, pkg_name, *it);
 
-        RUNNER_ASSERT_MSG_BT(result == true, "privilege: <" << *it << "> not added to app: <" <<
+        RUNNER_ASSERT_MSG(result == true, "privilege: <" << *it << "> not added to app: <" <<
                              app_name << ">  from pkg_id: <" << pkg_name << ">");
     }
 }
@@ -114,13 +114,13 @@ void TestSecurityManagerDatabase::check_privileges_removed(const std::string &ap
 {
     bool result;
 
-    RUNNER_ASSERT_MSG_BT(!app_name.empty(), "Request is corrupted, appId is empty");
-    RUNNER_ASSERT_MSG_BT(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
+    RUNNER_ASSERT_MSG(!app_name.empty(), "Request is corrupted, appId is empty");
+    RUNNER_ASSERT_MSG(!pkg_name.empty(), "Request is corrupted, pkgId is empty");
 
     for (auto it = privileges.begin(); it != privileges.end(); ++it) {
         result = check_privilege(app_name, pkg_name, *it);
 
-        RUNNER_ASSERT_MSG_BT(result == false, "privilege: <" << *it << "> not removed for app: <" <<
+        RUNNER_ASSERT_MSG(result == false, "privilege: <" << *it << "> not removed for app: <" <<
                              app_name << ">  from pkg_id: <" << pkg_name << ">");
     }
 }
@@ -136,10 +136,10 @@ void TestSecurityManagerDatabase::check_app_and_pkg(const std::string &app_name,
     m_base.execute(sql.str(), result);
 
     if (is_app_removed) /* expect 0 results */
-        RUNNER_ASSERT_MSG_BT(result.rows.size() == 0, "query : <" << sql.str() <<
+        RUNNER_ASSERT_MSG(result.rows.size() == 0, "query : <" << sql.str() <<
                              "> returned [" << result.rows.size() << "] rows, expected [0]");
     else /* expect exactly 1 result with 2 columns */
-        RUNNER_ASSERT_MSG_BT(result.rows.size() == 1 && result.rows[0].size() == 2, "query : <" <<
+        RUNNER_ASSERT_MSG(result.rows.size() == 1 && result.rows[0].size() == 2, "query : <" <<
                              sql.str() << "> returned [" << result.rows.size() << "] rows, expected [1]");
 }
 
@@ -153,7 +153,7 @@ void TestSecurityManagerDatabase::check_pkg(const std::string &pkg_name,
            "  WHERE name == '" << pkg_name << "' ;";
     m_base.execute(sql.str(), result);
 
-    RUNNER_ASSERT_MSG_BT(result.rows.size() == expected_rows, "query : <" <<
+    RUNNER_ASSERT_MSG(result.rows.size() == expected_rows, "query : <" <<
                          sql.str() << "> returned [" << result.rows.size() << "] rows, expected [" <<
                          expected_rows << "] rows");
 }
@@ -172,7 +172,7 @@ bool TestSecurityManagerDatabase::check_privilege(const std::string &app_name,
     m_base.execute(sql.str(), result);
 
     /* only 0 or 1 resulting rows are alowed */
-    RUNNER_ASSERT_MSG_BT(result.rows.size() == 0 || result.rows.size() == 1, "query : <" << sql.str() << "> returned [" <<
+    RUNNER_ASSERT_MSG(result.rows.size() == 0 || result.rows.size() == 1, "query : <" << sql.str() << "> returned [" <<
                          result.rows.size() << "] rows");
 
     return result.rows.size() == 1;