修复编译错误问题

This commit is contained in:
linianlin 2026-05-08 12:13:02 +08:00
parent bd91d51c7a
commit 4fc7a6a344
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ FetchContent_Declare(
# For Windows: Prevent overriding the parent project's compiler/linker settings # For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest) FetchContent_MakeAvailable(googletest)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)

View File

@ -23,7 +23,7 @@ protected:
TEST_F(CmsEngineTest, TestPushNotification_Normal) { TEST_F(CmsEngineTest, TestPushNotification_Normal) {
NotificationMessage msg; NotificationMessage msg;
msg.id = "NOTIF-001"; msg.id = "NOTIF-001";
msg.content = "Test notification"; msg.summary = "Test notification";
msg.isRead = false; msg.isRead = false;
EXPECT_NO_THROW(engine_->pushNotification(msg)); EXPECT_NO_THROW(engine_->pushNotification(msg));
@ -41,12 +41,12 @@ TEST_F(CmsEngineTest, TestGetUnreadNotifications_Empty) {
TEST_F(CmsEngineTest, TestGetUnreadNotifications_Mixed) { TEST_F(CmsEngineTest, TestGetUnreadNotifications_Mixed) {
NotificationMessage readMsg; NotificationMessage readMsg;
readMsg.id = "READ-001"; readMsg.id = "READ-001";
readMsg.content = "Read message"; readMsg.summary = "Read message";
readMsg.isRead = true; readMsg.isRead = true;
NotificationMessage unreadMsg; NotificationMessage unreadMsg;
unreadMsg.id = "UNREAD-001"; unreadMsg.id = "UNREAD-001";
unreadMsg.content = "Unread message"; unreadMsg.summary = "Unread message";
unreadMsg.isRead = false; unreadMsg.isRead = false;
engine_->pushNotification(readMsg); engine_->pushNotification(readMsg);