[Test] Fix for initparser option
authorJiho Chu <jiho.chu@samsung.com>
Fri, 19 Jul 2024 11:02:10 +0000 (20:02 +0900)
committerWook Song <wook16.song@samsung.com>
Tue, 18 Mar 2025 07:28:09 +0000 (16:28 +0900)
It disables load ini config test when iniparser is disabled.

Signed-off-by: Jiho Chu <jiho.chu@samsung.com>
tests/unittests/ne_core_npu_test.cc
tests/unittests/ne_core_utils_test.cc

index 5fd2451de3cf673a9011fc838184c5414b8cdb0b..5d59a9f91dee5753ac481024b782166ef8a4866e 100644 (file)
@@ -28,9 +28,9 @@
 class NpuTest : public ::testing::Test {
  protected:
   static UtilTestEnv testenv;
-  int dev_len = testenv.get_dev_len ();
-  dev_type *devices = testenv.get_devices ();
-  dev_type type = testenv.get_devices ()[1];
+  int dev_len;
+  dev_type *devices;
+  dev_type type;
   std::unique_ptr<DriverAPI> api;
   model_config_t model = {};
   input_config_t input = {};
@@ -69,6 +69,10 @@ class NpuTest : public ::testing::Test {
     if (status) {
       std::cerr << "Failed to set test env\n";
     }
+
+    dev_len = testenv.get_dev_len ();
+    devices = testenv.get_devices ();
+    type = testenv.get_devices ()[1];
   }
 };
 
index 4c425d568423df797af204df24949b7b494a7cd8..3926d244787fa379f9bd1d8aa8118da4f31c8bf6 100644 (file)
@@ -97,6 +97,7 @@ TEST (ne_core_utils_test, load_conf_default) {
   restore_envvars (envvars);
 }
 
+#ifdef ENABLE_INIPARSER
 /**
  * @brief test loadConfIni()
  */
@@ -132,6 +133,7 @@ TEST (ne_core_utils_test, load_conf_ini) {
   conf.reset ();
   restore_envvars (envvars);
 }
+#endif
 
 /**
  * @brief test loadConfIni() with error handling