xref: /freebsd-src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.toupper.d (revision 552311f4bb98c81b1b9e0e81d74e0262fc12110b)
1*730cecb0SPedro F. Giffuni /*
2*730cecb0SPedro F. Giffuni  * CDDL HEADER START
3*730cecb0SPedro F. Giffuni  *
4*730cecb0SPedro F. Giffuni  * The contents of this file are subject to the terms of the
5*730cecb0SPedro F. Giffuni  * Common Development and Distribution License (the "License").
6*730cecb0SPedro F. Giffuni  * You may not use this file except in compliance with the License.
7*730cecb0SPedro F. Giffuni  *
8*730cecb0SPedro F. Giffuni  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*730cecb0SPedro F. Giffuni  * or http://www.opensolaris.org/os/licensing.
10*730cecb0SPedro F. Giffuni  * See the License for the specific language governing permissions
11*730cecb0SPedro F. Giffuni  * and limitations under the License.
12*730cecb0SPedro F. Giffuni  *
13*730cecb0SPedro F. Giffuni  * When distributing Covered Code, include this CDDL HEADER in each
14*730cecb0SPedro F. Giffuni  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*730cecb0SPedro F. Giffuni  * If applicable, add the following below this CDDL HEADER, with the
16*730cecb0SPedro F. Giffuni  * fields enclosed by brackets "[]" replaced with your own identifying
17*730cecb0SPedro F. Giffuni  * information: Portions Copyright [yyyy] [name of copyright owner]
18*730cecb0SPedro F. Giffuni  *
19*730cecb0SPedro F. Giffuni  * CDDL HEADER END
20*730cecb0SPedro F. Giffuni  */
21*730cecb0SPedro F. Giffuni 
22*730cecb0SPedro F. Giffuni /*
23*730cecb0SPedro F. Giffuni  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
24*730cecb0SPedro F. Giffuni  */
25*730cecb0SPedro F. Giffuni 
26*730cecb0SPedro F. Giffuni #pragma D option quiet
27*730cecb0SPedro F. Giffuni 
28*730cecb0SPedro F. Giffuni BEGIN
29*730cecb0SPedro F. Giffuni {
30*730cecb0SPedro F. Giffuni 	i = 0;
31*730cecb0SPedro F. Giffuni 
32*730cecb0SPedro F. Giffuni 	input[i] = "ahi";
33*730cecb0SPedro F. Giffuni 	expected[i++] = "AHI";
34*730cecb0SPedro F. Giffuni 
35*730cecb0SPedro F. Giffuni 	input[i] = "MaHi!";
36*730cecb0SPedro F. Giffuni 	expected[i++] = "MAHI!";
37*730cecb0SPedro F. Giffuni 
38*730cecb0SPedro F. Giffuni 	input[i] = "   dace-9";
39*730cecb0SPedro F. Giffuni 	expected[i++] = "   DACE-9";
40*730cecb0SPedro F. Giffuni 
41*730cecb0SPedro F. Giffuni 	input[i] = "!@#$%";
42*730cecb0SPedro F. Giffuni 	expected[i++] = "!@#$%";
43*730cecb0SPedro F. Giffuni 
44*730cecb0SPedro F. Giffuni 	i = 0;
45*730cecb0SPedro F. Giffuni }
46*730cecb0SPedro F. Giffuni 
47*730cecb0SPedro F. Giffuni tick-1ms
48*730cecb0SPedro F. Giffuni /input[i] != NULL && (this->out = toupper(input[i])) != expected[i]/
49*730cecb0SPedro F. Giffuni {
50*730cecb0SPedro F. Giffuni 	printf("expected toupper(\"%s\") to be \"%s\"; found \"%s\"\n",
51*730cecb0SPedro F. Giffuni 	    input[i], expected[i], this->out);
52*730cecb0SPedro F. Giffuni 	exit(1);
53*730cecb0SPedro F. Giffuni }
54*730cecb0SPedro F. Giffuni 
55*730cecb0SPedro F. Giffuni tick-1ms
56*730cecb0SPedro F. Giffuni /input[i] != NULL/
57*730cecb0SPedro F. Giffuni {
58*730cecb0SPedro F. Giffuni 	printf("toupper(\"%s\") is \"%s\", as expected\n",
59*730cecb0SPedro F. Giffuni 	    input[i], expected[i]);
60*730cecb0SPedro F. Giffuni }
61*730cecb0SPedro F. Giffuni 
62*730cecb0SPedro F. Giffuni tick-1ms
63*730cecb0SPedro F. Giffuni /input[i++] == NULL/
64*730cecb0SPedro F. Giffuni {
65*730cecb0SPedro F. Giffuni 	exit(0);
66*730cecb0SPedro F. Giffuni }
67