1/*
2 * "$Id: testcgi.c 11093 2013-07-03 20:48:42Z msweet $"
3 *
4 *   CGI test program for CUPS.
5 *
6 *   Copyright 2007-2011 by Apple Inc.
7 *   Copyright 1997-2005 by Easy Software Products.
8 *
9 *   These coded instructions, statements, and computer programs are the
10 *   property of Apple Inc. and are protected by Federal copyright
11 *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
12 *   which should have been included with this file.  If this file is
13 *   file is missing or damaged, see the license at "http://www.cups.org/".
14 *
15 * Contents:
16 *
17 *   main()       - Test the help index code.
18 *   list_nodes() - List nodes in an array...
19 */
20
21/*
22 * Include necessary headers...
23 */
24
25#include "cgi.h"
26
27
28/*
29 * 'main()' - Test the CGI code.
30 */
31
32int					/* O - Exit status */
33main(int  argc,				/* I - Number of command-line arguments */
34     char *argv[])			/* I - Command-line arguments */
35{
36 /*
37  * Test file upload/multi-part submissions...
38  */
39
40  freopen("multipart.dat", "rb", stdin);
41
42  putenv("CONTENT_TYPE=multipart/form-data; "
43         "boundary=---------------------------1977426492562745908748943111");
44  putenv("REQUEST_METHOD=POST");
45
46  printf("cgiInitialize: ");
47  if (cgiInitialize())
48  {
49    const cgi_file_t	*file;		/* Upload file */
50
51    if ((file = cgiGetFile()) != NULL)
52    {
53      puts("PASS");
54      printf("    tempfile=\"%s\"\n", file->tempfile);
55      printf("    name=\"%s\"\n", file->name);
56      printf("    filename=\"%s\"\n", file->filename);
57      printf("    mimetype=\"%s\"\n", file->mimetype);
58    }
59    else
60      puts("FAIL (no file!)");
61  }
62  else
63    puts("FAIL (init)");
64
65 /*
66  * Return with no errors...
67  */
68
69  return (0);
70}
71
72
73/*
74 * End of "$Id: testcgi.c 11093 2013-07-03 20:48:42Z msweet $".
75 */
76