Fix coding rule
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 31 May 2021 05:20:22 +0000 (14:20 +0900)
committer연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Tue, 1 Jun 2021 07:58:25 +0000 (16:58 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
test/unit_tests/mock/mock_hook.h
test/unit_tests/mock/module_mock.h
test/unit_tests/mock/system_info_mock.h
test/unit_tests/mock/test_fixture.cc
test/unit_tests/parcel_utils.cc
test/unit_tests/parcel_utils.hh
test/unit_tests/test_db_handlers.cc

index b57f3697b9ed9b074f9180bdde4bfb36dbdd73ed..a3d4f84d127ec1ede3c2b9dca042eb1f321da7bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index b8163e97dfa7413295daf18a588674d6c37fe179..9ad71873e2a52cef377c45f1715871b77b420e05 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 1544ff7b96bb236e2b886a3d07b8df544dabeba8..dca0542745cd3ea74102bd3eba4f5995da11b9ac 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef TEST_UNIT_TESTS_MOCK_GIO_MOCK_H_
-#define TEST_UNIT_TESTS_MOCK_GIO_MOCK_H_
+#ifndef TEST_UNIT_TESTS_MOCK_SYSTEM_INFO_MOCK_H_
+#define TEST_UNIT_TESTS_MOCK_SYSTEM_INFO_MOCK_H_
 
 #include <system_info.h>
 #include <gmock/gmock.h>
@@ -30,4 +30,4 @@ class SystemInfoMock : public virtual ModuleMock {
       int(const char*, int*));
 };
 
-#endif  // TEST_UNIT_TESTS_MOCK_GIO_MOCK_H_
+#endif  // TEST_UNIT_TESTS_MOCK_SYSTEM_INFO_MOCK_H_
index 27f566616c9fcf6a9202a80e6d16569ad2d127e1..8abae0c1f5ce705c06d570b47f1308d297b3bec1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index a8b2c99115a0bcabcceafdf693294974a1d5b7e8..c1b70880ce91d9e2ef44d4e87864e84ce198a7d2 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "pkgmgrinfo_basic.h"
 
