xref: /onnv-gate/usr/src/cmd/agents/snmp/snmplib/test/error_test.c (revision 0:68f95e015346)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1996 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 
30 #include "error.h"
31 
32 
application_end()33 static void application_end()
34 {
35 }
36 
37 
main(int agrc,char * argv[])38 main(int agrc, char *argv[])
39 {
40 	error_init(argv[0], application_end);
41 
42 	error("first message");
43 	error("tata\n");
44 	error("\n");
45 	error("titi\n");
46 	error("\n\n");
47 	error("toto\n\n\n");
48 	error("\n\n\n");
49 
50 	error_open("/tmp/error_test.log");
51 
52 	error("second message");
53 	error("tata\n");
54 	error("\n");
55 	error("titi\n");
56 	error("\n\n");
57 	error("toto\n\n\n");
58 	error("\n\n\n");
59 
60 /*
61  *	error_close_stderr();
62  */
63 
64 	error("third message");
65 	error("tata\n");
66 	error("\n");
67 	error("titi\n");
68 	error("\n\n");
69 	error("toto\n\n\n");
70 	error("\n\n\n");
71 
72 	error_exit("end of this sample program");
73 }
74