1 #include "Generators.h"
2 
generate1(Testing::param_t * result,Testing::param_t * data,Testing::nbParameterEntries_t & nbEntries)3 void generate1(Testing::param_t *result,Testing::param_t *data,Testing::nbParameterEntries_t &nbEntries)
4 {
5     Testing::param_t *pa,va;
6 
7     pa = data;
8     int nba = *pa++;
9     nbEntries = 0;
10     for(int ia=0; ia < nba ; ia ++)
11     {
12       va = *pa++;
13       *result++ = va;
14       nbEntries++;
15     }
16 }
17 
generate2(Testing::param_t * result,Testing::param_t * data,Testing::nbParameterEntries_t & nbEntries)18 void generate2(Testing::param_t *result,Testing::param_t *data,Testing::nbParameterEntries_t &nbEntries)
19 {
20     Testing::param_t *pa,*paStart,va;
21     int na;
22 
23     Testing::param_t *pb,*pbStart,vb;
24     int nb;
25 
26     nbEntries = 0;
27 
28     na = data[0];
29     paStart = &data[1];
30     pa = paStart;
31 
32     nb = data[na+1];
33     pbStart = &data[na+2];
34     pb = pbStart;
35 
36     pa = paStart;
37     for(int ia=0; ia < na; ia ++)
38     {
39        va = *pa++;
40 
41        pb = pbStart;
42        for(int ib = 0; ib < nb; ib++)
43        {
44           vb = *pb++;
45 
46           *result++ = va;
47           *result++ = vb;
48           nbEntries++;
49 
50        }
51     }
52 
53 }
54 
generate3(Testing::param_t * result,Testing::param_t * data,Testing::nbParameterEntries_t & nbEntries)55 void generate3(Testing::param_t *result,Testing::param_t *data,Testing::nbParameterEntries_t &nbEntries)
56 {
57     Testing::param_t *pa,*paStart,va;
58     int na;
59 
60     Testing::param_t *pb,*pbStart,vb;
61     int nb;
62 
63     Testing::param_t *pc,*pcStart,vc;
64     int nc;
65 
66     nbEntries=0;
67 
68     na = data[0];
69     paStart = &data[1];
70     pa = paStart;
71 
72     nb = data[na+1];
73     pbStart = &data[na+2];
74     pb = pbStart;
75 
76     nc = data[na+1 + nb + 1];
77     pcStart = &data[na+1 + nb + 1 + 1];
78     pc = pcStart;
79 
80 
81     pa = paStart;
82     for(int ia=0; ia < na; ia ++)
83     {
84        va = *pa++;
85        //printf("%d \n",va);
86 
87        pb = pbStart;
88        for(int ib = 0; ib < nb; ib++)
89        {
90           vb = *pb++;
91           //printf("%d %d \n",va,vb);
92 
93           pc = pcStart;
94           for(int ic = 0; ic < nc; ic++)
95           {
96              vc = *pc++;
97 
98              *result++ = va;
99              *result++ = vb;
100              *result++ = vc;
101              nbEntries++;
102              //printf("%d %d %d\n",va,vb,vc);
103           }
104 
105        }
106     }
107    // printf("OK\n");
108 }
109 
generate4(Testing::param_t * result,Testing::param_t * data,Testing::nbParameterEntries_t & nbEntries)110 void generate4(Testing::param_t *result,Testing::param_t *data,Testing::nbParameterEntries_t &nbEntries)
111 {
112     Testing::param_t *pa,*paStart,va;
113     int na;
114 
115     Testing::param_t *pb,*pbStart,vb;
116     int nb;
117 
118     Testing::param_t *pc,*pcStart,vc;
119     int nc;
120 
121     Testing::param_t *pd,*pdStart,vd;
122     int nd;
123 
124     nbEntries=0;
125 
126     na = data[0];
127     paStart = &data[1];
128     pa = paStart;
129 
130     nb = data[na+1];
131     pbStart = &data[na+2];
132     pb = pbStart;
133 
134     nc = data[na+1 + nb + 1];
135     pcStart = &data[na+1 + nb + 1 + 1];
136     pc = pcStart;
137 
138     nd = data[na+1 + nb + 1 + nc + 1 ];
139     pdStart = &data[na+1 + nb + 1 + nc + 1 + 1];
140     pd = pdStart;
141 
142     pa = paStart;
143     for(int ia=0; ia < na; ia ++)
144     {
145        va = *pa++;
146 
147        pb = pbStart;
148        for(int ib = 0; ib < nb; ib++)
149        {
150           vb = *pb++;
151 
152           pc = pcStart;
153           for(int ic = 0; ic < nc; ic++)
154           {
155              vc = *pc++;
156 
157              pd = pdStart;
158              for(int id = 0; id < nd; id++)
159              {
160                 vd = *pd++;
161                 *result++ = va;
162                 *result++ = vb;
163                 *result++ = vc;
164                 *result++ = vd;
165                 nbEntries++;
166              }
167           }
168 
169        }
170     }
171 
172 }
173