-bool IS_STR_EQ(const char *a, const char *b) {
+bool IS_STR_EQ(const char* a, const char* b) {
   if (a == nullptr && b == nullptr)
     return true;
   if (a == nullptr || b == nullptr)
@@ -44,8 +44,8 @@ bool IS_STR_EQ(const char *a, const char *b) {
     }                                                                        \
 } while (0);
 
-application_x *GetTestApplication(std::string appid) {
-  application_x *application;
+application_xGetTestApplication(std::string appid) {
+  application_xapplication;
   application =
       reinterpret_cast<application_x*>(calloc(1, sizeof(application_x)));
 
@@ -169,10 +169,10 @@ bool IsEqualApplicationExtraInfo(application_x* applicationA,
 
   INT_EQ(g_list_length(applicationA->icon),
       g_list_length(applicationB->icon));
-  for (GList *a = applicationA->icon, *b = applicationB->icon;
+  for (GLista = applicationA->icon, *b = applicationB->icon;
       a && b; a = a->next, b = b->next) {
-    icon_x *icon_a = reinterpret_cast<icon_x *>(a->data);
-    icon_x *icon_b = reinterpret_cast<icon_x *>(b->data);
+    icon_x* icon_a = reinterpret_cast<icon_x*>(a->data);
+    icon_x* icon_b = reinterpret_cast<icon_x*>(b->data);
     STR_EQ(icon_a->dpi, icon_b->dpi);
     STR_EQ(icon_a->resolution, icon_b->resolution);
     STR_EQ(icon_a->section, icon_b->section);
@@ -181,32 +181,32 @@ bool IsEqualApplicationExtraInfo(application_x* applicationA,
 
   INT_EQ(g_list_length(applicationA->datacontrol),
       g_list_length(applicationB->datacontrol));
-  for (GList *a = applicationA->datacontrol, *b = applicationB->datacontrol;
+  for (GLista = applicationA->datacontrol, *b = applicationB->datacontrol;
       a && b; a = a->next, b = b->next) {
-    datacontrol_x *datacontrol_a = reinterpret_cast<datacontrol_x *>(a->data);
-    datacontrol_x *datacontrol_b = reinterpret_cast<datacontrol_x *>(b->data);
+    datacontrol_x* datacontrol_a = reinterpret_cast<datacontrol_x*>(a->data);
+    datacontrol_x* datacontrol_b = reinterpret_cast<datacontrol_x*>(b->data);
     STR_EQ(datacontrol_a->access, datacontrol_b->access);
     STR_EQ(datacontrol_a->providerid, datacontrol_b->providerid);
     STR_EQ(datacontrol_a->trusted, datacontrol_b->trusted);
     STR_EQ(datacontrol_a->type, datacontrol_b->type);
     INT_EQ(g_list_length(datacontrol_a->privileges)
         , g_list_length(datacontrol_b->privileges));
-    for (GList *a = datacontrol_a->privileges, *b = datacontrol_b->privileges;
+    for (GLista = datacontrol_a->privileges, *b = datacontrol_b->privileges;
         a && b; a = a->next, b = b->next) {
-      char *privilege_a = reinterpret_cast<char *>(a->data);
-      char *privilege_b = reinterpret_cast<char *>(b->data);
+      char* privilege_a = reinterpret_cast<char*>(a->data);
+      char* privilege_b = reinterpret_cast<char*>(b->data);
       STR_EQ(privilege_a, privilege_b);
     }
   }
 
-  for (GList *a = applicationA->appcontrol, *b = applicationB->appcontrol;
+  for (GLista = applicationA->appcontrol, *b = applicationB->appcontrol;
       a && b; a = a->next, b = b->next) {
-    appcontrol_x *appcontrol_a = reinterpret_cast<appcontrol_x *>(a->data);
-    appcontrol_x *appcontrol_b = reinterpret_cast<appcontrol_x *>(b->data);
-    for (GList *a = appcontrol_a->privileges, *b = appcontrol_b->privileges;
+    appcontrol_x* appcontrol_a = reinterpret_cast<appcontrol_x*>(a->data);
+    appcontrol_x* appcontrol_b = reinterpret_cast<appcontrol_x*>(b->data);
+    for (GLista = appcontrol_a->privileges, *b = appcontrol_b->privileges;
         a && b; a = a->next, b = b->next) {
-      char *privilege_a = reinterpret_cast<char *>(a->data);
-      char *privilege_b = reinterpret_cast<char *>(b->data);
+      char* privilege_a = reinterpret_cast<char*>(a->data);
+      char* privilege_b = reinterpret_cast<char*>(b->data);
       STR_EQ(privilege_a, privilege_b);
     }
   }
@@ -215,8 +215,8 @@ bool IsEqualApplicationExtraInfo(application_x* applicationA,
   return true;
 }
 
-bool IsEqualApplication(application_x *applicationA,
-    application_x *applicationB) {
+bool IsEqualApplication(application_xapplicationA,
+    application_xapplicationB) {
   STR_EQ(applicationA->appid, applicationB->appid);
   STR_EQ(applicationA->exec, applicationB->exec);
   STR_EQ(applicationA->nodisplay, applicationB->nodisplay);
@@ -272,30 +272,30 @@ bool IsEqualApplication(application_x *applicationA,
 
   INT_EQ(g_list_length(applicationA->label),
       g_list_length(applicationB->label));
-  for (GList *a = applicationA->label, *b = applicationB->label;
+  for (GLista = applicationA->label, *b = applicationB->label;
       a && b; a = a->next, b = b->next) {
-    label_x *label_a = reinterpret_cast<label_x *>(a->data);
-    label_x *label_b = reinterpret_cast<label_x *>(b->data);
+    label_x* label_a = reinterpret_cast<label_x*>(a->data);
+    label_x* label_b = reinterpret_cast<label_x*>(b->data);
     STR_EQ(label_a->lang, label_b->lang);
     STR_EQ(label_a->text, label_b->text);
   }
 
   INT_EQ(g_list_length(applicationA->icon),
       g_list_length(applicationB->icon));
-  for (GList *a = applicationA->icon, *b = applicationB->icon;
+  for (GLista = applicationA->icon, *b = applicationB->icon;
       a && b; a = a->next, b = b->next) {
-    icon_x *icon_a = reinterpret_cast<icon_x *>(a->data);
-    icon_x *icon_b = reinterpret_cast<icon_x *>(b->data);
+    icon_x* icon_a = reinterpret_cast<icon_x*>(a->data);
+    icon_x* icon_b = reinterpret_cast<icon_x*>(b->data);
     STR_EQ(icon_a->lang, icon_b->lang);
     STR_EQ(icon_a->text, icon_b->text);
   }
 
   INT_EQ(g_list_length(applicationA->image),
       g_list_length(applicationB->image));
-  for (GList *a = applicationA->image, *b = applicationB->image;
+  for (GLista = applicationA->image, *b = applicationB->image;
       a && b; a = a->next, b = b->next) {
-    image_x *image_a = reinterpret_cast<image_x *>(a->data);
-    image_x *image_b = reinterpret_cast<image_x *>(b->data);
+    image_x* image_a = reinterpret_cast<image_x*>(a->data);
+    image_x* image_b = reinterpret_cast<image_x*>(b->data);
     STR_EQ(image_a->lang, image_b->lang);
     STR_EQ(image_a->section, image_b->section);
     STR_EQ(image_a->text, image_b->text);
@@ -303,39 +303,38 @@ bool IsEqualApplication(application_x *applicationA,
 
   INT_EQ(g_list_length(applicationA->category),
       g_list_length(applicationB->category));
-  for (GList *a = applicationA->category, *b = applicationB->category;
+  for (GLista = applicationA->category, *b = applicationB->category;
       a && b; a = a->next, b = b->next) {
-    char *category_a = reinterpret_cast<char *>(a->data);
-    char *category_b = reinterpret_cast<char *>(b->data);
+    char* category_a = reinterpret_cast<char*>(a->data);
+    char* category_b = reinterpret_cast<char*>(b->data);
     STR_EQ(category_a, category_b);
   }
 
   INT_EQ(g_list_length(applicationA->metadata),
       g_list_length(applicationB->metadata));
-  for (GList *a = applicationA->metadata, *b = applicationB->metadata;
+  for (GLista = applicationA->metadata, *b = applicationB->metadata;
       a && b; a = a->next, b = b->next) {
-    metadata_x *metadata_a = reinterpret_cast<metadata_x *>(a->data);
-    metadata_x *metadata_b = reinterpret_cast<metadata_x *>(b->data);
+    metadata_x* metadata_a = reinterpret_cast<metadata_x*>(a->data);
+    metadata_x* metadata_b = reinterpret_cast<metadata_x*>(b->data);
     STR_EQ(metadata_a->key, metadata_b->key);
     STR_EQ(metadata_a->value, metadata_b->value);
   }
 
   INT_EQ(g_list_length(applicationA->background_category),
       g_list_length(applicationB->background_category));
-  for (GList *a = applicationA->background_category,
-      *b = applicationB->background_category;
+  for (GList* a = applicationA->background_category, *b = applicationB->background_category;
       a && b; a = a->next, b = b->next) {
-    char *background_category_a = reinterpret_cast<char *>(a->data);
-    char *background_category_b = reinterpret_cast<char *>(b->data);
+    char* background_category_a = reinterpret_cast<char*>(a->data);
+    char* background_category_b = reinterpret_cast<char*>(b->data);
     STR_EQ(background_category_a, background_category_b);
   }
 
   INT_EQ(g_list_length(applicationA->appcontrol),
       g_list_length(applicationB->appcontrol));
-  for (GList *a = applicationA->appcontrol, *b = applicationB->appcontrol;
+  for (GLista = applicationA->appcontrol, *b = applicationB->appcontrol;
       a && b; a = a->next, b = b->next) {
-    appcontrol_x *appcontrol_a = reinterpret_cast<appcontrol_x *>(a->data);
-    appcontrol_x *appcontrol_b = reinterpret_cast<appcontrol_x *>(b->data);
+    appcontrol_x* appcontrol_a = reinterpret_cast<appcontrol_x*>(a->data);
+    appcontrol_x* appcontrol_b = reinterpret_cast<appcontrol_x*>(b->data);
     STR_EQ(appcontrol_a->id, appcontrol_b->id);
     STR_EQ(appcontrol_a->mime, appcontrol_b->mime);
     STR_EQ(appcontrol_a->operation, appcontrol_b->operation);
@@ -345,13 +344,12 @@ bool IsEqualApplication(application_x *applicationA,
 
   INT_EQ(g_list_length(applicationA->splashscreens),
       g_list_length(applicationB->splashscreens));
-  for (GList *a = applicationA->splashscreens,
-      *b = applicationB->splashscreens;
+  for (GList* a = applicationA->splashscreens, *b = applicationB->splashscreens;
       a && b; a = a->next, b = b->next) {
-    splashscreen_x *splashscreen_a =
-        reinterpret_cast<splashscreen_x *>(a->data);
-    splashscreen_x *splashscreen_b =
-        reinterpret_cast<splashscreen_x *>(b->data);
+    splashscreen_xsplashscreen_a =
+        reinterpret_cast<splashscreen_x*>(a->data);
+    splashscreen_xsplashscreen_b =
+        reinterpret_cast<splashscreen_x*>(b->data);
     STR_EQ(splashscreen_a->color_depth, splashscreen_b->color_depth);
     STR_EQ(splashscreen_a->indicatordisplay, splashscreen_b->indicatordisplay);
     STR_EQ(splashscreen_a->operation, splashscreen_b->operation);
@@ -363,8 +361,8 @@ bool IsEqualApplication(application_x *applicationA,
   return true;
 }
 
-bool IsEqualApplicationsStructure(const std::vector<application_x *>& applicationsA,
-    const std::vector<application_x *>& applicationsB) {
+bool IsEqualApplicationsStructure(const std::vector<application_x*>& applicationsA,
+    const std::vector<application_x*>& applicationsB) {
 
   for (unsigned int i = 0; i < applicationsA.size(); ++i) {
     if (!IsEqualApplication(applicationsA[i], applicationsB[i]))
@@ -376,8 +374,8 @@ bool IsEqualApplicationsStructure(const std::vector<application_x *>& applicatio
   return true;
 }
 
-bool IsEqualApplicationsInfo(const std::vector<application_x *>& applicationsA,
-    const std::vector<application_x *>& applicationsB) {
+bool IsEqualApplicationsInfo(const std::vector<application_x*>& applicationsA,
+    const std::vector<application_x*>& applicationsB) {
   for (unsigned int i = 0; i < applicationsA.size(); ++i) {
     if (!IsEqualApplication(applicationsA[i], applicationsB[i]))
       return false;
@@ -386,8 +384,8 @@ bool IsEqualApplicationsInfo(const std::vector<application_x *>& applicationsA,
   return true;
 }
 
-package_x *GetTestPackage(std::string pkgid) {
-  package_x *package;
+package_xGetTestPackage(std::string pkgid) {
+  package_xpackage;
   package = reinterpret_cast<package_x*>(calloc(1, sizeof(package_x)));
 
   package->for_all_users = strdup("false");
@@ -505,15 +503,15 @@ package_x *GetTestPackage(std::string pkgid) {
   return package;
 }
 
-bool IsEqualPackageExtraInfo(package_x *packageA, package_x *packageB) {
+bool IsEqualPackageExtraInfo(package_x* packageA, package_x* packageB) {
   STR_EQ(packageA->ns, packageB->ns);
   STR_EQ(packageA->backend_installer, packageB->backend_installer);
   STR_EQ(packageA->use_system_certs, packageB->use_system_certs);
 
-  for (GList *a = packageA->icon, *b = packageB->icon;
+  for (GLista = packageA->icon, *b = packageB->icon;
       a && b; a = a->next, b = b->next) {
-    icon_x *icon_a = reinterpret_cast<icon_x *>(a->data);
-    icon_x *icon_b = reinterpret_cast<icon_x *>(b->data);
+    icon_x* icon_a = reinterpret_cast<icon_x*>(a->data);
+    icon_x* icon_b = reinterpret_cast<icon_x*>(b->data);
     STR_EQ(icon_a->dpi, icon_b->dpi);
     STR_EQ(icon_a->resolution, icon_b->resolution);
     STR_EQ(icon_a->section, icon_b->section);
@@ -521,18 +519,18 @@ bool IsEqualPackageExtraInfo(package_x *packageA, package_x *packageB) {
   }
 
   INT_EQ(g_list_length(packageA->label), g_list_length(packageB->label));
-  for (GList *a = packageA->label, *b = packageB->label;
+  for (GLista = packageA->label, *b = packageB->label;
       a && b; a = a->next, b = b->next) {
-    label_x *label_a = reinterpret_cast<label_x *>(a->data);
-    label_x *label_b = reinterpret_cast<label_x *>(b->data);
+    label_x* label_a = reinterpret_cast<label_x*>(a->data);
+    label_x* label_b = reinterpret_cast<label_x*>(b->data);
     STR_EQ(label_a->name, label_b->name);
   }
 
   INT_EQ(g_list_length(packageA->author), g_list_length(packageB->author));
-  for (GList *a = packageA->author, *b = packageB->author;
+  for (GLista = packageA->author, *b = packageB->author;
       a && b; a = a->next, b = b->next) {
-    author_x *author_a = reinterpret_cast<author_x *>(a->data);
-    author_x *author_b = reinterpret_cast<author_x *>(b->data);
+    author_x* author_a = reinterpret_cast<author_x* >(a->data);
+    author_x* author_b = reinterpret_cast<author_x* >(b->data);
     STR_EQ(author_a->email, author_b->email);
     STR_EQ(author_a->href, author_b->href);
     STR_EQ(author_a->lang, author_b->lang);
@@ -541,32 +539,31 @@ bool IsEqualPackageExtraInfo(package_x *packageA, package_x *packageB) {
 
   INT_EQ(g_list_length(packageA->description),
       g_list_length(packageB->description));
-  for (GList *a = packageA->description, *b = packageB->description;
+  for (GLista = packageA->description, *b = packageB->description;
       a && b; a = a->next, b = b->next) {
-    description_x *description_a = reinterpret_cast<description_x *>(a->data);
-    description_x *description_b = reinterpret_cast<description_x *>(b->data);
+    description_x* description_a = reinterpret_cast<description_x* >(a->data);
+    description_x* description_b = reinterpret_cast<description_x* >(b->data);
     STR_EQ(description_a->name, description_b->name);
   }
 
   INT_EQ(g_list_length(packageA->provides_appdefined_privileges),
       g_list_length(packageB->provides_appdefined_privileges));
-  for (GList *a = packageA->provides_appdefined_privileges,
-      *b = packageB->provides_appdefined_privileges;
+  for (GList* a = packageA->provides_appdefined_privileges, *b = packageB->provides_appdefined_privileges;
       a && b; a = a->next, b = b->next) {
-    appdefined_privilege_x *privilege_a =
-        reinterpret_cast<appdefined_privilege_x *>(a->data);
-    appdefined_privilege_x *privilege_b =
-        reinterpret_cast<appdefined_privilege_x *>(b->data);
+    appdefined_privilege_xprivilege_a =
+        reinterpret_cast<appdefined_privilege_x>(a->data);
+    appdefined_privilege_xprivilege_b =
+        reinterpret_cast<appdefined_privilege_x>(b->data);
     STR_EQ(privilege_a->license, privilege_b->license);
     STR_EQ(privilege_a->type, privilege_b->type);
     STR_EQ(privilege_a->value, privilege_b->value);
   }
 
   INT_EQ(g_list_length(packageA->plugin), g_list_length(packageB->plugin));
-  for (GList *a = packageA->plugin, *b = packageB->plugin;
+  for (GLista = packageA->plugin, *b = packageB->plugin;
       a && b; a = a->next, b = b->next) {
-    plugin_x *plugin_a = reinterpret_cast<plugin_x *>(a->data);
-    plugin_x *plugin_b = reinterpret_cast<plugin_x *>(b->data);
+    plugin_x* plugin_a = reinterpret_cast<plugin_x*>(a->data);
+    plugin_x* plugin_b = reinterpret_cast<plugin_x*>(b->data);
     STR_EQ(plugin_a->appid, plugin_b->appid);
     STR_EQ(plugin_a->pkgid, plugin_b->pkgid);
     STR_EQ(plugin_a->plugin_name, plugin_b->plugin_name);
@@ -575,10 +572,10 @@ bool IsEqualPackageExtraInfo(package_x *packageA, package_x *packageB) {
 
   INT_EQ(g_list_length(packageA->application),
       g_list_length(packageB->application));
-  for (GList *a = packageA->application, *b = packageB->application;
+  for (GLista = packageA->application, *b = packageB->application;
       a && b; a = a->next, b = b->next) {
-    application_x *application_a = reinterpret_cast<application_x *>(a->data);
-    application_x *application_b = reinterpret_cast<application_x *>(b->data);
+    application_x* application_a = reinterpret_cast<application_x*>(a->data);
+    application_x* application_b = reinterpret_cast<application_x*>(b->data);
 
     if (!IsEqualApplication(application_a, application_b))
       return false;
@@ -589,7 +586,7 @@ bool IsEqualPackageExtraInfo(package_x *packageA, package_x *packageB) {
   return true;
 }
 
-bool IsEqualPackage(package_x *packageA, package_x *packageB) {
+bool IsEqualPackage(package_x* packageA, package_x* packageB) {
   STR_EQ(packageA->for_all_users, packageB->for_all_users);
   STR_EQ(packageA->package, packageB->package);
   STR_EQ(packageA->version, packageB->version);
@@ -618,52 +615,51 @@ bool IsEqualPackage(package_x *packageA, package_x *packageB) {
   STR_EQ(packageA->external_path, packageB->external_path);
 
   INT_EQ(g_list_length(packageA->icon), g_list_length(packageB->icon));
-  for (GList *a = packageA->icon, *b = packageB->icon;
+  for (GLista = packageA->icon, *b = packageB->icon;
       a && b; a = a->next, b = b->next) {
-    icon_x *icon_a = reinterpret_cast<icon_x *>(a->data);
-    icon_x *icon_b = reinterpret_cast<icon_x *>(b->data);
+    icon_x* icon_a = reinterpret_cast<icon_x*>(a->data);
+    icon_x* icon_b = reinterpret_cast<icon_x*>(b->data);
     STR_EQ(icon_a->lang, icon_b->lang);
     STR_EQ(icon_a->text, icon_b->text);
   }
 
   INT_EQ(g_list_length(packageA->label), g_list_length(packageB->label));
-  for (GList *a = packageA->label, *b = packageB->label;
+  for (GLista = packageA->label, *b = packageB->label;
       a && b; a = a->next, b = b->next) {
-    label_x *label_a = reinterpret_cast<label_x *>(a->data);
-    label_x *label_b = reinterpret_cast<label_x *>(b->data);
+    label_x* label_a = reinterpret_cast<label_x*>(a->data);
+    label_x* label_b = reinterpret_cast<label_x*>(b->data);
     STR_EQ(label_a->lang, label_b->lang);
     STR_EQ(label_a->text, label_b->text);
   }
 
   INT_EQ(g_list_length(packageA->description),
       g_list_length(packageB->description));
-  for (GList *a = packageA->description, *b = packageB->description;
+  for (GLista = packageA->description, *b = packageB->description;
       a && b; a = a->next, b = b->next) {
-    description_x *description_a = reinterpret_cast<description_x *>(a->data);
-    description_x *description_b = reinterpret_cast<description_x *>(b->data);
+    description_x* description_a = reinterpret_cast<description_x*>(a->data);
+    description_x* description_b = reinterpret_cast<description_x*>(b->data);
     STR_EQ(description_a->lang, description_b->lang);
     STR_EQ(description_a->text, description_b->text);
   }
 
   INT_EQ(g_list_length(packageA->privileges),
       g_list_length(packageB->privileges));
-  for (GList *a = packageA->privileges, *b = packageB->privileges;
+  for (GLista = packageA->privileges, *b = packageB->privileges;
       a && b; a = a->next, b = b->next) {
-    privilege_x *privilege_a = reinterpret_cast<privilege_x *>(a->data);
-    privilege_x *privilege_b = reinterpret_cast<privilege_x *>(b->data);
+    privilege_x* privilege_a = reinterpret_cast<privilege_x*>(a->data);
+    privilege_x* privilege_b = reinterpret_cast<privilege_x*>(b->data);
     STR_EQ(privilege_a->type, privilege_b->type);
     STR_EQ(privilege_a->value, privilege_b->value);
   }
 
   INT_EQ(g_list_length(packageA->appdefined_privileges),
       g_list_length(packageB->appdefined_privileges));
-  for (GList *a = packageA->appdefined_privileges,
-      *b = packageB->appdefined_privileges;
+  for (GList* a = packageA->appdefined_privileges, *b = packageB->appdefined_privileges;
       a && b; a = a->next, b = b->next) {
-    appdefined_privilege_x *privilege_a =
-        reinterpret_cast<appdefined_privilege_x *>(a->data);
-    appdefined_privilege_x *privilege_b =
-        reinterpret_cast<appdefined_privilege_x *>(b->data);
+    appdefined_privilege_xprivilege_a =
+        reinterpret_cast<appdefined_privilege_x*>(a->data);
+    appdefined_privilege_xprivilege_b =
+        reinterpret_cast<appdefined_privilege_x*>(b->data);
     STR_EQ(privilege_a->license, privilege_b->license);
     STR_EQ(privilege_a->type, privilege_b->type);
     STR_EQ(privilege_a->value, privilege_b->value);
@@ -671,10 +667,10 @@ bool IsEqualPackage(package_x *packageA, package_x *packageB) {
 
   INT_EQ(g_list_length(packageA->dependencies),
       g_list_length(packageB->dependencies));
-  for (GList *a = packageA->dependencies, *b = packageB->dependencies;
+  for (GLista = packageA->dependencies, *b = packageB->dependencies;
       a && b; a = a->next, b = b->next) {
-    dependency_x *dependency_a = reinterpret_cast<dependency_x *>(a->data);
-    dependency_x *dependency_b = reinterpret_cast<dependency_x *>(b->data);
+    dependency_x* dependency_a = reinterpret_cast<dependency_x*>(a->data);
+    dependency_x* dependency_b = reinterpret_cast<dependency_x*>(b->data);
     STR_EQ(dependency_a->depends_on, dependency_b->depends_on);
     STR_EQ(dependency_a->required_version, dependency_b->required_version);
     STR_EQ(dependency_a->type, dependency_b->type);
@@ -683,8 +679,8 @@ bool IsEqualPackage(package_x *packageA, package_x *packageB) {
   return true;
 }
 
-bool IsEqualPackagesStructure(const std::vector<package_x *>& packagesA,
-    const std::vector<package_x *>&packagesB) {
+bool IsEqualPackagesStructure(const std::vector<package_x*>& packagesA,
+    const std::vector<package_x*>&packagesB) {
   if (packagesA.size() != packagesB.size())
     return false;
 
@@ -698,8 +694,8 @@ bool IsEqualPackagesStructure(const std::vector<package_x *>& packagesA,
   return true;
 }
 
-bool IsEqualPackagesInfo(const std::vector<package_x *>& packagesA,
-    const std::vector<package_x *>&packagesB) {
+bool IsEqualPackagesInfo(const std::vector<package_x*>& packagesA,
+    const std::vector<package_x*>&packagesB) {
   if (packagesA.size() != packagesB.size())
     return false;
 
@@ -711,35 +707,35 @@ bool IsEqualPackagesInfo(const std::vector<package_x *>& packagesA,
   return true;
 }
 
-pkgmgrinfo_filter_x *GetTestFilter() {
-  pkgmgrinfo_filter_x *filter;
-  pkgmgrinfo_node_x *node;
-  pkgmgrinfo_metadata_node_x *metadata_node;
+pkgmgrinfo_filter_xGetTestFilter() {
+  pkgmgrinfo_filter_xfilter;
+  pkgmgrinfo_node_xnode;
+  pkgmgrinfo_metadata_node_xmetadata_node;
   filter = reinterpret_cast<pkgmgrinfo_filter_x*>(
       calloc(1, sizeof(pkgmgrinfo_filter_x)));
 
   filter->uid = 1234;
-  node = reinterpret_cast<pkgmgrinfo_node_x *>(
+  node = reinterpret_cast<pkgmgrinfo_node_x*>(
       calloc(1, sizeof(pkgmgrinfo_node_x)));
   node->prop = 4321;
   node->key = strdup("test_key1");
   node->value = strdup("test_value1");
   filter->list = g_slist_append(filter->list, node);
 
-  node = reinterpret_cast<pkgmgrinfo_node_x *>(
+  node = reinterpret_cast<pkgmgrinfo_node_x*>(
       calloc(1, sizeof(pkgmgrinfo_node_x)));
   node->prop = 4321;
   node->key = strdup("test_key2");
   node->value = strdup("test_value2");
   filter->list = g_slist_append(filter->list, node);
 
-  metadata_node = reinterpret_cast<pkgmgrinfo_metadata_node_x *>(
+  metadata_node = reinterpret_cast<pkgmgrinfo_metadata_node_x*>(
       calloc(1, sizeof(pkgmgrinfo_metadata_node_x)));
   metadata_node->key = strdup("test_metadata_key1");
   metadata_node->value = strdup("test_metadata_value1");
   filter->list_metadata = g_slist_append(filter->list_metadata, metadata_node);
 
-  metadata_node = reinterpret_cast<pkgmgrinfo_metadata_node_x *>(
+  metadata_node = reinterpret_cast<pkgmgrinfo_metadata_node_x*>(
       calloc(1, sizeof(pkgmgrinfo_metadata_node_x)));
   metadata_node->key = strdup("test_metadata_key2");
   metadata_node->value = strdup("test_metadata_value2");
@@ -748,15 +744,15 @@ pkgmgrinfo_filter_x *GetTestFilter() {
   return filter;
 }
 
-bool IsEqualFilter(const pkgmgrinfo_filter_x *filterA,
-    const pkgmgrinfo_filter_x *filterB) {
+bool IsEqualFilter(const pkgmgrinfo_filter_xfilterA,
+    const pkgmgrinfo_filter_xfilterB) {
   INT_EQ(filterA->uid, filterB->uid);
 
   INT_EQ(g_slist_length(filterA->list), g_slist_length(filterB->list));
-  for (GSList *a = filterA->list, *b = filterB->list;
+  for (GSLista = filterA->list, *b = filterB->list;
       a && b; a = a->next, b = b->next) {
-    pkgmgrinfo_node_x *node_a = reinterpret_cast<pkgmgrinfo_node_x *>(a->data);
-    pkgmgrinfo_node_x *node_b = reinterpret_cast<pkgmgrinfo_node_x *>(b->data);
+    pkgmgrinfo_node_x* node_a = reinterpret_cast<pkgmgrinfo_node_x*>(a->data);
+    pkgmgrinfo_node_x* node_b = reinterpret_cast<pkgmgrinfo_node_x*>(b->data);
     INT_EQ(node_a->prop, node_b->prop);
     STR_EQ(node_a->key, node_b->key);
     STR_EQ(node_a->value, node_b->value);
@@ -764,12 +760,12 @@ bool IsEqualFilter(const pkgmgrinfo_filter_x *filterA,
 
   INT_EQ(g_slist_length(filterA->list_metadata),
       g_slist_length(filterB->list_metadata));
-  for (GSList *a = filterA->list_metadata, *b = filterB->list_metadata;
+  for (GSLista = filterA->list_metadata, *b = filterB->list_metadata;
       a && b; a = a->next, b = b->next) {
-    pkgmgrinfo_metadata_node_x *node_a =
-        reinterpret_cast<pkgmgrinfo_metadata_node_x *>(a->data);
-    pkgmgrinfo_metadata_node_x *node_b =
-        reinterpret_cast<pkgmgrinfo_metadata_node_x *>(b->data);
+    pkgmgrinfo_metadata_node_xnode_a =
+        reinterpret_cast<pkgmgrinfo_metadata_node_x*>(a->data);
+    pkgmgrinfo_metadata_node_xnode_b =
+        reinterpret_cast<pkgmgrinfo_metadata_node_x*>(b->data);
     STR_EQ(node_a->key, node_b->key);
     STR_EQ(node_a->value, node_b->value);
   }
@@ -777,8 +773,8 @@ bool IsEqualFilter(const pkgmgrinfo_filter_x *filterA,
   return true;
 }
 
-pkgmgr_certinfo_x *GetTestCertInfo() {
-  pkgmgr_certinfo_x *cert_info;
+pkgmgr_certinfo_xGetTestCertInfo() {
+  pkgmgr_certinfo_xcert_info;
   cert_info = reinterpret_cast<pkgmgr_certinfo_x*>(
       calloc(1, sizeof(pkgmgr_certinfo_x)));
 
@@ -797,8 +793,8 @@ pkgmgr_certinfo_x *GetTestCertInfo() {
   return cert_info;
 }
 
-bool IsEqualCertInfo(const pkgmgr_certinfo_x *certA,
-    const pkgmgr_certinfo_x *certB) {
+bool IsEqualCertInfo(const pkgmgr_certinfo_xcertA,
+    const pkgmgr_certinfo_xcertB) {
   INT_EQ(certA->for_all_users, certB->for_all_users);
   STR_EQ(certA->pkgid, certB->pkgid);
   STR_EQ(certA->cert_value, certB->cert_value);
@@ -810,9 +806,9 @@ bool IsEqualCertInfo(const pkgmgr_certinfo_x *certA,
   return true;
 }
 
-dependency_x *GetTestDepInfo(std::string pkgid) {
-  dependency_x *dependency;
-  dependency = reinterpret_cast<dependency_x *>(
+dependency_xGetTestDepInfo(std::string pkgid) {
+  dependency_xdependency;
+  dependency = reinterpret_cast<dependency_x*>(
       calloc(1, sizeof(dependency_x)));
 
   dependency->pkgid = strdup(pkgid.c_str());
@@ -823,13 +819,13 @@ dependency_x *GetTestDepInfo(std::string pkgid) {
   return dependency;
 }
 
-bool IsEqualDepInfo(const std::vector<dependency_x *>& depA,
-    const std::vector<dependency_x *>& depB) {
+bool IsEqualDepInfo(const std::vector<dependency_x*>& depA,
+    const std::vector<dependency_x*>& depB) {
   INT_EQ(depA.size(), depB.size());
 
   for (int i = 0; i < static_cast<int>(depA.size()); ++i) {
-    dependency_x *A = depA[0];
-    dependency_x *B = depB[0];
+    dependency_xA = depA[0];
+    dependency_xB = depB[0];
     STR_EQ(A->depends_on, B->depends_on);
     STR_EQ(A->pkgid, B->pkgid);
     STR_EQ(A->required_version, B->required_version);
index 487afdcee4c1562126aebbb48775d0affd5c1143..cfade927dd00700e4a9899431538a140d0efdf5f 100644 (file)
 
 application_x *GetTestApplication(std::string appid);
 
-bool IsEqualApplicationsStructure(const std::vector<application_x *>& applicationsA,
-    const std::vector<application_x *>& applicationsB);
+bool IsEqualApplicationsStructure(const std::vector<application_x*>& applicationsA,
+    const std::vector<application_x*>& applicationsB);
 
-bool IsEqualApplicationsInfo(const std::vector<application_x *>& applicationsA,
-    const std::vector<application_x *>& applicationsB);
+bool IsEqualApplicationsInfo(const std::vector<application_x*>& applicationsA,
+    const std::vector<application_x*>& applicationsB);
 
 package_x *GetTestPackage(std::string pkgid);
 
-bool IsEqualPackagesStructure(const std::vector<package_x *>&packagesA,
-    const std::vector<package_x *>&packagesB);
+bool IsEqualPackagesStructure(const std::vector<package_x*>&packagesA,
+    const std::vector<package_x*>&packagesB);
 
-bool IsEqualPackagesInfo(const std::vector<package_x *>&packagesA,
-    const std::vector<package_x *>&packagesB);
+bool IsEqualPackagesInfo(const std::vector<package_x*>&packagesA,
+    const std::vector<package_x*>&packagesB);
 
 pkgmgrinfo_filter_x *GetTestFilter();
 
index 9f197f54b4fc059d5ffa49f48fead1568920b0b5..f87537ef49940a5ce72114c45c7b4b0731303af5 100644 (file)
@@ -60,7 +60,7 @@ class PkgGetDBHandlerMock : public pkgmgr_server::database::PkgGetDBHandler {
   MOCK_METHOD0(GetConnection, std::vector<std::pair<sqlite3*, uid_t>>());
 };
 
-class Mocks : public :: testing::NiceMock<SystemInfoMock> {};
+class Mocks : public ::testing::NiceMock<SystemInfoMock> {};
 
 class AppInfoDBHandlerMock : public pkgmgr_server::database::AppInfoDBHandler {
  public: