[Unittest] fix segmentation fault
authorYelin Jeong <yelini.jeong@samsung.com>
Tue, 19 Jul 2022 08:30:35 +0000 (17:30 +0900)
committer추지호/NPU Lab(SR)/삼성전자 <jiho.chu@samsung.com>
Thu, 21 Jul 2022 07:12:42 +0000 (16:12 +0900)
This patch fixes ne_core_handler_test.cc
model->getConstraint() should not be called if model is nullptr.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
tests/unittests/ne_core_handler_test.cc

index 3bcb603fd5105f9aa6a9bd69b5c6cffb6b76f770..f9dfc369be058a570e722812efc0721cee4f8d1d 100644 (file)
@@ -669,7 +669,7 @@ TEST (ne_core_handler_test, handler_set_constraint) {
   EXPECT_EQ (handler->setConstraint (modelid, constraint), 0);
 
   Model *model = handler->getModel (modelid);
-  EXPECT_NE (model, nullptr);
+  ASSERT_NE (model, nullptr);
   EXPECT_EQ (model->getConstraint ().priority, constraint.priority);
   EXPECT_EQ (model->getConstraint ().timeout_ms, constraint.timeout_ms);