blob: 15090d07a923b6093224755503945bee432b6fcd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/*
* File: tests/net_test.cc
* Purpose: Network unit tests in C++
* Author: Amlal El Mahrouss (amlal@nekernel.org)
* Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License.
*/
#include <net/modem.hpp>
#include <io/print.hpp>
#include <tests/gtest.hpp>
#include <cstring>
TEST(NetworkTest, BasicNetworkUsage)
{
ocl::net::modem modem;
modem.construct<AF_INET, SOCK_STREAM, 8000>(ocl::net::modem::local_address_ip4, true);
EXPECT_TRUE(modem.is_valid());
std::basic_string<char> buf_dst = "HELLO, NET!";
EXPECT_TRUE(modem.transmit(buf_dst));
}
|