Skip to content

Commit

Permalink
test: servicedb c99-designator fix follow-up
Browse files Browse the repository at this point in the history
As this removal of enum index is itching,
I've added an assurance.

Related to #30

Signed-off-by: MyungJoo Ham <[email protected]>
  • Loading branch information
myungjoo authored and jaeyun-jung committed Feb 19, 2024
1 parent bd0fa62 commit cf48cee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/daemon/unittest_service_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,24 @@ TEST (serviceDBNotInitalized, delete_resource_n)
}
}

extern
const char *g_mlsvc_table_schema_v1; /* from service-db.cc */

Check warning on line 679 in tests/daemon/unittest_service_db.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/daemon/unittest_service_db.cc:679:13 [cppcoreguidelines-avoid-non-const-global-variables]

variable 'g_mlsvc_table_schema_v1' is non-const and globally accessible, consider making it const
/**
* @brief Test g_mlsvc_table_schema_v1 index correctness
*/
TEST (serviceDBtablelist, declaration_index_check_p)

Check warning on line 683 in tests/daemon/unittest_service_db.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/daemon/unittest_service_db.cc:683:1 [modernize-use-trailing-return-type]

use a trailing return type for this function

Check warning on line 683 in tests/daemon/unittest_service_db.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/daemon/unittest_service_db.cc:683:25 [readability-named-parameter]

all parameters should be named in a function
{
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.
*/
Expand Down

0 comments on commit cf48cee

Please sign in to comment.