[unittest/libnpuhost] Fix program size setting for the negative case
authorDongju Chae <dongju.chae@samsung.com>
Tue, 9 Mar 2021 09:47:10 +0000 (18:47 +0900)
committer송욱/On-Device Lab(SR)/Staff Engineer/삼성전자 <wook16.song@samsung.com>
Thu, 11 Mar 2021 07:46:00 +0000 (16:46 +0900)
This patch fixes the program size setting for the negative case.
To check `num_segments == 0`, the input program size should be not zero.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
tests/unittests/ne_core_npu_test.cc

index be997b8..8755496 100644 (file)
@@ -505,7 +505,7 @@ TEST (ne_core_npu_test, run_inference_async1_triv2)
  */
 TEST (ne_core_npu_test, run_inference_triv2_n)
 {
-  const size_t size = 4096;
+  const size_t size = 8192;
   std::unique_ptr<DriverAPI> api;
   model_config_t model;
   input_config_t input;
@@ -526,7 +526,7 @@ TEST (ne_core_npu_test, run_inference_triv2_n)
   model.version = 3;
   model.dbuf_fd = model_dmabuf;
   model.program_offset_addr = 0;
-  model.program_size = 0;
+  model.program_size = 4096;
 
   EXPECT_EQ (api->registerModel (&model, TEST_NPU_VERSION), 0);