398
|
1 /* C support for testing XEmacs - see tests/automated/c-tests.el
|
|
2 Copyright (C) 2000 Martin Buchholz
|
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs is free software; you can redistribute it and/or modify it
|
|
7 under the terms of the GNU General Public License as published by the
|
|
8 Free Software Foundation; either version 2, or (at your option) any
|
|
9 later version.
|
|
10
|
|
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Author: Martin Buchholz
|
|
22
|
|
23 This file provides support for running tests for XEmacs that cannot
|
|
24 be written entirely in Lisp. These tests are run automatically via
|
|
25 tests/automated/c-tests.el, or can be run by hand using M-x */
|
|
26
|
|
27
|
|
28 #include <config.h>
|
|
29 #include "lisp.h"
|
|
30 #include "buffer.h"
|
|
31 #include "lstream.h"
|
|
32 #include "opaque.h"
|
|
33
|
|
34 static Lisp_Object Vtest_function_list;
|
|
35
|
|
36
|
|
37 DEFUN ("test-data-format-conversion", Ftest_data_format_conversion, 0, 0, "", /*
|
|
38 Test TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT()
|
|
39 */
|
|
40 ())
|
|
41 {
|
|
42 void *ptr; size_t len;
|
|
43 Lisp_Object string, opaque;
|
|
44
|
|
45 Bufbyte int_foo[] = "\n\nfoo\nbar";
|
|
46 Extbyte ext_unix[]= "\n\nfoo\nbar";
|
|
47
|
|
48 Extbyte ext_dos[] = "\r\n\r\nfoo\r\nbar";
|
|
49 Extbyte ext_mac[] = "\r\rfoo\rbar";
|
|
50 Lisp_Object opaque_dos = make_opaque (ext_dos, sizeof (ext_dos) - 1);
|
|
51 Lisp_Object string_foo = make_string (int_foo, sizeof (int_foo) - 1);
|
|
52
|
|
53 Extbyte ext_latin[] = "f\372b\343\340";
|
|
54 Bufbyte int_latin1[] = "f\201\372b\201\343\201\340";
|
|
55 Bufbyte int_latin2[] = "f\202\372b\202\343\202\340";
|
|
56 #ifdef MULE
|
|
57 Extbyte ext_latin12[]= "f\033-A\372b\343\340\033-B";
|
|
58 Extbyte ext_tilde[] = "f~b~~";
|
|
59 Lisp_Object string_latin2 = make_string (int_latin2, sizeof (int_latin2) - 1);
|
|
60 #endif
|
|
61 Lisp_Object opaque_latin = make_opaque (ext_latin, sizeof (ext_latin) - 1);
|
|
62 Lisp_Object opaque0_latin = make_opaque (ext_latin, sizeof (ext_latin));
|
|
63 Lisp_Object string_latin1 = make_string (int_latin1, sizeof (int_latin1) - 1);
|
|
64
|
|
65 /* Check for expected strings before and after conversion.
|
|
66 Conversions depend on whether MULE is defined,
|
|
67 and on whether FILE_CODING is defined. */
|
|
68 #ifdef MULE
|
|
69 #define DFC_CHECK_DATA_COND_MULE(ptr,len, \
|
|
70 constant_string_mule, \
|
|
71 constant_string_non_mule) \
|
|
72 DFC_CHECK_DATA (ptr, len, constant_string_mule)
|
|
73 #define DFC_CHECK_DATA_COND_MULE_NUL(ptr,len, \
|
|
74 constant_string_mule, \
|
|
75 constant_string_non_mule) \
|
|
76 DFC_CHECK_DATA_NUL (ptr, len, constant_string_mule)
|
|
77 #else
|
|
78 #define DFC_CHECK_DATA_COND_MULE(ptr,len, \
|
|
79 constant_string_mule, \
|
|
80 constant_string_non_mule) \
|
|
81 DFC_CHECK_DATA (ptr, len, constant_string_non_mule)
|
|
82 #define DFC_CHECK_DATA_COND_MULE_NUL(ptr,len, \
|
|
83 constant_string_mule, \
|
|
84 constant_string_non_mule) \
|
|
85 DFC_CHECK_DATA_NUL (ptr, len, constant_string_non_mule)
|
|
86 #endif
|
|
87
|
|
88 #ifdef FILE_CODING
|
|
89 #define DFC_CHECK_DATA_COND_EOL(ptr,len, \
|
|
90 constant_string_eol, \
|
|
91 constant_string_non_eol) \
|
|
92 DFC_CHECK_DATA (ptr, len, constant_string_eol)
|
|
93 #define DFC_CHECK_DATA_COND_EOL_NUL(ptr,len, \
|
|
94 constant_string_eol, \
|
|
95 constant_string_non_eol) \
|
|
96 DFC_CHECK_DATA_NUL (ptr, len, constant_string_eol)
|
|
97 #else
|
|
98 #define DFC_CHECK_DATA_COND_EOL(ptr,len, \
|
|
99 constant_string_eol, \
|
|
100 constant_string_non_eol) \
|
|
101 DFC_CHECK_DATA (ptr, len, constant_string_non_eol)
|
|
102 #define DFC_CHECK_DATA_COND_EOL_NUL(ptr,len, \
|
|
103 constant_string_eol, \
|
|
104 constant_string_non_eol) \
|
|
105 DFC_CHECK_DATA_NUL (ptr, len, constant_string_non_eol)
|
|
106 #endif
|
|
107
|
|
108 /* Check for expected strings before and after conversion. */
|
|
109 #define DFC_CHECK_DATA(ptr,len, constant_string) do { \
|
|
110 assert ((len) == sizeof (constant_string) - 1); \
|
|
111 assert (!memcmp (ptr, constant_string, len)); \
|
|
112 } while (0)
|
|
113
|
|
114 /* Macro version that includes the trailing NULL byte. */
|
|
115 #define DFC_CHECK_DATA_NUL(ptr,len,constant_string) do {\
|
|
116 assert ((len) == sizeof (constant_string)); \
|
|
117 assert (!memcmp (ptr, constant_string, len)); \
|
|
118 } while (0)
|
|
119
|
|
120 #ifdef MULE
|
|
121 ptr = NULL, len = rand();
|
|
122 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
|
|
123 ALLOCA, (ptr, len),
|
|
124 Fget_coding_system (intern ("iso-8859-2")));
|
|
125 DFC_CHECK_DATA_NUL (ptr, len, ext_latin);
|
|
126
|
|
127 ptr = NULL, len = rand();
|
|
128 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin2,
|
|
129 ALLOCA, (ptr, len),
|
|
130 Fget_coding_system (intern ("iso-8859-2")));
|
|
131 DFC_CHECK_DATA (ptr, len, ext_latin);
|
|
132
|
|
133 ptr = NULL, len = rand();
|
|
134 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
|
|
135 ALLOCA, (ptr, len),
|
|
136 Fget_coding_system (intern ("iso-8859-2")));
|
|
137 DFC_CHECK_DATA (ptr, len, ext_latin12);
|
|
138
|
|
139 ptr = NULL, len = rand();
|
|
140 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
|
|
141 MALLOC, (ptr, len),
|
|
142 Fget_coding_system (intern ("iso-8859-2")));
|
|
143 DFC_CHECK_DATA (ptr, len, ext_latin);
|
|
144 xfree (ptr);
|
|
145
|
|
146 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
|
|
147 LISP_OPAQUE, opaque,
|
|
148 Fget_coding_system (intern ("iso-8859-2")));
|
|
149 DFC_CHECK_DATA (XOPAQUE_DATA (opaque), XOPAQUE_SIZE (opaque), ext_latin);
|
|
150
|
|
151 ptr = NULL, len = rand();
|
|
152 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
|
|
153 ALLOCA, (ptr, len),
|
|
154 intern ("iso-8859-2"));
|
|
155 DFC_CHECK_DATA (ptr, len, int_latin2);
|
|
156
|
|
157 ptr = NULL, len = rand();
|
|
158 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
|
|
159 MALLOC, (ptr, len),
|
|
160 intern ("iso-8859-2"));
|
|
161 DFC_CHECK_DATA (ptr, len, int_latin2);
|
|
162 xfree (ptr);
|
|
163
|
|
164 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
|
|
165 LISP_STRING, string,
|
|
166 intern ("iso-8859-2"));
|
|
167 DFC_CHECK_DATA (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2);
|
|
168
|
|
169 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin,
|
|
170 LISP_STRING, string,
|
|
171 intern ("iso-8859-2"));
|
|
172 DFC_CHECK_DATA (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2);
|
|
173
|
|
174 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin,
|
|
175 LISP_STRING, string,
|
|
176 intern ("iso-8859-2"));
|
|
177 DFC_CHECK_DATA_NUL (XSTRING_DATA (string), XSTRING_LENGTH (string), int_latin2);
|
|
178
|
|
179 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin,
|
|
180 LISP_BUFFER, Fcurrent_buffer(),
|
|
181 intern ("iso-8859-2"));
|
|
182 DFC_CHECK_DATA_NUL (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)),
|
|
183 sizeof (int_latin2), int_latin2);
|
|
184
|
|
185 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin,
|
|
186 LISP_BUFFER, Fcurrent_buffer(),
|
|
187 intern ("iso-8859-1"));
|
|
188 DFC_CHECK_DATA (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)),
|
|
189 sizeof (int_latin1) - 1, int_latin1);
|
|
190
|
|
191 TO_INTERNAL_FORMAT (DATA, (ext_latin12, sizeof (ext_latin12) - 1),
|
|
192 ALLOCA, (ptr, len),
|
|
193 intern ("iso-8859-2"));
|
|
194 DFC_CHECK_DATA (ptr, len, int_latin1);
|
|
195
|
|
196 #endif /* MULE */
|
|
197
|
|
198 ptr = NULL, len = rand();
|
|
199 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
|
|
200 ALLOCA, (ptr, len),
|
|
201 Qbinary);
|
|
202 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
203
|
|
204 ptr = NULL, len = rand();
|
|
205 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1)),
|
|
206 ALLOCA, (ptr, len),
|
|
207 Qbinary);
|
|
208 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_latin, int_latin1);
|
|
209
|
|
210 ptr = NULL, len = rand();
|
|
211 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
|
|
212 ALLOCA, (ptr, len),
|
|
213 Fget_coding_system (Qbinary));
|
|
214 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_tilde, int_latin2);
|
|
215
|
|
216 ptr = NULL, len = rand();
|
|
217 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
|
|
218 ALLOCA, (ptr, len),
|
|
219 intern ("iso-8859-1"));
|
|
220 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
221
|
|
222
|
|
223 ptr = NULL, len = rand();
|
|
224 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
|
|
225 ALLOCA, (ptr, len),
|
|
226 Qbinary);
|
|
227 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
228
|
|
229 ptr = NULL, len = rand();
|
|
230 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
|
|
231 ALLOCA, (ptr, len),
|
|
232 Fget_coding_system (Qbinary));
|
|
233 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
234
|
|
235 ptr = NULL, len = rand();
|
|
236 TO_EXTERNAL_FORMAT (LISP_STRING, string_latin1,
|
|
237 ALLOCA, (ptr, len),
|
|
238 intern ("iso-8859-1"));
|
|
239 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
240
|
|
241 ptr = NULL, len = rand();
|
|
242 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
|
|
243 MALLOC, (ptr, len),
|
|
244 Qbinary);
|
|
245 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
246 xfree (ptr);
|
|
247
|
|
248 ptr = NULL, len = rand();
|
|
249 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
|
|
250 MALLOC, (ptr, len),
|
|
251 Fget_coding_system (Qbinary));
|
|
252 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_tilde, int_latin2);
|
|
253 xfree (ptr);
|
|
254
|
|
255 ptr = NULL, len = rand();
|
|
256 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
|
|
257 MALLOC, (ptr, len),
|
|
258 intern ("iso-8859-1"));
|
|
259 DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1);
|
|
260 xfree (ptr);
|
|
261
|
|
262 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
|
|
263 LISP_OPAQUE, opaque,
|
|
264 Qbinary);
|
|
265 DFC_CHECK_DATA_COND_MULE (XOPAQUE_DATA (opaque),
|
|
266 XOPAQUE_SIZE (opaque), ext_latin, int_latin1);
|
|
267
|
|
268 TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
|
|
269 LISP_OPAQUE, opaque,
|
|
270 Fget_coding_system (Qbinary));
|
|
271 DFC_CHECK_DATA_COND_MULE_NUL (XOPAQUE_DATA (opaque),
|
|
272 XOPAQUE_SIZE (opaque), ext_tilde, int_latin2);
|
|
273
|
|
274 TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
|
|
275 LISP_OPAQUE, opaque,
|
|
276 intern ("iso-8859-1"));
|
|
277 DFC_CHECK_DATA_COND_MULE (XOPAQUE_DATA (opaque),
|
|
278 XOPAQUE_SIZE (opaque), ext_latin, int_latin1);
|
|
279
|
|
280 ptr = NULL, len = rand();
|
|
281 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
|
|
282 ALLOCA, (ptr, len),
|
|
283 Qbinary);
|
|
284 DFC_CHECK_DATA_COND_MULE (ptr, len, int_latin1, ext_latin);
|
|
285
|
|
286 ptr = NULL, len = rand();
|
|
287 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
|
|
288 ALLOCA, (ptr, len),
|
|
289 intern ("iso-8859-1"));
|
|
290 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin);
|
|
291
|
|
292 ptr = NULL, len = rand();
|
|
293 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
|
|
294 MALLOC, (ptr, len),
|
|
295 intern ("iso-8859-1"));
|
|
296 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin);
|
|
297 xfree (ptr);
|
|
298
|
|
299 ptr = NULL, len = rand();
|
|
300 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
|
|
301 MALLOC, (ptr, len),
|
|
302 Qnil);
|
|
303 DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin);
|
|
304 xfree (ptr);
|
|
305
|
|
306 TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
|
|
307 LISP_STRING, string,
|
|
308 intern ("iso-8859-1"));
|
|
309 DFC_CHECK_DATA_COND_MULE (XSTRING_DATA (string),
|
|
310 XSTRING_LENGTH (string), int_latin1, ext_latin);
|
|
311
|
|
312 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_latin,
|
|
313 LISP_STRING, string,
|
|
314 intern ("iso-8859-1"));
|
|
315 DFC_CHECK_DATA_COND_MULE (XSTRING_DATA (string),
|
|
316 XSTRING_LENGTH (string), int_latin1, ext_latin);
|
|
317
|
|
318 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque0_latin,
|
|
319 LISP_STRING, string,
|
|
320 intern ("iso-8859-1"));
|
|
321 DFC_CHECK_DATA_COND_MULE_NUL (XSTRING_DATA (string),
|
|
322 XSTRING_LENGTH (string), int_latin1, ext_latin);
|
|
323
|
|
324
|
|
325 ptr = NULL, len = rand();
|
|
326 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo)),
|
|
327 MALLOC, (ptr, len),
|
|
328 Fget_coding_system (Qbinary));
|
|
329 DFC_CHECK_DATA_COND_EOL_NUL (ptr, len, ext_unix, int_foo);
|
|
330 xfree (ptr);
|
|
331
|
|
332 ptr = NULL, len = rand();
|
|
333 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
|
|
334 LISP_OPAQUE, opaque,
|
|
335 intern ("raw-text-mac"));
|
|
336 DFC_CHECK_DATA_COND_EOL (XOPAQUE_DATA (opaque),
|
|
337 XOPAQUE_SIZE (opaque), ext_mac, int_foo);
|
|
338
|
|
339 ptr = NULL, len = rand();
|
|
340 TO_EXTERNAL_FORMAT (LISP_STRING, string_foo,
|
|
341 ALLOCA, (ptr, len),
|
|
342 intern ("raw-text-dos"));
|
|
343 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_dos, int_foo);
|
|
344
|
|
345 ptr = NULL, len = rand();
|
|
346 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
|
|
347 ALLOCA, (ptr, len),
|
|
348 intern ("raw-text-unix"));
|
|
349 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_unix, int_foo);
|
|
350
|
|
351 ptr = NULL, len = rand();
|
|
352 TO_EXTERNAL_FORMAT (LISP_STRING, string_foo,
|
|
353 MALLOC, (ptr, len),
|
|
354 intern ("no-conversion-mac"));
|
|
355 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_mac, int_foo);
|
|
356 xfree (ptr);
|
|
357
|
|
358 ptr = NULL, len = rand();
|
|
359 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
|
|
360 ALLOCA, (ptr, len),
|
|
361 Fget_coding_system (intern ("no-conversion-dos")));
|
|
362 DFC_CHECK_DATA_COND_EOL (ptr, len, ext_dos, int_foo);
|
|
363
|
|
364 ptr = NULL, len = rand();
|
|
365 TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo)),
|
|
366 ALLOCA, (ptr, len),
|
|
367 intern ("no-conversion-unix"));
|
|
368 DFC_CHECK_DATA_COND_EOL_NUL (ptr, len, ext_unix, int_foo);
|
|
369
|
|
370 #ifdef FILE_CODING
|
|
371 TO_INTERNAL_FORMAT (LISP_OPAQUE, opaque_dos,
|
|
372 LISP_BUFFER, Fcurrent_buffer(),
|
|
373 intern ("undecided"));
|
|
374 DFC_CHECK_DATA (BUF_BYTE_ADDRESS (current_buffer, BUF_PT (current_buffer)),
|
|
375 sizeof (int_foo) - 1, int_foo);
|
|
376
|
|
377 #endif /* FILE_CODING */
|
|
378
|
|
379 TO_INTERNAL_FORMAT (DATA, (ext_mac, sizeof (ext_mac) - 1),
|
|
380 LISP_STRING, string,
|
|
381 intern ("iso-8859-1"));
|
|
382 DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string),
|
|
383 XSTRING_LENGTH (string), int_foo, ext_mac);
|
|
384
|
|
385 {
|
|
386 Lisp_Object stream =
|
|
387 make_fixed_buffer_input_stream (ext_dos, sizeof (ext_dos) - 1);
|
|
388 TO_INTERNAL_FORMAT (LISP_LSTREAM, stream,
|
|
389 LISP_STRING, string,
|
|
390 intern ("iso-8859-1"));
|
|
391 DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string),
|
|
392 XSTRING_LENGTH (string), int_foo, ext_dos);
|
|
393 }
|
|
394
|
|
395 TO_INTERNAL_FORMAT (DATA, (ext_unix, sizeof (ext_unix) - 1),
|
|
396 LISP_STRING, string,
|
|
397 intern ("no-conversion"));
|
|
398 DFC_CHECK_DATA_COND_EOL (XSTRING_DATA (string),
|
|
399 XSTRING_LENGTH (string), int_foo, ext_unix);
|
|
400
|
|
401
|
|
402 ptr = NULL, len = rand();
|
|
403 TO_EXTERNAL_FORMAT (LISP_OPAQUE, opaque_dos,
|
|
404 ALLOCA, (ptr, len),
|
|
405 Qbinary);
|
|
406 DFC_CHECK_DATA (ptr, len, ext_dos);
|
|
407
|
|
408 return intern ("PASS");
|
|
409 }
|
|
410
|
|
411
|
|
412
|
|
413 #define TESTS_DEFSUBR(Fname) do { \
|
|
414 DEFSUBR (Fname); \
|
|
415 Vtest_function_list = \
|
|
416 Fcons (intern (subr_name (&S##Fname)), \
|
|
417 Vtest_function_list); \
|
|
418 } while (0)
|
|
419
|
|
420 void
|
|
421 syms_of_tests (void)
|
|
422 {
|
|
423 Vtest_function_list = Qnil;
|
|
424
|
|
425 TESTS_DEFSUBR (Ftest_data_format_conversion);
|
|
426 /* Add other test functions here with TESTS_DEFSUBR */
|
|
427 }
|
|
428
|
|
429 void
|
|
430 vars_of_tests (void)
|
|
431 {
|
|
432 DEFVAR_LISP ("test-function-list", &Vtest_function_list /*
|
|
433 List of all test functions defined in tests.c.
|
|
434 For use by the automated test suite. See tests/automated/c-tests.
|
|
435 */ );
|
|
436 }
|