35 lines
795 B
C++
35 lines
795 B
C++
|
|
#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);
|
||
|
|
}
|
||
|
|
|
||
|
|
// 添加更多测试...
|
||
|
|
|
||
|
|
|
||
|
|
|