Change NULL to nullptr
[platform/core/test/security-tests.git] / tests / common / fs_label_manager.cpp
index bd8fccb..484ec76 100644 (file)
@@ -32,7 +32,7 @@ static const char* get_xattr_name(enum smack_label_type type)
             return XATTR_NAME_SMACKIPOUT;
         default:
             /*  Should not reach this point */
-            return NULL;
+            return nullptr;
     }
 }
 }
@@ -143,9 +143,9 @@ void FsLabelManager::testSmackGetLabel(const std::string &relativePath,
     RUNNER_ASSERT_MSG(ret == 0, "Error in normal getting label");
     SmackLabelPtr labelPtr(tmpLabel);
 
-    if (label == NULL && !m_label.compare(tmpLabel))
+    if (label == nullptr && !m_label.compare(tmpLabel))
         return;
-    RUNNER_ASSERT_MSG(label != NULL, "Path should be related with file system default label. "
+    RUNNER_ASSERT_MSG(label != nullptr, "Path should be related with file system default label. "
                                         << tmpLabel << " != " << m_label);
 
     ret = strcmp(tmpLabel, label);
@@ -165,9 +165,9 @@ void FsLabelManager::testSmackLGetLabel(const std::string &relativePath,
     RUNNER_ASSERT_MSG(ret == 0, "Error in link getting label");
     SmackLabelPtr labelPtr(tmpLabel);
 
-    if (label == NULL && !m_label.compare(tmpLabel))
+    if (label == nullptr && !m_label.compare(tmpLabel))
         return;
-    RUNNER_ASSERT_MSG(label != NULL, "Path should be related with file system default label. "
+    RUNNER_ASSERT_MSG(label != nullptr, "Path should be related with file system default label. "
                                         << tmpLabel << " != " << m_label);
 
     ret = strcmp(tmpLabel, label);
@@ -190,9 +190,9 @@ void FsLabelManager::testSmackFGetLabel(const std::string &relativePath,
     RUNNER_ASSERT_MSG(ret == 0, "Error in fd getting label");
     SmackLabelPtr labelPtr(tmpLabel);
 
-    if (label == NULL && !m_label.compare(tmpLabel))
+    if (label == nullptr && !m_label.compare(tmpLabel))
         return;
-    RUNNER_ASSERT_MSG(label != NULL, "Fd should be related with file system default label. "
+    RUNNER_ASSERT_MSG(label != nullptr, "Fd should be related with file system default label. "
                                         << tmpLabel << " != " << m_label);
 
     ret = strcmp(tmpLabel, label);
@@ -203,10 +203,10 @@ void FsLabelManager::testSmackFGetLabel(const std::string &relativePath,
 
 void FsLabelManager::testSmackClearLabels(const std::string &relativePath)
 {
-    testSmackSetLabel(relativePath, NULL, SMACK_LABEL_ACCESS);
-    testSmackGetLabel(relativePath, NULL, SMACK_LABEL_ACCESS);
-    testSmackSetLabel(relativePath, NULL, SMACK_LABEL_EXEC);
-    testSmackGetLabel(relativePath, NULL, SMACK_LABEL_EXEC);
+    testSmackSetLabel(relativePath, nullptr, SMACK_LABEL_ACCESS);
+    testSmackGetLabel(relativePath, nullptr, SMACK_LABEL_ACCESS);
+    testSmackSetLabel(relativePath, nullptr, SMACK_LABEL_EXEC);
+    testSmackGetLabel(relativePath, nullptr, SMACK_LABEL_EXEC);
 }
 
 void FsLabelManager::checkLabel(const std::string &path,
@@ -218,7 +218,7 @@ void FsLabelManager::checkLabel(const std::string &path,
     RUNNER_ASSERT_ERRNO_MSG(ret > 0, "Error in getting xattr");
 
     const char *tmpLabel;
-    if (label == NULL)
+    if (label == nullptr)
         tmpLabel = m_label.c_str();
     else
         tmpLabel = label;
@@ -236,7 +236,7 @@ void FsLabelManager::checkLinkLabel(const std::string &path,
     RUNNER_ASSERT_ERRNO_MSG(ret > 0, "Error in getting xattr");
 
     const char *tmpLabel;
-    if (label == NULL)
+    if (label == nullptr)
         tmpLabel = m_label.c_str();
     else
         tmpLabel = label;