/*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: launch_data_get_errno21*****************************************************/22void test_launch_data_get_errno_null(void **state) {23launch_data_t d = NULL;24assert_int_equal(0, launch_data_get_errno(d));25};2627void test_launch_data_get_errno(void **state) {28struct _launch_data d;29d.err = 4;30assert_int_equal(4, launch_data_get_errno(&d));31}32/*****************************************************/3334/* TEST: launch_data_get_fd35*****************************************************/36void test_launch_data_get_fd_null(void **state) {37launch_data_t d = NULL;38assert_int_equal(0, launch_data_get_fd(d));39};4041/* TEST: launch_data_get_integer42*****************************************************/43void test_launch_data_get_integer_null(void **state) {44launch_data_t d = NULL;45assert_true(0 == launch_data_get_integer(d));46}4748void test_launch_data_get_integer(void **state) {49struct _launch_data d;50d.number = 7;51assert_true(7 == launch_data_get_integer(&d));52};53/*****************************************************/545556/* TEST: launch_data_get_bool57*****************************************************/58void test_launch_data_get_bool_default(void **state) {59struct _launch_data d;60assert_true(launch_data_get_bool(&d));61};6263void test_launch_data_get_bool_false(void **state) {64struct _launch_data d;65d.boolean = false;66assert_false(launch_data_get_bool(&d));67};68/*****************************************************/697071