1 /* 2 * epos/src/tests/testbench.h 3 * (c) 2005 geo@cuni.cz 4 * 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License in doc/COPYING for more details. 14 * 15 */ 16 17 #define THIS_IS_A_TTSCP_CLIENT 18 19 #include "config.h" /* You can usually remove this item */ 20 21 #include <stdlib.h> 22 #include <stdio.h> 23 #include <string.h> 24 #include <errno.h> 25 26 #include <unistd.h> 27 28 29 #define LITTLE_SPACE 320 30 #define MUCH_SPACE 16000 31 32 void init_connection_pair(int i); 33 const char *get_data_handle(int which); 34 char *much_data(); 35 36 void spk_appl(int c, int d, const char *data, int data_len); 37 void spk_appl(int c, int d, const char *data); 38 void spk_strm(int c, int d); 39 void spk_intr(int c, int broken); 40 char *xscr_strm(int c, int d); 41 char *xscr_appl(int c, int d, const char *data, int data_len); 42 char *xscr_appl(int c, int d, const char *data); // please no unprocessed stuff in c and d. 43 44 void generic_command(int c, char *cmd); 45 void generic_appl(int c, int d, const char *data, int data_len); 46 int get_result(int c); 47 48 int just_connect_socket(); 49 void send_to_epos(char *what, int socket); 50 void setl(int c, const char *name, const char *value); 51 52 53 /* 54 * These functions never return. Use them to specify the result of the test. 55 */ 56 57 void shriek(char *txt); // fail 58 void shriek(int, char *txt); // fail 59 // void testbench_exit(); // success 60 void follow_server_down(bool whether_success = true); 61 62 63 /* 64 * The following symbols should be defined by each test separately: 65 */ 66 67 extern void test_body(); 68 extern const char *test_name; 69