/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* lib/krad/t_test.h - Shared declarations for libkrad test programs */2/*3* Copyright 2013 Red Hat, Inc. All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions are met:7*8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10*11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in13* the documentation and/or other materials provided with the14* distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS17* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED18* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A19* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER20* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,21* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,22* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR23* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF24* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING25* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS26* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27*/2829#ifndef T_TEST_H_30#define T_TEST_H_3132#include "internal.h"3334#include <sys/wait.h>35#include <signal.h>36#include <unistd.h>37#include <stdio.h>38#include <stdlib.h>39#include <string.h>4041#define insist(x) insist_impl(__FILE__, __LINE__, #x, x)42#define noerror(x) noerror_impl(__FILE__, __LINE__, #x, x)4344struct event {45krb5_boolean error;46union47{48krb5_error_code retval;49krad_code code;50} result;51};5253void54noerror_impl(const char *file, int line, const char *cmd, int retval);5556void57insist_impl(const char *file, int line, const char *cmd, krb5_boolean result);5859#endif /* T_TEST_H_ */606162