xref: /illumos-gate/usr/src/test/util-tests/tests/ctf/test-enum.c (revision f52943a93040563107b95bccb9db87d9971ef47d)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright (c) 2019, Joyent, Inc.
14  */
15 
16 #include <stdint.h>
17 
18 /*
19  * Basic sanity checking of enumerations, using specific numbers and arbitrary
20  * numbers.
21  */
22 
23 enum ff6 {
24 	TERRA,
25 	LOCKE,
26 	EDGAR,
27 	SABIN,
28 	CELES,
29 	CYAN,
30 	SHADOW,
31 	GAU,
32 	SETZER,
33 	STRAGO,
34 	RELM,
35 	MOG,
36 	GOGO,
37 	UMARO,
38 	LEO,
39 	KEFKA
40 };
41 
42 typedef enum ff10 {
43 	TIDUS = -10,
44 	YUNA = 23,
45 	AURON = -34,
46 	WAKA = 52,
47 	LULU = INT32_MAX,
48 	RIKKU = INT32_MIN,
49 	KHIMARI = 0
50 } ff10_t;
51 
52 /*
53  * The following enum is copy of the ddi_hp_cn_state_t enumeration which was
54  * previously incorrectly converted by the tools. Notably, we always assumed
55  * that the DWARF enum values were signed; however, in this case we needed to
56  * check for an unsigned version before a signed version, otherwise some of the
57  * entries below will have the wrong values.
58  */
59 typedef enum chrono {
60 	CRONO = 0x1000,
61 	LUCCA = 0x2000,
62 	MARLE = 0x3000,
63 	FROG = 0x4000,
64 	ROBO = 0x5000,
65 	AYLA = 0x6000,
66 	MAGUS = 0x7000,
67 	SCHALA = 0x8000,
68 	LAVOS = 0x9000,
69 	BALTHAZAR = 0xa000
70 } chrono_t;
71 
72 enum ff6 ff6;
73 ff10_t ff10;
74 chrono_t trigger;
75