From 3daf05fa023d74558838b47e52e59163923401b6 Mon Sep 17 00:00:00 2001 From: xiaojiazhu <258828110.@qq.com> Date: Fri, 8 Sep 2023 20:51:00 -0700 Subject: [PATCH] Fix log enum type parameter. --- test/hal/src/IHalTest.cpp | 6 +++--- test/utils/CMakeLists.txt | 2 +- test/utils/Log/src/ILogTest.cpp | 2 +- utils/Log/abstract/ILog.cpp | 2 +- utils/Log/include/ILog.h | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/hal/src/IHalTest.cpp b/test/hal/src/IHalTest.cpp index e90d2ad..c51cffe 100644 --- a/test/hal/src/IHalTest.cpp +++ b/test/hal/src/IHalTest.cpp @@ -1,5 +1,5 @@ -#include "Log.h" +#include "ILog.h" #include "IHal.h" #include #include @@ -8,7 +8,7 @@ namespace IHalTest // ../out/test/bin/IHalTest --gtest_filter=IHalTest.Demo TEST(IHalTest, Demo) { - InitLog(LOG_EASYLOGGING, nullptr); + ILogInit(LOG_EASYLOGGING); create_hal_module(); StatusCode code = IHalInit(); if (IsCodeOK(code)) @@ -17,6 +17,6 @@ namespace IHalTest } IHalUnInit(); destroy_hal_module(); - UnInitLog(); + ILogUnInit(); } } \ No newline at end of file diff --git a/test/utils/CMakeLists.txt b/test/utils/CMakeLists.txt index 4743a92..de1d0b5 100644 --- a/test/utils/CMakeLists.txt +++ b/test/utils/CMakeLists.txt @@ -1,7 +1,7 @@ # cmake_minimum_required(VERSION 2.8.0) #Compile gtest for test code. -add_subdirectory(ReturnCode) +# add_subdirectory(ReturnCode) add_subdirectory(Log) diff --git a/test/utils/Log/src/ILogTest.cpp b/test/utils/Log/src/ILogTest.cpp index bb741e9..e364ccf 100644 --- a/test/utils/Log/src/ILogTest.cpp +++ b/test/utils/Log/src/ILogTest.cpp @@ -11,7 +11,7 @@ namespace ILogTest LogInfo("hello world."); LogError("create ... failed."); LogDebug("a = %d b = %s", 124, "apple"); - IHalUnInit(); + ILogUnInit(); DestroyLogModule(); } } // namespace ILogTest \ No newline at end of file diff --git a/utils/Log/abstract/ILog.cpp b/utils/Log/abstract/ILog.cpp index 0f2d0e5..ae9860a 100644 --- a/utils/Log/abstract/ILog.cpp +++ b/utils/Log/abstract/ILog.cpp @@ -1,7 +1,7 @@ #include "ILog.h" #include "ILogCpp.h" #include -static void ILogInitCallBack(ILog *object, const int log) +static void ILogInitCallBack(ILog *object, const enum LogInstance log) { return ILogCpp::GetInstance()->Init(log); } diff --git a/utils/Log/include/ILog.h b/utils/Log/include/ILog.h index c146bae..659bcd7 100644 --- a/utils/Log/include/ILog.h +++ b/utils/Log/include/ILog.h @@ -35,7 +35,7 @@ extern "C" typedef struct i_log ILog; typedef struct i_log { - void (*init)(ILog *, const int); + void (*init)(ILog *, const enum LogInstance); void (*free)(ILog *); int (*printf)(ILog *, const char *, const int, const int, const char *, ...); void (*un_init)(ILog *); @@ -43,11 +43,11 @@ extern "C" ILog *GetLogIntance(void); void NewILog(ILog **object); void ResetLogImpl(ILog *impl); - static inline void ILogInit(const int log) + static inline void ILogInit(const enum LogInstance log) { return GetLogIntance()->init(GetLogIntance(), log); } - static inline void ILolUnInit(void) + static inline void ILogUnInit(void) { return GetLogIntance()->un_init(GetLogIntance()); }