mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-25 20:33:35 +00:00
34 lines
755 B
C++
34 lines
755 B
C++
|
//---------------------------------------------------------------------------
|
||
|
//
|
||
|
// SCSI Target Emulator PiSCSI
|
||
|
// for Raspberry Pi
|
||
|
//
|
||
|
// Copyright (C) 2023 Uwe Seimet
|
||
|
//
|
||
|
//---------------------------------------------------------------------------
|
||
|
|
||
|
#include <gtest/gtest.h>
|
||
|
|
||
|
#include <netdb.h>
|
||
|
#include <netinet/in.h>
|
||
|
#include "shared/network_util.h"
|
||
|
|
||
|
using namespace network_util;
|
||
|
|
||
|
TEST(NetworkUtilTest, IsInterfaceUp)
|
||
|
{
|
||
|
EXPECT_FALSE(IsInterfaceUp("foo_bar"));
|
||
|
}
|
||
|
|
||
|
TEST(NetworkUtilTest, GetNetworkInterfaces)
|
||
|
{
|
||
|
EXPECT_FALSE(GetNetworkInterfaces().empty());
|
||
|
}
|
||
|
|
||
|
TEST(NetworkUtilTest, ResolveHostName)
|
||
|
{
|
||
|
sockaddr_in server_addr = {};
|
||
|
EXPECT_FALSE(ResolveHostName("foo.foobar", &server_addr));
|
||
|
EXPECT_TRUE(ResolveHostName("127.0.0.1", &server_addr));
|
||
|
}
|