暂存文件

This commit is contained in:
huanglinhuan
2025-12-12 21:54:52 +08:00
parent 96fecf3c6f
commit 91ae52eeb3
13 changed files with 631 additions and 85 deletions

View File

@@ -0,0 +1,38 @@
#include <gtest/gtest.h>
#include "displayflow/core/session/session_manager.h"
using namespace displayflow::core;
class SessionManagerTest : public ::testing::Test {
protected:
void SetUp() override {
manager_ = std::make_shared<SessionManager>();
}
void TearDown() override {
manager_.reset();
}
std::shared_ptr<SessionManager> manager_;
};
TEST_F(SessionManagerTest, CreateSession) {
auto session = manager_->CreateSession(RoleType::Host);
ASSERT_NE(session, nullptr);
EXPECT_EQ(session->GetRole(), RoleType::Host);
}
TEST_F(SessionManagerTest, GetSession) {
auto session = manager_->CreateSession(RoleType::Client);
ASSERT_NE(session, nullptr);
SessionId id = session->GetId();
auto retrieved = manager_->GetSession(id);
ASSERT_NE(retrieved, nullptr);
EXPECT_EQ(retrieved->GetId(), id);
}
// 添加更多测试...