1*e0c4386eSCy Schubert /*
2*e0c4386eSCy Schubert * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
3*e0c4386eSCy Schubert * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
4*e0c4386eSCy Schubert *
5*e0c4386eSCy Schubert * Licensed under the Apache License 2.0 (the "License"). You may not use
6*e0c4386eSCy Schubert * this file except in compliance with the License. You can obtain a copy
7*e0c4386eSCy Schubert * in the file LICENSE in the source distribution or at
8*e0c4386eSCy Schubert * https://www.openssl.org/source/license.html
9*e0c4386eSCy Schubert */
10*e0c4386eSCy Schubert
11*e0c4386eSCy Schubert #include <stdio.h>
12*e0c4386eSCy Schubert #include <string.h>
13*e0c4386eSCy Schubert
14*e0c4386eSCy Schubert #include <openssl/opensslconf.h>
15*e0c4386eSCy Schubert #include <openssl/safestack.h>
16*e0c4386eSCy Schubert #include <openssl/err.h>
17*e0c4386eSCy Schubert #include <openssl/crypto.h>
18*e0c4386eSCy Schubert
19*e0c4386eSCy Schubert #include "internal/nelem.h"
20*e0c4386eSCy Schubert #include "testutil.h"
21*e0c4386eSCy Schubert
22*e0c4386eSCy Schubert /* The macros below generate unused functions which error out one of the clang
23*e0c4386eSCy Schubert * builds. We disable this check here.
24*e0c4386eSCy Schubert */
25*e0c4386eSCy Schubert #ifdef __clang__
26*e0c4386eSCy Schubert #pragma clang diagnostic ignored "-Wunused-function"
27*e0c4386eSCy Schubert #endif
28*e0c4386eSCy Schubert
29*e0c4386eSCy Schubert typedef struct {
30*e0c4386eSCy Schubert int n;
31*e0c4386eSCy Schubert char c;
32*e0c4386eSCy Schubert } SS;
33*e0c4386eSCy Schubert
34*e0c4386eSCy Schubert typedef union {
35*e0c4386eSCy Schubert int n;
36*e0c4386eSCy Schubert char c;
37*e0c4386eSCy Schubert } SU;
38*e0c4386eSCy Schubert
DEFINE_SPECIAL_STACK_OF(sint,int)39*e0c4386eSCy Schubert DEFINE_SPECIAL_STACK_OF(sint, int)
40*e0c4386eSCy Schubert DEFINE_SPECIAL_STACK_OF_CONST(uchar, unsigned char)
41*e0c4386eSCy Schubert DEFINE_STACK_OF(SS)
42*e0c4386eSCy Schubert DEFINE_STACK_OF_CONST(SU)
43*e0c4386eSCy Schubert
44*e0c4386eSCy Schubert static int int_compare(const int *const *a, const int *const *b)
45*e0c4386eSCy Schubert {
46*e0c4386eSCy Schubert if (**a < **b)
47*e0c4386eSCy Schubert return -1;
48*e0c4386eSCy Schubert if (**a > **b)
49*e0c4386eSCy Schubert return 1;
50*e0c4386eSCy Schubert return 0;
51*e0c4386eSCy Schubert }
52*e0c4386eSCy Schubert
test_int_stack(int reserve)53*e0c4386eSCy Schubert static int test_int_stack(int reserve)
54*e0c4386eSCy Schubert {
55*e0c4386eSCy Schubert static int v[] = { 1, 2, -4, 16, 999, 1, -173, 1, 9 };
56*e0c4386eSCy Schubert static int notpresent = -1;
57*e0c4386eSCy Schubert const int n = OSSL_NELEM(v);
58*e0c4386eSCy Schubert static struct {
59*e0c4386eSCy Schubert int value;
60*e0c4386eSCy Schubert int unsorted;
61*e0c4386eSCy Schubert int sorted;
62*e0c4386eSCy Schubert int ex;
63*e0c4386eSCy Schubert } finds[] = {
64*e0c4386eSCy Schubert { 2, 1, 5, 5 },
65*e0c4386eSCy Schubert { 9, 7, 6, 6 },
66*e0c4386eSCy Schubert { -173, 5, 0, 0 },
67*e0c4386eSCy Schubert { 999, 3, 8, 8 },
68*e0c4386eSCy Schubert { 0, -1, -1, 1 }
69*e0c4386eSCy Schubert };
70*e0c4386eSCy Schubert const int n_finds = OSSL_NELEM(finds);
71*e0c4386eSCy Schubert static struct {
72*e0c4386eSCy Schubert int value;
73*e0c4386eSCy Schubert int ex;
74*e0c4386eSCy Schubert } exfinds[] = {
75*e0c4386eSCy Schubert { 3, 5 },
76*e0c4386eSCy Schubert { 1000, 8 },
77*e0c4386eSCy Schubert { 20, 8 },
78*e0c4386eSCy Schubert { -999, 0 },
79*e0c4386eSCy Schubert { -5, 0 },
80*e0c4386eSCy Schubert { 8, 5 }
81*e0c4386eSCy Schubert };
82*e0c4386eSCy Schubert const int n_exfinds = OSSL_NELEM(exfinds);
83*e0c4386eSCy Schubert STACK_OF(sint) *s = sk_sint_new_null();
84*e0c4386eSCy Schubert int i;
85*e0c4386eSCy Schubert int testresult = 0;
86*e0c4386eSCy Schubert
87*e0c4386eSCy Schubert if (!TEST_ptr(s)
88*e0c4386eSCy Schubert || (reserve > 0 && !TEST_true(sk_sint_reserve(s, 5 * reserve))))
89*e0c4386eSCy Schubert goto end;
90*e0c4386eSCy Schubert
91*e0c4386eSCy Schubert /* Check push and num */
92*e0c4386eSCy Schubert for (i = 0; i < n; i++) {
93*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_num(s), i)) {
94*e0c4386eSCy Schubert TEST_info("int stack size %d", i);
95*e0c4386eSCy Schubert goto end;
96*e0c4386eSCy Schubert }
97*e0c4386eSCy Schubert sk_sint_push(s, v + i);
98*e0c4386eSCy Schubert }
99*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_num(s), n))
100*e0c4386eSCy Schubert goto end;
101*e0c4386eSCy Schubert
102*e0c4386eSCy Schubert /* check the values */
103*e0c4386eSCy Schubert for (i = 0; i < n; i++)
104*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_sint_value(s, i), v + i)) {
105*e0c4386eSCy Schubert TEST_info("int value %d", i);
106*e0c4386eSCy Schubert goto end;
107*e0c4386eSCy Schubert }
108*e0c4386eSCy Schubert
109*e0c4386eSCy Schubert /* find unsorted -- the pointers are compared */
110*e0c4386eSCy Schubert for (i = 0; i < n_finds; i++) {
111*e0c4386eSCy Schubert int *val = (finds[i].unsorted == -1) ? ¬present
112*e0c4386eSCy Schubert : v + finds[i].unsorted;
113*e0c4386eSCy Schubert
114*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_find(s, val), finds[i].unsorted)) {
115*e0c4386eSCy Schubert TEST_info("int unsorted find %d", i);
116*e0c4386eSCy Schubert goto end;
117*e0c4386eSCy Schubert }
118*e0c4386eSCy Schubert }
119*e0c4386eSCy Schubert
120*e0c4386eSCy Schubert /* find_ex unsorted */
121*e0c4386eSCy Schubert for (i = 0; i < n_finds; i++) {
122*e0c4386eSCy Schubert int *val = (finds[i].unsorted == -1) ? ¬present
123*e0c4386eSCy Schubert : v + finds[i].unsorted;
124*e0c4386eSCy Schubert
125*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_find_ex(s, val), finds[i].unsorted)) {
126*e0c4386eSCy Schubert TEST_info("int unsorted find_ex %d", i);
127*e0c4386eSCy Schubert goto end;
128*e0c4386eSCy Schubert }
129*e0c4386eSCy Schubert }
130*e0c4386eSCy Schubert
131*e0c4386eSCy Schubert /* sorting */
132*e0c4386eSCy Schubert if (!TEST_false(sk_sint_is_sorted(s)))
133*e0c4386eSCy Schubert goto end;
134*e0c4386eSCy Schubert (void)sk_sint_set_cmp_func(s, &int_compare);
135*e0c4386eSCy Schubert sk_sint_sort(s);
136*e0c4386eSCy Schubert if (!TEST_true(sk_sint_is_sorted(s)))
137*e0c4386eSCy Schubert goto end;
138*e0c4386eSCy Schubert
139*e0c4386eSCy Schubert /* find sorted -- the value is matched so we don't need to locate it */
140*e0c4386eSCy Schubert for (i = 0; i < n_finds; i++)
141*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_find(s, &finds[i].value), finds[i].sorted)) {
142*e0c4386eSCy Schubert TEST_info("int sorted find %d", i);
143*e0c4386eSCy Schubert goto end;
144*e0c4386eSCy Schubert }
145*e0c4386eSCy Schubert
146*e0c4386eSCy Schubert /* find_ex sorted */
147*e0c4386eSCy Schubert for (i = 0; i < n_finds; i++)
148*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_find_ex(s, &finds[i].value), finds[i].ex)) {
149*e0c4386eSCy Schubert TEST_info("int sorted find_ex present %d", i);
150*e0c4386eSCy Schubert goto end;
151*e0c4386eSCy Schubert }
152*e0c4386eSCy Schubert for (i = 0; i < n_exfinds; i++)
153*e0c4386eSCy Schubert if (!TEST_int_eq(sk_sint_find_ex(s, &exfinds[i].value), exfinds[i].ex)){
154*e0c4386eSCy Schubert TEST_info("int sorted find_ex absent %d", i);
155*e0c4386eSCy Schubert goto end;
156*e0c4386eSCy Schubert }
157*e0c4386eSCy Schubert
158*e0c4386eSCy Schubert /* shift */
159*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_sint_shift(s), v + 6))
160*e0c4386eSCy Schubert goto end;
161*e0c4386eSCy Schubert
162*e0c4386eSCy Schubert testresult = 1;
163*e0c4386eSCy Schubert end:
164*e0c4386eSCy Schubert sk_sint_free(s);
165*e0c4386eSCy Schubert return testresult;
166*e0c4386eSCy Schubert }
167*e0c4386eSCy Schubert
uchar_compare(const unsigned char * const * a,const unsigned char * const * b)168*e0c4386eSCy Schubert static int uchar_compare(const unsigned char *const *a,
169*e0c4386eSCy Schubert const unsigned char *const *b)
170*e0c4386eSCy Schubert {
171*e0c4386eSCy Schubert return **a - (signed int)**b;
172*e0c4386eSCy Schubert }
173*e0c4386eSCy Schubert
test_uchar_stack(int reserve)174*e0c4386eSCy Schubert static int test_uchar_stack(int reserve)
175*e0c4386eSCy Schubert {
176*e0c4386eSCy Schubert static const unsigned char v[] = { 1, 3, 7, 5, 255, 0 };
177*e0c4386eSCy Schubert const int n = OSSL_NELEM(v);
178*e0c4386eSCy Schubert STACK_OF(uchar) *s = sk_uchar_new(&uchar_compare), *r = NULL;
179*e0c4386eSCy Schubert int i;
180*e0c4386eSCy Schubert int testresult = 0;
181*e0c4386eSCy Schubert
182*e0c4386eSCy Schubert if (!TEST_ptr(s)
183*e0c4386eSCy Schubert || (reserve > 0 && !TEST_true(sk_uchar_reserve(s, 5 * reserve))))
184*e0c4386eSCy Schubert goto end;
185*e0c4386eSCy Schubert
186*e0c4386eSCy Schubert /* unshift and num */
187*e0c4386eSCy Schubert for (i = 0; i < n; i++) {
188*e0c4386eSCy Schubert if (!TEST_int_eq(sk_uchar_num(s), i)) {
189*e0c4386eSCy Schubert TEST_info("uchar stack size %d", i);
190*e0c4386eSCy Schubert goto end;
191*e0c4386eSCy Schubert }
192*e0c4386eSCy Schubert sk_uchar_unshift(s, v + i);
193*e0c4386eSCy Schubert }
194*e0c4386eSCy Schubert if (!TEST_int_eq(sk_uchar_num(s), n))
195*e0c4386eSCy Schubert goto end;
196*e0c4386eSCy Schubert
197*e0c4386eSCy Schubert /* dup */
198*e0c4386eSCy Schubert r = sk_uchar_dup(NULL);
199*e0c4386eSCy Schubert if (sk_uchar_num(r) != 0)
200*e0c4386eSCy Schubert goto end;
201*e0c4386eSCy Schubert sk_uchar_free(r);
202*e0c4386eSCy Schubert r = sk_uchar_dup(s);
203*e0c4386eSCy Schubert if (!TEST_int_eq(sk_uchar_num(r), n))
204*e0c4386eSCy Schubert goto end;
205*e0c4386eSCy Schubert sk_uchar_sort(r);
206*e0c4386eSCy Schubert
207*e0c4386eSCy Schubert /* pop */
208*e0c4386eSCy Schubert for (i = 0; i < n; i++)
209*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_uchar_pop(s), v + i)) {
210*e0c4386eSCy Schubert TEST_info("uchar pop %d", i);
211*e0c4386eSCy Schubert goto end;
212*e0c4386eSCy Schubert }
213*e0c4386eSCy Schubert
214*e0c4386eSCy Schubert /* free -- we rely on the debug malloc to detect leakage here */
215*e0c4386eSCy Schubert sk_uchar_free(s);
216*e0c4386eSCy Schubert s = NULL;
217*e0c4386eSCy Schubert
218*e0c4386eSCy Schubert /* dup again */
219*e0c4386eSCy Schubert if (!TEST_int_eq(sk_uchar_num(r), n))
220*e0c4386eSCy Schubert goto end;
221*e0c4386eSCy Schubert
222*e0c4386eSCy Schubert /* zero */
223*e0c4386eSCy Schubert sk_uchar_zero(r);
224*e0c4386eSCy Schubert if (!TEST_int_eq(sk_uchar_num(r), 0))
225*e0c4386eSCy Schubert goto end;
226*e0c4386eSCy Schubert
227*e0c4386eSCy Schubert /* insert */
228*e0c4386eSCy Schubert sk_uchar_insert(r, v, 0);
229*e0c4386eSCy Schubert sk_uchar_insert(r, v + 2, -1);
230*e0c4386eSCy Schubert sk_uchar_insert(r, v + 1, 1);
231*e0c4386eSCy Schubert for (i = 0; i < 3; i++)
232*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_uchar_value(r, i), v + i)) {
233*e0c4386eSCy Schubert TEST_info("uchar insert %d", i);
234*e0c4386eSCy Schubert goto end;
235*e0c4386eSCy Schubert }
236*e0c4386eSCy Schubert
237*e0c4386eSCy Schubert /* delete */
238*e0c4386eSCy Schubert if (!TEST_ptr_null(sk_uchar_delete(r, 12)))
239*e0c4386eSCy Schubert goto end;
240*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_uchar_delete(r, 1), v + 1))
241*e0c4386eSCy Schubert goto end;
242*e0c4386eSCy Schubert
243*e0c4386eSCy Schubert /* set */
244*e0c4386eSCy Schubert (void)sk_uchar_set(r, 1, v + 1);
245*e0c4386eSCy Schubert for (i = 0; i < 2; i++)
246*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_uchar_value(r, i), v + i)) {
247*e0c4386eSCy Schubert TEST_info("uchar set %d", i);
248*e0c4386eSCy Schubert goto end;
249*e0c4386eSCy Schubert }
250*e0c4386eSCy Schubert
251*e0c4386eSCy Schubert testresult = 1;
252*e0c4386eSCy Schubert end:
253*e0c4386eSCy Schubert sk_uchar_free(r);
254*e0c4386eSCy Schubert sk_uchar_free(s);
255*e0c4386eSCy Schubert return testresult;
256*e0c4386eSCy Schubert }
257*e0c4386eSCy Schubert
SS_copy(const SS * p)258*e0c4386eSCy Schubert static SS *SS_copy(const SS *p)
259*e0c4386eSCy Schubert {
260*e0c4386eSCy Schubert SS *q = OPENSSL_malloc(sizeof(*q));
261*e0c4386eSCy Schubert
262*e0c4386eSCy Schubert if (q != NULL)
263*e0c4386eSCy Schubert memcpy(q, p, sizeof(*q));
264*e0c4386eSCy Schubert return q;
265*e0c4386eSCy Schubert }
266*e0c4386eSCy Schubert
SS_free(SS * p)267*e0c4386eSCy Schubert static void SS_free(SS *p) {
268*e0c4386eSCy Schubert OPENSSL_free(p);
269*e0c4386eSCy Schubert }
270*e0c4386eSCy Schubert
test_SS_stack(void)271*e0c4386eSCy Schubert static int test_SS_stack(void)
272*e0c4386eSCy Schubert {
273*e0c4386eSCy Schubert STACK_OF(SS) *s = sk_SS_new_null();
274*e0c4386eSCy Schubert STACK_OF(SS) *r = NULL;
275*e0c4386eSCy Schubert SS *v[10], *p;
276*e0c4386eSCy Schubert const int n = OSSL_NELEM(v);
277*e0c4386eSCy Schubert int i;
278*e0c4386eSCy Schubert int testresult = 0;
279*e0c4386eSCy Schubert
280*e0c4386eSCy Schubert /* allocate and push */
281*e0c4386eSCy Schubert for (i = 0; i < n; i++) {
282*e0c4386eSCy Schubert v[i] = OPENSSL_malloc(sizeof(*v[i]));
283*e0c4386eSCy Schubert
284*e0c4386eSCy Schubert if (!TEST_ptr(v[i]))
285*e0c4386eSCy Schubert goto end;
286*e0c4386eSCy Schubert v[i]->n = i;
287*e0c4386eSCy Schubert v[i]->c = 'A' + i;
288*e0c4386eSCy Schubert if (!TEST_int_eq(sk_SS_num(s), i)) {
289*e0c4386eSCy Schubert TEST_info("SS stack size %d", i);
290*e0c4386eSCy Schubert goto end;
291*e0c4386eSCy Schubert }
292*e0c4386eSCy Schubert sk_SS_push(s, v[i]);
293*e0c4386eSCy Schubert }
294*e0c4386eSCy Schubert if (!TEST_int_eq(sk_SS_num(s), n))
295*e0c4386eSCy Schubert goto end;
296*e0c4386eSCy Schubert
297*e0c4386eSCy Schubert /* deepcopy */
298*e0c4386eSCy Schubert r = sk_SS_deep_copy(NULL, &SS_copy, &SS_free);
299*e0c4386eSCy Schubert if (sk_SS_num(r) != 0)
300*e0c4386eSCy Schubert goto end;
301*e0c4386eSCy Schubert sk_SS_free(r);
302*e0c4386eSCy Schubert r = sk_SS_deep_copy(s, &SS_copy, &SS_free);
303*e0c4386eSCy Schubert if (!TEST_ptr(r))
304*e0c4386eSCy Schubert goto end;
305*e0c4386eSCy Schubert for (i = 0; i < n; i++) {
306*e0c4386eSCy Schubert p = sk_SS_value(r, i);
307*e0c4386eSCy Schubert if (!TEST_ptr_ne(p, v[i])) {
308*e0c4386eSCy Schubert TEST_info("SS deepcopy non-copy %d", i);
309*e0c4386eSCy Schubert goto end;
310*e0c4386eSCy Schubert }
311*e0c4386eSCy Schubert if (!TEST_int_eq(p->n, v[i]->n)) {
312*e0c4386eSCy Schubert TEST_info("test SS deepcopy int %d", i);
313*e0c4386eSCy Schubert goto end;
314*e0c4386eSCy Schubert }
315*e0c4386eSCy Schubert if (!TEST_char_eq(p->c, v[i]->c)) {
316*e0c4386eSCy Schubert TEST_info("SS deepcopy char %d", i);
317*e0c4386eSCy Schubert goto end;
318*e0c4386eSCy Schubert }
319*e0c4386eSCy Schubert }
320*e0c4386eSCy Schubert
321*e0c4386eSCy Schubert /* pop_free - we rely on the malloc debug to catch the leak */
322*e0c4386eSCy Schubert sk_SS_pop_free(r, &SS_free);
323*e0c4386eSCy Schubert r = NULL;
324*e0c4386eSCy Schubert
325*e0c4386eSCy Schubert /* delete_ptr */
326*e0c4386eSCy Schubert p = sk_SS_delete_ptr(s, v[3]);
327*e0c4386eSCy Schubert if (!TEST_ptr(p))
328*e0c4386eSCy Schubert goto end;
329*e0c4386eSCy Schubert SS_free(p);
330*e0c4386eSCy Schubert if (!TEST_int_eq(sk_SS_num(s), n - 1))
331*e0c4386eSCy Schubert goto end;
332*e0c4386eSCy Schubert for (i = 0; i < n-1; i++)
333*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_SS_value(s, i), v[i<3 ? i : 1+i])) {
334*e0c4386eSCy Schubert TEST_info("SS delete ptr item %d", i);
335*e0c4386eSCy Schubert goto end;
336*e0c4386eSCy Schubert }
337*e0c4386eSCy Schubert
338*e0c4386eSCy Schubert testresult = 1;
339*e0c4386eSCy Schubert end:
340*e0c4386eSCy Schubert sk_SS_pop_free(r, &SS_free);
341*e0c4386eSCy Schubert sk_SS_pop_free(s, &SS_free);
342*e0c4386eSCy Schubert return testresult;
343*e0c4386eSCy Schubert }
344*e0c4386eSCy Schubert
test_SU_stack(void)345*e0c4386eSCy Schubert static int test_SU_stack(void)
346*e0c4386eSCy Schubert {
347*e0c4386eSCy Schubert STACK_OF(SU) *s = sk_SU_new_null();
348*e0c4386eSCy Schubert SU v[10];
349*e0c4386eSCy Schubert const int n = OSSL_NELEM(v);
350*e0c4386eSCy Schubert int i;
351*e0c4386eSCy Schubert int testresult = 0;
352*e0c4386eSCy Schubert
353*e0c4386eSCy Schubert /* allocate and push */
354*e0c4386eSCy Schubert for (i = 0; i < n; i++) {
355*e0c4386eSCy Schubert if ((i & 1) == 0)
356*e0c4386eSCy Schubert v[i].n = i;
357*e0c4386eSCy Schubert else
358*e0c4386eSCy Schubert v[i].c = 'A' + i;
359*e0c4386eSCy Schubert if (!TEST_int_eq(sk_SU_num(s), i)) {
360*e0c4386eSCy Schubert TEST_info("SU stack size %d", i);
361*e0c4386eSCy Schubert goto end;
362*e0c4386eSCy Schubert }
363*e0c4386eSCy Schubert sk_SU_push(s, v + i);
364*e0c4386eSCy Schubert }
365*e0c4386eSCy Schubert if (!TEST_int_eq(sk_SU_num(s), n))
366*e0c4386eSCy Schubert goto end;
367*e0c4386eSCy Schubert
368*e0c4386eSCy Schubert /* check the pointers are correct */
369*e0c4386eSCy Schubert for (i = 0; i < n; i++)
370*e0c4386eSCy Schubert if (!TEST_ptr_eq(sk_SU_value(s, i), v + i)) {
371*e0c4386eSCy Schubert TEST_info("SU pointer check %d", i);
372*e0c4386eSCy Schubert goto end;
373*e0c4386eSCy Schubert }
374*e0c4386eSCy Schubert
375*e0c4386eSCy Schubert testresult = 1;
376*e0c4386eSCy Schubert end:
377*e0c4386eSCy Schubert sk_SU_free(s);
378*e0c4386eSCy Schubert return testresult;
379*e0c4386eSCy Schubert }
380*e0c4386eSCy Schubert
setup_tests(void)381*e0c4386eSCy Schubert int setup_tests(void)
382*e0c4386eSCy Schubert {
383*e0c4386eSCy Schubert ADD_ALL_TESTS(test_int_stack, 4);
384*e0c4386eSCy Schubert ADD_ALL_TESTS(test_uchar_stack, 4);
385*e0c4386eSCy Schubert ADD_TEST(test_SS_stack);
386*e0c4386eSCy Schubert ADD_TEST(test_SU_stack);
387*e0c4386eSCy Schubert return 1;
388*e0c4386eSCy Schubert }
389