-
Notifications
You must be signed in to change notification settings - Fork 0
/
gregg_shared.unit
87 lines (62 loc) · 17.6 KB
/
gregg_shared.unit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/local/bin/koios
# koios-polos (axis of heaven) unit testing meta-language
#23456789-12 123456789-123456789-123456789-12345 123456789-123456789-123456 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789- 123456789- 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789- 123456789-123456789-
#==(verb)=== ===========(description)=========== =====(function)=========== ========================(arguments)================================================================= ==(test)== ==========================(results)================================================================= ========(var)=======
PREP include the prototype headers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
incl include public header gregg.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#23456789-12 123456789-123456789-123456789-12345 123456789-123456789-123456 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789- 123456789- 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789- 123456789-123456789-
#==(verb)=== ===========(description)=========== =====(function)=========== ========================(arguments)================================================================= ==(test)== ==========================(results)================================================================= ========(var)=======
SCRP (SHARED) verify allocating and freeing objects 0s malloc SHARED_new, SHARED_free ((01.---)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
COND initialize the testing environment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec start testing PROG__unit_quiet i_equal 0
local create working/return variables - - - - - - - - - - - - - void *x_unit = NULL;
local create working/return variables - - - - - - - - - - - - - void *x_save = NULL;
COND attempt to free a non-existant object - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call free SHARED_free B_BASE , &x_unit i_lesser 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
COND verify creating an object - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call new SHARED_new B_BASE , '-' , 100 , PROG_wiper , &x_unit i_equal 1
echo ... check pointer - - - - - - - - - - - - - x_unit p_exists 0
COND attempt to create with a used-pointer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
code ... save previous instance - - - - - - - - - - - - - x_save = x_unit;
exec call new SHARED_new B_BASE , '-' , 100 , PROG_wiper , &x_unit i_lesser 0
echo ... check pointer does not change - - - - - - - - - - - - - x_unit p_equal [[ x_save ]]
COND verify freeing the pointer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call free SHARED_free B_BASE , &x_unit i_equal 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
COND attempt to free a grounded pointer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call free SHARED_free B_BASE , &x_unit i_lesser 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
COND verify creating another object - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call new SHARED_new B_BASE , '-' , 100 , PROG_wiper , &x_unit i_equal 1
echo ... check pointer - - - - - - - - - - - - - x_unit p_exists 0
COND verify forcing the creation reusing the ponter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
code ... save previous instance - - - - - - - - - - - - - x_save = x_unit;
exec call new SHARED_new B_BASE , 'y' , 100 , PROG_wiper , &x_unit i_equal 1
echo ... check pointer - - - - - - - - - - - - - x_unit p_exists 0
echo ... check pointer did change - - - - - - - - - - - - - x_unit p_not [[ x_save ]]
COND verify freeing the first - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call free SHARED_free B_BASE , &x_save i_equal 0
echo ... check pointer - - - - - - - - - - - - - x_save p_null 0
COND verify freeing the second - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call free SHARED_free B_BASE , &x_unit i_equal 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
COND attempt to create bad type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call new SHARED_new 0 , '-' , 100 , PROG_wiper , &x_unit i_lesser 0
echo ... check pointer - - - - - - - - - - - - - x_save p_null 0
COND attempt to create bad sizes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call new SHARED_new B_BASE , '-' , -1 , PROG_wiper , &x_unit i_lesser 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
exec call new SHARED_new B_BASE , '-' , 0 , PROG_wiper , &x_unit i_lesser 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
COND attempt to create with null return pointer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call new SHARED_new B_BASE , '-' , 100 , PROG_wiper , NULL i_lesser 0
COND verify creating object without wiper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call new SHARED_new B_BASE , '-' , 100 , NULL , &x_unit i_equal 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_exists 0
COND verify freeing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((01.001)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec call free SHARED_free B_BASE , &x_unit i_equal 0
echo ... check pointer - - - - - - - - - - - - - x_unit p_null 0
COND complete testing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((04.003)) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
exec stop testing PROG__unit_end i_equal 0
# end-of-file. done, finito, completare, whimper [Ï´···