From 43db9499e9fbaf9c24191d67c8329fee482e0934 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Thu, 15 Feb 2024 18:38:13 +0900 Subject: [PATCH] test: servicedb c99-designator fix follow-up As this removal of enum index is itching, I've added an assurance. - Moved enum defintion for better cohesion. - Added gtest install to cpp-linter to avoid gtest-include-path error. Related to #30 Signed-off-by: MyungJoo Ham --- tests/daemon/unittest_service_db.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/daemon/unittest_service_db.cc b/tests/daemon/unittest_service_db.cc index a78906e..d99da0b 100644 --- a/tests/daemon/unittest_service_db.cc +++ b/tests/daemon/unittest_service_db.cc @@ -675,6 +675,24 @@ TEST (serviceDBNotInitalized, delete_resource_n) } } +extern +const char *g_mlsvc_table_schema_v1; /* from service-db.cc */ +/** + * @brief Test g_mlsvc_table_schema_v1 index correctness + */ +TEST (serviceDBtablelist, declaration_index_check_p) +{ + EXPECT_THAT (g_mlsvc_table_schema_v1[TBL_DB_INFO], + testing::StartsWith("tblMLDBInfo")); + EXPECT_THAT (g_mlsvc_table_schema_v1[TBL_PIPELINE_DESCRIPTION], + testing::StartsWith("tblPipeline")); + EXPECT_THAT (g_mlsvc_table_schema_v1[TBL_MODEL_INFO], + testing::StartsWith("tblModel")); + EXPECT_THAT (g_mlsvc_table_schema_v1[TBL_RESOURCE_INFO], + testing::StartsWith("tblResource")); + EXPECT_EQ (g_mlsvc_table_schema_v1[TBL_MAX], nullptr); +} + /** * @brief Negative test for service-db util. Invalid param case. */