1 1.4 sevan /* $NetBSD: pcnfsd_test.c,v 1.4 2018/01/23 21:06:25 sevan Exp $ */ 2 1.2 gwr 3 1.1 jtc /* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.pcnfsd_test.c 1.2 92/01/27 18:00:39 SMI */ 4 1.1 jtc #include <stdio.h> 5 1.1 jtc #include <rpc/rpc.h> 6 1.1 jtc #include <malloc.h> 7 1.1 jtc #include "pcnfsd.h" 8 1.1 jtc 9 1.1 jtc CLIENT *cl; 10 1.1 jtc CLIENT *cl2; 11 1.1 jtc char *server; 12 1.1 jtc char spooldirbuff[256]; 13 1.1 jtc char filenamebuff[256]; 14 1.1 jtc char last_id[32] = ""; 15 1.1 jtc 16 1.1 jtc void free_pr_list_item(); 17 1.1 jtc void free_pr_queue_item(); 18 1.1 jtc void good(); 19 1.1 jtc void bad(); 20 1.1 jtc 21 1.4 sevan int 22 1.4 sevan main(int argc, char *argv[]) 23 1.1 jtc { 24 1.1 jtc 25 1.1 jtc char *host_name; 26 1.1 jtc char *printer; 27 1.1 jtc char *user_name; 28 1.1 jtc char *passwd; 29 1.1 jtc char *transport = "udp"; 30 1.1 jtc 31 1.1 jtc if((argc < 6) || (argc > 7)) { 32 1.1 jtc fprintf(stderr, "usage: %s server host printer user password [transport]\n", 33 1.1 jtc argv[0]); 34 1.1 jtc exit(1); 35 1.1 jtc } 36 1.1 jtc 37 1.1 jtc server = argv[1]; 38 1.1 jtc host_name = argv[2]; 39 1.1 jtc printer = argv[3]; 40 1.1 jtc user_name = argv[4]; 41 1.1 jtc passwd = argv[5]; 42 1.1 jtc if (argc == 7) 43 1.1 jtc transport = argv[6]; 44 1.1 jtc 45 1.1 jtc cl = clnt_create(server, PCNFSDPROG, PCNFSDVERS, transport); 46 1.1 jtc if(cl == NULL) { 47 1.1 jtc clnt_pcreateerror(server); 48 1.1 jtc exit(1); 49 1.1 jtc } 50 1.1 jtc cl2 = clnt_create(server, PCNFSDPROG, PCNFSDV2, transport); 51 1.1 jtc if(cl2 == NULL) { 52 1.1 jtc clnt_pcreateerror(server); 53 1.1 jtc exit(1); 54 1.1 jtc } 55 1.1 jtc good(); 56 1.1 jtc test_v2_info(); 57 1.1 jtc good(); 58 1.1 jtc test_v2_auth(host_name, user_name, passwd); 59 1.1 jtc bad("Invalid password"); 60 1.1 jtc test_v2_auth(host_name, user_name, "bogus"); 61 1.1 jtc good(); 62 1.1 jtc test_v2_list(); 63 1.1 jtc good(); 64 1.1 jtc test_v2_init(host_name, printer); 65 1.1 jtc good(); 66 1.1 jtc test_v2_start(host_name, printer, user_name, "foo", "foo"); 67 1.1 jtc good(); 68 1.1 jtc test_v2_start(host_name, printer, user_name, "bar", "bar"); 69 1.1 jtc bad("No such file to print"); 70 1.1 jtc test_v2_start(host_name, printer, user_name, "bletch", "gack"); 71 1.1 jtc good(); 72 1.1 jtc test_v2_queue(printer, user_name, FALSE); 73 1.1 jtc if(strlen(last_id)) { 74 1.1 jtc bad("Cancelling job with bad username"); 75 1.1 jtc test_v2_cancel(host_name, printer, "nosuchuser", last_id); 76 1.1 jtc good(); 77 1.1 jtc test_v2_cancel(host_name, printer, user_name, last_id); 78 1.1 jtc } 79 1.1 jtc bad("Cancelling unknown job"); 80 1.1 jtc test_v2_cancel(host_name, printer, user_name, "99999"); 81 1.1 jtc bad("Cancelling job on invalid printer"); 82 1.1 jtc test_v2_cancel(host_name, "nosuchprinter", user_name, last_id); 83 1.1 jtc good(); 84 1.1 jtc test_v2_queue(printer, user_name, TRUE); 85 1.1 jtc bad("Checking queue on invalid printer"); 86 1.1 jtc test_v2_queue("nosuchprinter", user_name, TRUE); 87 1.1 jtc good(); 88 1.1 jtc test_v2_stat(printer); 89 1.1 jtc bad("Checking status of invalid printer"); 90 1.1 jtc test_v2_stat("nosuchprinter"); 91 1.1 jtc good(); 92 1.1 jtc test_v2_map(); 93 1.1 jtc exit(0); 94 1.1 jtc /*NOTREACHED*/ 95 1.1 jtc } 96 1.1 jtc 97 1.1 jtc #define zchar 0x5b 98 1.1 jtc 99 1.1 jtc void 100 1.4 sevan scramble(char *s1, char *s2) 101 1.1 jtc { 102 1.1 jtc while (*s1) 103 1.1 jtc { 104 1.1 jtc *s2++ = (*s1 ^ zchar) & 0x7f; 105 1.1 jtc s1++; 106 1.1 jtc } 107 1.1 jtc *s2 = 0; 108 1.1 jtc } 109 1.1 jtc 110 1.1 jtc 111 1.1 jtc 112 1.1 jtc test_v2_info() 113 1.1 jtc { 114 1.1 jtc v2_info_args a; 115 1.1 jtc v2_info_results *rp; 116 1.1 jtc int *gp; 117 1.1 jtc int i; 118 1.1 jtc 119 1.1 jtc a.vers = "Sun Microsystems PCNFSD test subsystem V1"; 120 1.1 jtc a.cm = "-"; 121 1.1 jtc printf("\ninvoking pr_info_2\n"); 122 1.1 jtc 123 1.1 jtc rp = pcnfsd2_info_2(&a, cl2); 124 1.1 jtc 125 1.1 jtc if(rp == NULL) { 126 1.1 jtc clnt_perror(cl2, server); 127 1.1 jtc return(1); 128 1.1 jtc } 129 1.1 jtc 130 1.1 jtc printf("results: vers = '%s', cm = '%s'\n", 131 1.1 jtc rp->vers, rp->cm); 132 1.1 jtc printf("facilities_len = %d\n", rp->facilities.facilities_len); 133 1.1 jtc if (rp->facilities.facilities_len) { 134 1.1 jtc gp = rp->facilities.facilities_val; 135 1.1 jtc for(i = 0; i < rp->facilities.facilities_len; i++) 136 1.1 jtc printf(" procedure %2d: %6d\n", i, *gp++); 137 1.1 jtc printf("\n"); 138 1.1 jtc } 139 1.1 jtc /* free up allocated strings */ 140 1.1 jtc if(rp->cm) 141 1.1 jtc free(rp->cm); 142 1.1 jtc if(rp->facilities.facilities_val) 143 1.1 jtc free(rp->facilities.facilities_val); 144 1.1 jtc if(rp->vers) 145 1.1 jtc free(rp->vers); 146 1.1 jtc 147 1.1 jtc return(0); 148 1.1 jtc } 149 1.1 jtc 150 1.4 sevan test_v2_auth(char *host_name, char *user_name , char *pwrd) 151 1.1 jtc { 152 1.1 jtc v2_auth_args a; 153 1.1 jtc v2_auth_results *rp; 154 1.1 jtc char uname[32]; 155 1.1 jtc char pw[64]; 156 1.1 jtc u_int *gp; 157 1.1 jtc int i; 158 1.1 jtc 159 1.1 jtc scramble(user_name, uname); 160 1.1 jtc scramble(pwrd, pw); 161 1.1 jtc a.system = host_name; 162 1.1 jtc a.id = uname; 163 1.1 jtc a.pw = pw; 164 1.1 jtc a.cm = "-"; 165 1.1 jtc printf("\ninvoking pr_auth_2\n"); 166 1.1 jtc 167 1.1 jtc rp = pcnfsd2_auth_2(&a, cl2); 168 1.1 jtc 169 1.1 jtc if(rp == NULL) { 170 1.1 jtc clnt_perror(cl2, server); 171 1.1 jtc return(1); 172 1.1 jtc } 173 1.1 jtc 174 1.1 jtc if(rp->stat == AUTH_RES_FAIL) 175 1.1 jtc printf("results: stat = AUTH_RES_FAIL\n"); 176 1.1 jtc else { 177 1.1 jtc printf("results: stat = %d, uid = %u, gid = %u,\n homedir= '%s', cm = '%s'\n", 178 1.1 jtc rp->stat, rp->uid, rp->gid, rp->home, rp->cm); 179 1.1 jtc printf("gids_len = %d", rp->gids.gids_len); 180 1.1 jtc if (rp->gids.gids_len) { 181 1.1 jtc gp = rp->gids.gids_val; 182 1.1 jtc for(i = 0; i < rp->gids.gids_len; i++) 183 1.1 jtc printf(" %u", *gp++); 184 1.1 jtc printf("\n"); 185 1.1 jtc } 186 1.1 jtc } 187 1.1 jtc /* free up allocated strings */ 188 1.1 jtc if(rp->cm) 189 1.1 jtc free(rp->cm); 190 1.1 jtc if(rp->gids.gids_val) 191 1.1 jtc free(rp->gids.gids_val); 192 1.1 jtc if(rp->home) 193 1.1 jtc free(rp->home); 194 1.1 jtc 195 1.1 jtc return(0); 196 1.1 jtc } 197 1.1 jtc 198 1.4 sevan test_v2_init(char *host_name, char *printer) 199 1.1 jtc { 200 1.1 jtc v2_pr_init_args a; 201 1.1 jtc v2_pr_init_results *rp; 202 1.1 jtc 203 1.1 jtc a.system = host_name; 204 1.1 jtc a.pn = printer; 205 1.1 jtc a.cm = "-"; 206 1.1 jtc printf("\ninvoking pr_init_2\n"); 207 1.1 jtc 208 1.1 jtc rp = pcnfsd2_pr_init_2(&a, cl2); 209 1.1 jtc 210 1.1 jtc if(rp == NULL) { 211 1.1 jtc clnt_perror(cl2, server); 212 1.1 jtc return(1); 213 1.1 jtc } 214 1.1 jtc printf("results: stat = %d, dir = '%s', cm = '%s'\n", 215 1.1 jtc rp->stat, rp->dir, rp->cm); 216 1.3 itojun strlcpy(spooldirbuff, rp->dir, sizeof(spooldirbuff)); 217 1.1 jtc /* free up allocated strings */ 218 1.1 jtc if(rp->cm) 219 1.1 jtc free(rp->cm); 220 1.1 jtc if(rp->dir) 221 1.1 jtc free(rp->dir); 222 1.1 jtc return(0); 223 1.1 jtc } 224 1.1 jtc 225 1.1 jtc 226 1.4 sevan test_v2_start(char *host_name, char *printer, char *user_name, char *tag1, char *tag2) 227 1.1 jtc { 228 1.1 jtc v2_pr_start_args a; 229 1.1 jtc v2_pr_start_results *rp; 230 1.1 jtc FILE *fp; 231 1.1 jtc printf("\ntesting start print v2\n"); 232 1.1 jtc 233 1.1 jtc if(strcmp(server, "localhost")) { 234 1.1 jtc printf("sorry - can only test start print on 'localhost'\n"); 235 1.1 jtc return(1); 236 1.1 jtc } 237 1.1 jtc 238 1.3 itojun snprintf(filenamebuff, sizeof(filenamebuff), "%s/%s", 239 1.3 itojun spooldirbuff, tag1); 240 1.1 jtc 241 1.1 jtc fp = fopen(filenamebuff, "w"); 242 1.1 jtc if(fp == NULL) { 243 1.1 jtc perror("creating test file"); 244 1.1 jtc return(1); 245 1.1 jtc } 246 1.1 jtc (void)fputs("foo bar bletch\n", fp); 247 1.1 jtc (void)fclose(fp); 248 1.1 jtc 249 1.1 jtc a.system = host_name; 250 1.1 jtc a.pn = printer; 251 1.1 jtc a.user = user_name; 252 1.1 jtc a.file = tag2; 253 1.1 jtc a.opts = "xxxx"; 254 1.1 jtc a.copies = 1; 255 1.1 jtc a.cm = "-"; 256 1.1 jtc 257 1.1 jtc printf("\ninvoking pr_start_2\n"); 258 1.1 jtc 259 1.1 jtc rp = pcnfsd2_pr_start_2(&a, cl2); 260 1.1 jtc 261 1.1 jtc if(rp == NULL) { 262 1.1 jtc clnt_perror(cl2, server); 263 1.1 jtc return(1); 264 1.1 jtc } 265 1.1 jtc printf("results: stat = %d, jobid = '%s', cm = '%s'\n", 266 1.1 jtc rp->stat, rp->id, rp->cm); 267 1.1 jtc if(rp->stat == PS_RES_OK) 268 1.3 itojun strlcpy(last_id, rp->id, sizeof(last_id)); 269 1.1 jtc /* free up allocated strings */ 270 1.1 jtc if(rp->cm) 271 1.1 jtc free(rp->cm); 272 1.1 jtc if(rp->id) 273 1.1 jtc free(rp->id); 274 1.1 jtc return(0); 275 1.1 jtc } 276 1.1 jtc 277 1.1 jtc 278 1.4 sevan test_v2_cancel(char *host_name, char *printer, char *user_name, char *id) 279 1.1 jtc { 280 1.1 jtc v2_pr_cancel_args a; 281 1.1 jtc v2_pr_cancel_results *rp; 282 1.1 jtc printf("\ntesting cancel print v2\n"); 283 1.1 jtc 284 1.1 jtc a.system = host_name; 285 1.1 jtc a.pn = printer; 286 1.1 jtc a.user = user_name; 287 1.1 jtc a.id = id; 288 1.1 jtc a.cm = "-"; 289 1.1 jtc 290 1.1 jtc printf("\ninvoking pr_cancel_2 for job %s on printer %s\n", 291 1.1 jtc id, printer); 292 1.1 jtc 293 1.1 jtc rp = pcnfsd2_pr_cancel_2(&a, cl2); 294 1.1 jtc 295 1.1 jtc if(rp == NULL) { 296 1.1 jtc clnt_perror(cl2, server); 297 1.1 jtc return(1); 298 1.1 jtc } 299 1.1 jtc printf("results: stat = %d, cm = '%s'\n", 300 1.1 jtc rp->stat, rp->cm); 301 1.1 jtc /* free up allocated strings */ 302 1.1 jtc if(rp->cm) 303 1.1 jtc free(rp->cm); 304 1.1 jtc return(0); 305 1.1 jtc } 306 1.1 jtc test_v2_list() 307 1.1 jtc { 308 1.1 jtc char a; 309 1.1 jtc v2_pr_list_results *rp; 310 1.1 jtc pr_list curr; 311 1.1 jtc 312 1.1 jtc 313 1.1 jtc printf("\ninvoking pr_list_2\n"); 314 1.1 jtc 315 1.1 jtc rp = pcnfsd2_pr_list_2(&a, cl2); 316 1.1 jtc 317 1.1 jtc if(rp == NULL) { 318 1.1 jtc clnt_perror(cl2, server); 319 1.1 jtc return(1); 320 1.1 jtc } 321 1.1 jtc printf("results: cm = '%s', printerlist:\n", rp->cm); 322 1.1 jtc curr = rp->printers; 323 1.1 jtc while(curr) { 324 1.1 jtc printf(" name '%s' ", curr->pn); 325 1.1 jtc if(strlen(curr->remhost)) 326 1.1 jtc printf("remote: srvr '%s', name '%s'", 327 1.1 jtc curr->remhost, 328 1.1 jtc curr->device); 329 1.1 jtc else 330 1.1 jtc printf("local device = '%s'", curr->device); 331 1.1 jtc printf(", cm = '%s'\n", curr->cm); 332 1.1 jtc curr = curr->pr_next; 333 1.1 jtc } 334 1.1 jtc printf("end of list\n"); 335 1.1 jtc /* free up allocated strings */ 336 1.1 jtc if(rp->cm) 337 1.1 jtc free(rp->cm); 338 1.1 jtc if(rp->printers) { 339 1.1 jtc printf("freeing results\n"); 340 1.1 jtc free_pr_list_item(rp->printers); 341 1.1 jtc } 342 1.1 jtc return(0); 343 1.1 jtc } 344 1.1 jtc 345 1.1 jtc 346 1.1 jtc void 347 1.4 sevan free_pr_list_item(pr_list curr) 348 1.1 jtc { 349 1.1 jtc if(curr->pn) 350 1.1 jtc free(curr->pn); 351 1.1 jtc if(curr->remhost) 352 1.1 jtc free(curr->remhost); 353 1.1 jtc if(curr->device) 354 1.1 jtc free(curr->device); 355 1.1 jtc if(curr->cm) 356 1.1 jtc free(curr->cm); 357 1.1 jtc if(curr->pr_next) 358 1.1 jtc free_pr_list_item(curr->pr_next); /* recurse */ 359 1.1 jtc free(curr); 360 1.1 jtc } 361 1.1 jtc 362 1.1 jtc 363 1.1 jtc 364 1.4 sevan test_v2_queue(char *printer, char *user_name, int private) 365 1.1 jtc { 366 1.1 jtc struct v2_pr_queue_args a; 367 1.1 jtc v2_pr_queue_results *rp; 368 1.1 jtc pr_queue curr; 369 1.1 jtc 370 1.1 jtc a.pn = printer; 371 1.1 jtc a.system = "foo"; 372 1.1 jtc a.user = user_name; 373 1.1 jtc a.just_mine = private; 374 1.1 jtc a.cm = "no"; 375 1.1 jtc 376 1.1 jtc printf("\ninvoking pr_queue_2 (just_mine = %d)\n", private); 377 1.1 jtc 378 1.1 jtc rp = pcnfsd2_pr_queue_2(&a, cl2); 379 1.1 jtc 380 1.1 jtc if(rp == NULL) { 381 1.1 jtc clnt_perror(cl2, server); 382 1.1 jtc return(1); 383 1.1 jtc } 384 1.1 jtc printf("results: stat = %d, qlen = %d, qshown = %d cm = '%s', queue:\n", 385 1.1 jtc rp->stat, rp->qlen, rp->qshown, rp->cm); 386 1.1 jtc curr = rp->jobs; 387 1.1 jtc while(curr) { 388 1.1 jtc printf("rank = %2d, id = '%s', size = '%s', status = '%s'\n", 389 1.1 jtc curr->position, 390 1.1 jtc curr->id, 391 1.1 jtc curr->size, 392 1.1 jtc curr->status); 393 1.1 jtc printf(" user = '%s', file = '%s', cm = '%s'\n", 394 1.1 jtc curr->user, 395 1.1 jtc curr->file, 396 1.1 jtc curr->cm); 397 1.1 jtc curr = curr->pr_next; 398 1.1 jtc } 399 1.1 jtc printf("end of list\n"); 400 1.1 jtc /* free up allocated strings */ 401 1.1 jtc if(rp->cm) 402 1.1 jtc free(rp->cm); 403 1.1 jtc if(rp->jobs) { 404 1.1 jtc printf("freeing results\n"); 405 1.1 jtc free_pr_queue_item(rp->jobs); 406 1.1 jtc } 407 1.1 jtc return(0); 408 1.1 jtc } 409 1.1 jtc 410 1.1 jtc 411 1.1 jtc 412 1.1 jtc void 413 1.4 sevan free_pr_queue_item(pr_queue curr) 414 1.1 jtc { 415 1.1 jtc if(curr->id) 416 1.1 jtc free(curr->id); 417 1.1 jtc if(curr->size) 418 1.1 jtc free(curr->size); 419 1.1 jtc if(curr->status) 420 1.1 jtc free(curr->status); 421 1.1 jtc if(curr->system) 422 1.1 jtc free(curr->system); 423 1.1 jtc if(curr->user) 424 1.1 jtc free(curr->user); 425 1.1 jtc if(curr->file) 426 1.1 jtc free(curr->file); 427 1.1 jtc if(curr->cm) 428 1.1 jtc free(curr->cm); 429 1.1 jtc if(curr->pr_next) 430 1.1 jtc free_pr_queue_item(curr->pr_next); /* recurse */ 431 1.1 jtc free(curr); 432 1.1 jtc } 433 1.1 jtc 434 1.1 jtc 435 1.1 jtc 436 1.4 sevan test_v2_stat(char *printer) 437 1.1 jtc { 438 1.1 jtc v2_pr_status_args a; 439 1.1 jtc v2_pr_status_results *rp; 440 1.1 jtc 441 1.1 jtc printf("\ntesting status print v2\n"); 442 1.1 jtc 443 1.1 jtc a.pn = printer; 444 1.1 jtc a.cm = "-"; 445 1.1 jtc 446 1.1 jtc printf("\ninvoking pr_status_2\n"); 447 1.1 jtc 448 1.1 jtc rp = pcnfsd2_pr_status_2(&a, cl2); 449 1.1 jtc 450 1.1 jtc if(rp == NULL) { 451 1.1 jtc clnt_perror(cl2, server); 452 1.1 jtc return(1); 453 1.1 jtc } 454 1.1 jtc printf("results: stat = %d, cm = '%s'\n", 455 1.1 jtc rp->stat, rp->cm); 456 1.1 jtc if(rp->stat == PI_RES_OK) { 457 1.1 jtc printf("avail = %s, ", (rp->avail ? "YES" : "NO")); 458 1.1 jtc printf("printing = %s, ", (rp->printing ? "YES" : "NO")); 459 1.1 jtc printf("needs_operator = %s, ", (rp->needs_operator ? "YES" : "NO")); 460 1.1 jtc printf("qlen = %d, status = '%s'\n", rp->qlen, rp->status); 461 1.1 jtc } 462 1.1 jtc /* free up allocated strings */ 463 1.1 jtc if(rp->cm) 464 1.1 jtc free(rp->cm); 465 1.1 jtc if(rp->status) 466 1.1 jtc free(rp->status); 467 1.1 jtc return(0); 468 1.1 jtc } 469 1.1 jtc 470 1.4 sevan struct mapreq_arg_item * make_mapreq_entry(mapreq t, int i, char *n, struct mapreq_arg_item *next) 471 1.1 jtc { 472 1.1 jtc struct mapreq_arg_item *x; 473 1.1 jtc x = (struct mapreq_arg_item *)malloc(sizeof(struct mapreq_arg_item)); 474 1.1 jtc if(x == NULL) { 475 1.1 jtc fprintf(stderr, "out of memory\n"); 476 1.1 jtc exit(123); 477 1.1 jtc } 478 1.1 jtc x->req = t; 479 1.1 jtc x->id = i; 480 1.1 jtc x->name = (n ? n : ""); 481 1.1 jtc x->mapreq_next = next; 482 1.1 jtc return(x); 483 1.1 jtc } 484 1.1 jtc 485 1.1 jtc test_v2_map() 486 1.1 jtc { 487 1.1 jtc v2_mapid_args a; 488 1.1 jtc v2_mapid_results *rp; 489 1.1 jtc struct mapreq_res_item *rip; 490 1.1 jtc 491 1.1 jtc a.cm = "-"; 492 1.1 jtc a.req_list = make_mapreq_entry(MAP_REQ_UID, 906, NULL, 493 1.1 jtc make_mapreq_entry(MAP_REQ_GID, 1, NULL, 494 1.1 jtc make_mapreq_entry(MAP_REQ_UNAME, 0, "root", 495 1.1 jtc make_mapreq_entry(MAP_REQ_GNAME, 0, "wheel", 496 1.1 jtc make_mapreq_entry(MAP_REQ_UNAME, 0, "bogus", NULL))))); 497 1.1 jtc 498 1.1 jtc printf("\ninvoking pr_mapid_2\n"); 499 1.1 jtc rp = pcnfsd2_mapid_2(&a, cl2); 500 1.1 jtc 501 1.1 jtc if(rp == NULL) { 502 1.1 jtc clnt_perror(cl2, server); 503 1.1 jtc return(1); 504 1.1 jtc } 505 1.1 jtc printf("results: cm = '%s', result list %s\n", 506 1.1 jtc rp->cm, rp->res_list ? "follows" : "omitted"); 507 1.1 jtc rip = rp->res_list; 508 1.1 jtc while(rip) { 509 1.1 jtc printf("request type = %d, status = %d, id = %d, name = '%s'\n", 510 1.1 jtc rip->req, rip->stat, rip->id, 511 1.1 jtc (rip->name ? rip->name : "(NULL)")); 512 1.1 jtc rip = rip->mapreq_next; 513 1.1 jtc } 514 1.1 jtc /* XXX should free up results */ 515 1.1 jtc 516 1.1 jtc 517 1.1 jtc 518 1.1 jtc return(0); 519 1.1 jtc } 520 1.1 jtc 521 1.1 jtc 522 1.1 jtc void 523 1.1 jtc good() 524 1.1 jtc { 525 1.1 jtc printf("\n"); 526 1.1 jtc printf("********************************************************\n"); 527 1.1 jtc printf("********************************************************\n"); 528 1.1 jtc printf("** The following test is expected to SUCCEED **\n"); 529 1.1 jtc printf("********************************************************\n"); 530 1.1 jtc printf("********************************************************\n"); 531 1.1 jtc } 532 1.1 jtc 533 1.1 jtc void 534 1.4 sevan bad(char *reason) 535 1.1 jtc { 536 1.1 jtc printf("\n"); 537 1.1 jtc printf("********************************************************\n"); 538 1.1 jtc printf("********************************************************\n"); 539 1.1 jtc printf("** The following test is expected to FAIL **\n"); 540 1.1 jtc printf("** Reason: **\n"); 541 1.1 jtc printf("** %50s **\n", reason); 542 1.1 jtc printf("********************************************************\n"); 543 1.1 jtc printf("********************************************************\n"); 544 1.1 jtc } 545