Merge branch 'tizen' into security-manager
[platform/core/test/security-tests.git] / src / common / tests_common.cpp
similarity index 94%
rename from tests/common/tests_common.cpp
rename to src/common/tests_common.cpp
index a8afc7b..2332abb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -36,25 +36,15 @@ int DB::Transaction::db_result = PC_OPERATION_SUCCESS;
 
 const char *WGT_APP_ID = "QwCqJ0ttyS";
 
-int smack_runtime_check(void)
-{
-    static int smack_present = -1;
-    if (-1 == smack_present) {
-        if (smack_smackfs_path()) {
-            smack_present = 1;
-        } else {
-            smack_present = 0;
-        }
-    }
-    return smack_present;
-}
-
-int smack_check(void)
+bool smack_check(void)
 {
 #ifndef WRT_SMACK_ENABLED
-    return 0;
+    return false;
 #else
-    return smack_runtime_check();
+    static int smack_present = -1;
+    if (-1 == smack_present)
+        smack_present = smack_smackfs_path() == nullptr ? 0 : 1;
+    return smack_present == 1;
 #endif
 }