]> git.ipfire.org Git - thirdparty/cups.git/blame - cgi-bin/testcgi.c
Add option to specify a single operation to test with.
[thirdparty/cups.git] / cgi-bin / testcgi.c
CommitLineData
ef416fc2 1/*
bc44d920 2 * "$Id: testcgi.c 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3 *
321d8d57 4 * CGI test program for CUPS.
ef416fc2 5 *
321d8d57 6 * Copyright 2007-2011 by Apple Inc.
ef416fc2 7 * Copyright 1997-2005 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 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)");
321d8d57 64
ef416fc2 65 /*
66 * Return with no errors...
67 */
68
69 return (0);
70}
71
72
73/*
bc44d920 74 * End of "$Id: testcgi.c 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 75 */