From 62c42b72e54e91187b0777951ab2155031075a4d Mon Sep 17 00:00:00 2001 From: zhang Date: Thu, 9 Sep 2021 16:37:35 +0800 Subject: [PATCH 1/2] modify reviewbot warning Signed-off-by: zhang --- support/posix/test/unittest/common/hdf_osal_test.cpp | 9 +++++---- .../posix/test/unittest/common/hdf_osal_test_posix.cpp | 8 ++++---- test/unittest/osal/osal_all_test.c | 2 +- test/unittest/osal/osal_get_case_test.c | 1 - 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/support/posix/test/unittest/common/hdf_osal_test.cpp b/support/posix/test/unittest/common/hdf_osal_test.cpp index 889f3b96..409e3484 100644 --- a/support/posix/test/unittest/common/hdf_osal_test.cpp +++ b/support/posix/test/unittest/common/hdf_osal_test.cpp @@ -13,14 +13,12 @@ #include #include #include -#include "osal_test_case_def.h" -#include "hdf_uhdf_test.h" #include "hdf_io_service_if.h" +#include "hdf_uhdf_test.h" +#include "osal_test_case_def.h" using namespace testing::ext; -static const int OSAL_TEST_TIME = 30; -static const int OSAL_WAIT_END_TIME = 5; static const char *OSAL_FW_PATH = "/lib/firmware"; static const int OSAL_FW_PATH_MODE = 0x777; #define OSAL_TEST_FUNC_DEFINE(subCmd) do { \ @@ -35,6 +33,9 @@ public: static void TearDownTestCase(); void SetUp(); void TearDown(); +private: + const int OSAL_TEST_TIME = 30; + const int OSAL_WAIT_END_TIME = 5; }; static void OsalCreateDir(bool flag) diff --git a/support/posix/test/unittest/common/hdf_osal_test_posix.cpp b/support/posix/test/unittest/common/hdf_osal_test_posix.cpp index ae22b4fd..d847cacc 100755 --- a/support/posix/test/unittest/common/hdf_osal_test_posix.cpp +++ b/support/posix/test/unittest/common/hdf_osal_test_posix.cpp @@ -13,9 +13,9 @@ #include #include #include -#include "osal_test_case_def.h" #include "hdf_uhdf_test.h" #include "osal_get_case_test.h" +#include "osal_test_case_def.h" int32_t HdfOsalUserEntry(enum HdfOsalTestCaseCmd cmd) { @@ -41,9 +41,6 @@ int32_t HdfOsalUserEntry(enum HdfOsalTestCaseCmd cmd) using namespace testing::ext; -static const int OSAL_TEST_TIME = 30; -static const int OSAL_WAIT_END_TIME = 5; - #define OSAL_TEST_FUNC_DEFINE(subCmd) do { \ printf("OSAL test enter cmd:%d\n\r", subCmd); \ EXPECT_EQ(0, HdfOsalUserEntry(subCmd)); \ @@ -55,6 +52,9 @@ public: static void TearDownTestCase(); void SetUp(); void TearDown(); +private: + const int OSAL_TEST_TIME = 30; + const int OSAL_WAIT_END_TIME = 5; }; void OsalTest::SetUpTestCase() diff --git a/test/unittest/osal/osal_all_test.c b/test/unittest/osal/osal_all_test.c index d07f050c..65a1c05d 100644 --- a/test/unittest/osal/osal_all_test.c +++ b/test/unittest/osal/osal_all_test.c @@ -806,7 +806,7 @@ int OsaTestBegin(void) #ifndef __USER__ ret = OsalTestFileInit(); #else - ret = 0; + ret = 0; #endif OsalTestOther(ret); OsaTimeTest(); diff --git a/test/unittest/osal/osal_get_case_test.c b/test/unittest/osal/osal_get_case_test.c index 63729bbd..fccdc5a6 100644 --- a/test/unittest/osal/osal_get_case_test.c +++ b/test/unittest/osal/osal_get_case_test.c @@ -6,7 +6,6 @@ * See the LICENSE file in the root of this repository for complete details. */ -#include "hdf_log.h" #include "osal_case_cmd_test.h" int OsalGetTestResult(uint32_t cmd) From 5ce7e705fd0044fdb62aa5236e9c3bf8c4d139bc Mon Sep 17 00:00:00 2001 From: zhang Date: Thu, 9 Sep 2021 17:16:07 +0800 Subject: [PATCH 2/2] modify reviewbot warning Signed-off-by: zhang --- support/posix/test/unittest/common/hdf_osal_test.cpp | 4 ++-- support/posix/test/unittest/common/hdf_osal_test_posix.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/support/posix/test/unittest/common/hdf_osal_test.cpp b/support/posix/test/unittest/common/hdf_osal_test.cpp index 409e3484..0f904f28 100644 --- a/support/posix/test/unittest/common/hdf_osal_test.cpp +++ b/support/posix/test/unittest/common/hdf_osal_test.cpp @@ -34,8 +34,8 @@ public: void SetUp(); void TearDown(); private: - const int OSAL_TEST_TIME = 30; - const int OSAL_WAIT_END_TIME = 5; + static const int OSAL_TEST_TIME = 30; + static const int OSAL_WAIT_END_TIME = 5; }; static void OsalCreateDir(bool flag) diff --git a/support/posix/test/unittest/common/hdf_osal_test_posix.cpp b/support/posix/test/unittest/common/hdf_osal_test_posix.cpp index d847cacc..5b1101a9 100755 --- a/support/posix/test/unittest/common/hdf_osal_test_posix.cpp +++ b/support/posix/test/unittest/common/hdf_osal_test_posix.cpp @@ -53,8 +53,8 @@ public: void SetUp(); void TearDown(); private: - const int OSAL_TEST_TIME = 30; - const int OSAL_WAIT_END_TIME = 5; + static const int OSAL_TEST_TIME = 30; + static const int OSAL_WAIT_END_TIME = 5; }; void OsalTest::SetUpTestCase()