Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: servicedb c99-designator fix follow-up #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/daemon/unittest_service_db.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check notice on line 1 in tests/daemon/unittest_service_db.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

Run clang-format on tests/daemon/unittest_service_db.cc

File tests/daemon/unittest_service_db.cc does not conform to Custom style guidelines. (lines 678, 685, 686, 688, 689, 690, 692)
* @file unittest_service_db.cc
* @date 21 Mar 2023
* @brief Unit test for service DB used by ML Agent
Expand All @@ -7,7 +7,7 @@
* @bug No known bugs
*/

#include <gtest/gtest.h>

Check failure on line 10 in tests/daemon/unittest_service_db.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/daemon/unittest_service_db.cc:10:10 [clang-diagnostic-error]

'gtest/gtest.h' file not found
#include <gio/gio.h>

#include "log.h"
Expand Down Expand Up @@ -675,6 +675,24 @@
}
}

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
Loading