暂存文件
This commit is contained in:
34
tests/network/test_network_interface.cpp
Normal file
34
tests/network/test_network_interface.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "displayflow/core/network/network_interface.h"
|
||||
|
||||
using namespace displayflow::core;
|
||||
|
||||
class NetworkInterfaceTest : public ::testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
// 测试前准备
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
// 测试后清理
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(NetworkInterfaceTest, NetworkInterfaceCreation) {
|
||||
NetworkInterface interface;
|
||||
interface.type = NetworkType::WiFi;
|
||||
interface.name = "wlan0";
|
||||
interface.address = "192.168.1.100";
|
||||
interface.port = 8888;
|
||||
interface.isAvailable = true;
|
||||
|
||||
EXPECT_EQ(interface.type, NetworkType::WiFi);
|
||||
EXPECT_EQ(interface.name, "wlan0");
|
||||
EXPECT_EQ(interface.address, "192.168.1.100");
|
||||
EXPECT_TRUE(interface.isAvailable);
|
||||
}
|
||||
|
||||
// 添加更多测试...
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user