Danny Robson
f6056153e3
This places, at long last, the core library code into the same namespace as the extended library code.
32 lines
591 B
C++
32 lines
591 B
C++
|
|
#include "endian.hpp"
|
|
|
|
#include "tap.hpp"
|
|
#include "platform.hpp"
|
|
|
|
#include <cstdlib>
|
|
#if defined(PLATFORM_WIN32)
|
|
#include <winsock2.h>
|
|
#else
|
|
#include <arpa/inet.h>
|
|
#include <netinet/in.h>
|
|
#endif
|
|
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
cruft::TAP::logger tap;
|
|
|
|
uint16_t u16 = 0x1358;
|
|
uint32_t u32 = 0x12345678;
|
|
|
|
tap.expect_eq (htons (u16), cruft::hton (u16), "htons");
|
|
tap.expect_eq (htonl (u32), cruft::hton (u32), "htonl");
|
|
|
|
tap.expect_eq (ntohs (u16), cruft::hton (u16), "ntohs");
|
|
tap.expect_eq (ntohl (u32), cruft::hton (u32), "ntohl");
|
|
|
|
return tap.status ();
|
|
}
|