/*1* Copyright (c) 2013 R. Tyler Croy, All rights reserved.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*15*/1617#include "liblaunch_test.h"1819/*20* TEST: host2wire21*****************************************************/22void test_host2wire_64(void **state) {23/*24uint64_t host_int = 1024;25uint64_t wire_int = host2wire(host_int);26*/27/* Nothing to test here on a big-endian system, and we can't verify because28* htonll() doesn't exist */29};3031void test_host2wire_32(void **state) {32uint32_t host_int = 1024;33uint32_t wire_int = htonl(host_int);34assert_true(wire_int == host2wire(host_int));35};3637void test_host2wire_16(void **state) {38uint16_t host_int = 32;39uint16_t wire_int = htons(host_int);40assert_true(wire_int == host2wire(host_int));41};4243void test_host2wire_8(void **state) {44uint8_t host_int = 8;45assert_true(host_int == host2wire(host_int));46};47/*****************************************************/4849#include <stdio.h>50/*51* TEST: wire2host52*****************************************************/53void test_wire2host_64(void **s) {54uint64_t wire_int = htobe64(1024);55uint64_t host_int = 1024;56assert_true(host_int == wire2host(wire_int));57};5859void test_wire2host_32(void **s) {60uint32_t wire_int = htonl(32);61uint32_t host_int = 32;62assert_true(host_int == wire2host(wire_int));63};6465void test_wire2host_16(void **s) {66uint16_t wire_int = htons(32);67uint16_t host_int = 32;68assert_true(host_int == wire2host(wire_int));69};7071void test_wire2host_8(void **s) {72uint8_t host_int = 8;73assert_true(host_int = wire2host(host_int));74};75/****************************************************/767778