Skip to content

Commit 74ee1c3

Browse files
committed
[CodeClean/Test] use glib function
Code clean, use glib function to remove temp file for unittest. Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
1 parent 8fcbc9f commit 74ee1c3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/plugin-parser/unittest_mlops_plugin_parser.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
#include <glib.h>
1919
#include <gmodule.h>
20+
#include <glib/gstdio.h>
2021
#include <gio/gio.h>
2122
#include <gtest/gtest.h>
2223
#include <gmock/gmock.h>
@@ -395,7 +396,7 @@ TEST_F (PkgMgrInfoMockTestFixture, rpk_install7_n)
395396
ASSERT_TRUE (create_and_set_file (config_file_path, json_with_invalid_format));
396397
EXPECT_NE (exec_plugin_parser_func ("PKGMGR_MDPARSER_PLUGIN_INSTALL", pkgid, appid, NULL), 0);
397398

398-
if (remove (config_file_path) != 0) {
399+
if (g_remove (config_file_path) != 0) {
399400
g_printerr ("Error removing file: %s\n", g_strerror (errno));
400401
ASSERT_TRUE (false);
401402
}
@@ -413,7 +414,7 @@ TEST_F (PkgMgrInfoMockTestFixture, rpk_install7_n)
413414
ASSERT_TRUE (create_and_set_file (config_file_path, json_with_no_name));
414415
EXPECT_NE (exec_plugin_parser_func ("PKGMGR_MDPARSER_PLUGIN_INSTALL", pkgid, appid, NULL), 0);
415416

416-
if (remove (config_file_path) != 0) {
417+
if (g_remove (config_file_path) != 0) {
417418
g_printerr ("Error removing file: %s\n", g_strerror (errno));
418419
ASSERT_TRUE (false);
419420
}
@@ -430,7 +431,7 @@ TEST_F (PkgMgrInfoMockTestFixture, rpk_install7_n)
430431
ASSERT_TRUE (create_and_set_file (config_file_path, json_with_no_name_pipeline));
431432
EXPECT_NE (exec_plugin_parser_func ("PKGMGR_MDPARSER_PLUGIN_INSTALL", pkgid, appid, NULL), 0);
432433

433-
if (remove (config_file_path) != 0) {
434+
if (g_remove (config_file_path) != 0) {
434435
g_printerr ("Error removing file: %s\n", g_strerror (errno));
435436
ASSERT_TRUE (false);
436437
}
@@ -449,7 +450,7 @@ TEST_F (PkgMgrInfoMockTestFixture, rpk_install7_n)
449450
ASSERT_TRUE (create_and_set_file (config_file_path, json_with_no_name_resource));
450451
EXPECT_NE (exec_plugin_parser_func ("PKGMGR_MDPARSER_PLUGIN_INSTALL", pkgid, appid, NULL), 0);
451452

452-
if (remove (config_file_path) != 0) {
453+
if (g_remove (config_file_path) != 0) {
453454
g_printerr ("Error removing file: %s\n", g_strerror (errno));
454455
ASSERT_TRUE (false);
455456
}

0 commit comments

Comments
 (0)