comparison test/callback_suite/README.txt @ 509:f3d44195dbdf

callback_suite: - further, big refactoring to make the test data setup be a lot more in line with call_suite and call_suite_aggrs - added support to test void return values (was missing in prev version)
author Tassilo Philipp
date Sat, 09 Apr 2022 23:00:24 +0200
parents 1aa2af848e8a
children 95f6f43178ed
comparison
equal deleted inserted replaced
508:1aa2af848e8a 509:f3d44195dbdf
9 9
10 DESCRIPTION 10 DESCRIPTION
11 11
12 Generates a set of callback invokers in C using lua as a preprocessor. 12 Generates a set of callback invokers in C using lua as a preprocessor.
13 13
14 The invokers pass arguments to the callback to test from a set of reference 14 The invokers pass random arguments to the callback to test, from a set of
15 values which are argument type- and position-specific. 15 reference values which are argument type- and position-specific.
16 16
17 17
18 The Callback Invocation Body 18 The Callback Invocation Body
19 19
20 Example: 20 Example:
21 The body for a signature of type "dpdf)p" at case id 19 is: 21 The body for a signature of type "dpdf)p" at case id 19 is:
22 22
23 void f19(void* addr) 23 void f19(void* addr)
24 { 24 {
25 Result.p = ((CONFIG_API p(*)(d,p,d,f))addr)(ValueMatrix[0].d,ValueMatrix[1].p,ValueMatrix[2].d,ValueMatrix[3].f); 25 V_p[4] = ((CONFIG_API p(*)(d,p,d,f))addr)(K_d[0],K_p[1],K_d[2],K_f[3]);
26 } ^^^^^^^^^^- specific calling convention 26 } ^^^^^^^^^^- specific calling convention
27 ^^^^^^^^^^^^^- signature 27 ^^^^^^^^^^^^^- signature
28 ^- return type signature 28 ^- return type ^^^^- dyncallback object
29 ^- arg signature char 0 value (to be retrieved in handler) 29 ^- args from reference values (to be retrieved in handler)
30 30
31 The K_? values are the reference values, which are supposed to be copied to
32 V_?, and are compared for identity after invocation. The arguments are copied
33 to V_? in the callback handler, called through "addr".
31 34
32 Result (type DCValue) and ValueMatrix (type DCValueSet[MAXARGS], holding the 35 The reference values stored in K_? are generated once, randomly, at startup.
33 reference values) are globals, as well as an Args (type DCValue) array, which
34 is used by the callback handler to write the received argument values to.
35
36
37 Reference argument and result value
38
39 The reference values are generated by get_reference_arg() and
40 get_reference_result(), which always return the exact same value for the a
41 given set of arguments.
42 ValueMatrix was filled by those functions and thus holds a temporary copy,
43 which is useful to test whether any input argument was modified (which should
44 never be the case).
45 36
46 37
47 Testing for exotic calling conventions on Windows 38 Testing for exotic calling conventions on Windows
48 39
49 Specify 'api' and 'ccprefix' accordingly: 40 Specify 'api' and 'ccprefix' accordingly: