Updated FSF address in all files. Fixes ticket:51
[debian/gnuradio] / gr-error-correcting-codes / src / lib / libecc / tests / qa_encoder_convolutional_ic1_ic1.cc
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 #include "encoder_convolutional.h"
24 #include <qa_encoder_convolutional_ic1_ic1.h>
25 #include <cppunit/TestAssert.h>
26 #include <string.h>
27 #include <iostream>
28 #include <iomanip>
29 #include <stdio.h>
30
31 #define DO_PRINT_DEBUG 0
32
33 // test number counter
34
35 static size_t g_t_num = 0;
36
37 void
38 qa_encoder_convolutional_ic1_ic1::do_encoder_check
39 (bool use_encode_in_or_out,
40  const char** c_in,
41  const char** c_res,
42  const size_t n_io_items,
43  const size_t* n_input_items,
44  const size_t* n_output_items,
45  const size_t block_size_bits,
46  const size_t n_code_inputs,
47  const size_t n_code_outputs,
48  const int* code_generators,
49  const int* code_feedback,
50  const bool do_termination,
51  const size_t start_state,
52  const size_t term_state,
53  const int encode_soai)
54 {
55   if (DO_PRINT_DEBUG)
56     std::cout << "Starting Test " << g_t_num << "\n";
57
58   std::vector<int> t_code_generators;
59   t_code_generators.assign (n_code_inputs * n_code_outputs, 0);
60   for (size_t m = 0; m < (n_code_inputs * n_code_outputs); m++)
61     t_code_generators[m] = code_generators[m];
62
63   encoder_convolutional* t_encoder;
64
65   if (code_feedback) {
66     std::vector<int> t_code_feedback;
67     t_code_feedback.assign (n_code_inputs * n_code_outputs, 0);
68     for (size_t m = 0; m < (n_code_inputs * n_code_outputs); m++)
69       t_code_feedback[m] = code_feedback[m];
70
71     t_encoder = new encoder_convolutional
72       (block_size_bits,
73        n_code_inputs,
74        n_code_outputs,
75        t_code_generators,
76        t_code_feedback,
77        do_termination,
78        start_state,
79        term_state);
80   } else {
81     t_encoder = new encoder_convolutional
82       (block_size_bits,
83        n_code_inputs,
84        n_code_outputs,
85        t_code_generators,
86        do_termination,
87        start_state,
88        term_state);
89   }
90
91   size_t t_total_n_input_items = 0;
92   size_t t_total_n_output_items = 0;
93   for (size_t m = 0; m < n_io_items; m++) {
94     t_total_n_input_items += n_input_items[m];
95     t_total_n_output_items += n_output_items[m];
96   }
97
98   code_input_ic1l* t_c_in = new code_input_ic1l (n_code_inputs);
99   t_c_in->set_buffer ((void**) c_in, t_total_n_input_items);
100
101   char** t_out = new char*[n_code_outputs];
102   for (size_t m = 0; m < n_code_outputs; m++) {
103     t_out[m] = new char[t_total_n_output_items];
104   }
105
106   code_output_ic1l* t_c_out = new code_output_ic1l (n_code_outputs);
107   t_c_out->set_buffer ((void**) t_out, t_total_n_output_items);
108
109   bool t_errors = false;
110
111   for (size_t m = 0; m < n_io_items; m++) {
112     if (use_encode_in_or_out == true) {
113       size_t t_n_output_items_used = t_encoder->encode (t_c_in,
114                                                         n_input_items[m],
115                                                         t_c_out);
116       if (t_n_output_items_used != n_output_items[m]) {
117         std::cout << "Test " << g_t_num << ": Encode[" << m <<
118           "]{input}: Warning: Number of returned output items (" <<
119           t_n_output_items_used << ") is not as expected (" <<
120           n_output_items[m] << ").\n";
121         t_errors = true;
122       }
123     } else {
124       size_t t_n_input_items_used = t_encoder->encode (t_c_in,
125                                                        t_c_out,
126                                                        n_output_items[m]);
127       if (t_n_input_items_used != n_input_items[m]) {
128         std::cout << "Test " << g_t_num << ": Encode[" << m <<
129           "]{output}: Warning: Number of returned output items (" <<
130           t_n_input_items_used << ") is not as expected (" <<
131           n_input_items[m] << ").\n";
132         t_errors = true;
133       }
134     }
135   }
136
137   for (size_t m = 0; m < n_code_outputs; m++) {
138     for (size_t n = 0; n < t_total_n_output_items; n++) {
139       if (c_res[m][n] != t_out[m][n]) {
140         std::cout << "Test " << g_t_num << ": Item [" << m <<
141           "][" << n << "] not equal: des = " << (int)(c_res[m][n]) <<
142           ", act = " << (int)(t_out[m][n]) << "\n";
143         t_errors = true;
144       }
145     }
146   }
147
148   if (encode_soai != -1) {
149     // verify that the internal realization is correct
150     if (encode_soai != t_encoder->do_encode_soai ()) {
151       t_errors = true;
152     }
153   }
154
155   CPPUNIT_ASSERT_EQUAL (t_errors, false);
156
157   delete t_c_out;
158   t_c_out = 0;
159   delete t_c_in;
160   t_c_in = 0;
161   delete t_encoder;
162   t_encoder = 0;
163
164   for (size_t m = 0; m < n_code_outputs; m++) {
165     delete [] t_out[m];
166     t_out[m] = 0;
167   }
168   delete [] t_out;
169   t_out = 0;
170
171   // increment the test number
172
173   g_t_num++;
174 }
175
176 // TESTS 0 through 22 use do_encode_in_or_out as false
177
178 static const bool g_do_encode_in_or_out_0_22 = false;
179
180 // TEST 0
181 //
182 // checking for:
183 // SIAO realization (implicitely)
184 // start state is 0, no feedback, no termination
185
186 const static int t0_code_generator[] = {1, 0, 5, 0, 1, 6};
187 const static size_t t0_encode_soai = 0;
188
189 const static char t0_in_0[] =
190   {0, 1, 0, 0, 1, 0, 1, 0, 0, 0};
191 const static char t0_in_1[] =
192   {0, 1, 0, 0, 0, 1, 1, 0, 0, 0};
193 const static char t0_in_2[] =
194   {0, 0, 1, 1, 1, 1, 1, 0, 0, 0};
195 const static char* t0_in[] =
196   {t0_in_0, t0_in_1, t0_in_2};
197
198 const static size_t t0_n_input_items = sizeof (t0_in_0);
199 const static size_t t0_n_code_inputs = sizeof (t0_in) / sizeof (char*);
200
201 const static char t0_res_0[] =
202   {0, 1, 1, 1, 1, 0, 1, 1, 1, 0};
203 const static char t0_res_1[] =
204   {0, 1, 0, 1, 0, 1, 1, 0, 1, 0};
205 const static char* t0_res[] =
206   {t0_res_0, t0_res_1};
207
208 const static size_t t0_n_output_items = sizeof (t0_res_0);
209 const static size_t t0_n_code_outputs = sizeof (t0_res) / sizeof (char*);
210
211 void
212 qa_encoder_convolutional_ic1_ic1::t0
213 ()
214 {
215   do_encoder_check (g_do_encode_in_or_out_0_22,
216                     (const char**) t0_in, (const char**) t0_res,
217                     1, (const size_t*) &t0_n_input_items, 
218                     (const size_t*) &t0_n_output_items, 100,
219                     t0_n_code_inputs, t0_n_code_outputs,
220                     (const int*) t0_code_generator,
221                     0, true, 0, 0, t0_encode_soai);
222 }
223
224 // TEST 1
225 //
226 // checking for SIAO realization (implicitely)
227 // start state is 0, no feedback, no termination
228
229 const static int t1_code_generator[] = {1, 0, 0, 1, 5, 6};
230 const static size_t t1_encode_soai = 1;
231
232 const static char t1_in_0[] =
233   {0, 1, 1, 1, 0, 0, 0, 1, 0};
234 const static char t1_in_1[] =
235   {0, 0, 0, 0, 0, 1, 1, 1, 0};
236 const static char* t1_in[] =
237   {t1_in_0, t1_in_1};
238
239 const static size_t t1_n_input_items = sizeof (t1_in_0);
240 const static size_t t1_n_code_inputs = sizeof (t1_in) / sizeof (char*);
241
242 const static char t1_res_0[] =
243   {0, 1, 1, 1, 0, 0, 0, 1, 0};
244 const static char t1_res_1[] =
245   {0, 0, 0, 0, 0, 1, 1, 1, 0};
246 const static char t1_res_2[] =
247   {0, 1, 1, 0, 1, 1, 1, 1, 0};
248 const static char* t1_res[] =
249   {t1_res_0, t1_res_1, t1_res_2};
250
251 const static size_t t1_n_output_items = sizeof (t1_res_0);
252 const static size_t t1_n_code_outputs = sizeof (t1_res) / sizeof (char*);
253
254 void
255 qa_encoder_convolutional_ic1_ic1::t1
256 ()
257 {
258   do_encoder_check (g_do_encode_in_or_out_0_22,
259                     (const char**) t1_in, (const char**) t1_res,
260                     1, (const size_t*) &t1_n_input_items, 
261                     (const size_t*) &t1_n_output_items, 100,
262                     t1_n_code_inputs, t1_n_code_outputs,
263                     (const int*) t1_code_generator,
264                     0, true, 0, 0, t1_encode_soai);
265 }
266
267 // TEST 2
268 //
269 // checking for SOAI realization (implicitely)
270 // start state is 0, same feedback, no termination
271
272 const static int t2_code_generator[] = {1, 0, 0, 1, 5, 6};
273 const static int t2_code_feedback[] = {0, 0, 0, 0, 7, 7};
274 const static int t2_encode_soai = 1;
275
276 const static char t2_in_0[] =
277   {0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0};
278 const static char t2_in_1[] =
279   {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0};
280 const static char* t2_in[] =
281   {t2_in_0, t2_in_1};
282
283 const static size_t t2_n_input_items = sizeof (t2_in_0);
284 const static size_t t2_n_code_inputs = sizeof (t2_in) / sizeof (char*);
285
286 const static char t2_res_0[] =
287   {0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0};
288 const static char t2_res_1[] =
289   {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0};
290 const static char t2_res_2[] =
291   {0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0};
292 const static char* t2_res[] =
293   {t2_res_0, t2_res_1, t2_res_2};
294
295 const static size_t t2_n_output_items = sizeof (t2_res_0);
296 const static size_t t2_n_code_outputs = sizeof (t2_res) / sizeof (char*);
297
298 void
299 qa_encoder_convolutional_ic1_ic1::t2
300 ()
301 {
302   do_encoder_check (g_do_encode_in_or_out_0_22,
303                     (const char**) t2_in, (const char**) t2_res,
304                     1, (const size_t*) &t2_n_input_items, 
305                     (const size_t*) &t2_n_output_items, 100,
306                     t2_n_code_inputs, t2_n_code_outputs,
307                     (const int*) t2_code_generator,
308                     (const int*) t2_code_feedback,
309                     true, 0, 0, t2_encode_soai);
310 }
311
312 // TEST 3
313 //
314 // checking for SIAO realization (implicitely)
315 // start state is 0, same feedback, no termination
316
317 const static int t3_code_generator[] = {1, 0, 5, 0, 1, 6};
318 const static int t3_code_feedback[] = {0, 0, 7, 0, 0, 7};
319 const static int t3_encode_soai = 0;
320
321 const static char t3_in_0[] =
322   {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0};
323 const static char t3_in_1[] =
324   {0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
325 const static char t3_in_2[] =
326   {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0};
327 const static char* t3_in[] =
328   {t3_in_0, t3_in_1, t3_in_2};
329
330 const static size_t t3_n_input_items = sizeof (t3_in_0);
331 const static size_t t3_n_code_inputs = sizeof (t3_in) / sizeof (char*);
332
333 const static char t3_res_0[] =
334   {0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0};
335 const static char t3_res_1[] =
336   {0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0};
337 const static char* t3_res[] =
338   {t3_res_0, t3_res_1};
339
340 const static size_t t3_n_output_items = sizeof (t3_res_0);
341 const static size_t t3_n_code_outputs = sizeof (t3_res) / sizeof (char*);
342
343 void
344 qa_encoder_convolutional_ic1_ic1::t3
345 ()
346 {
347   do_encoder_check (g_do_encode_in_or_out_0_22,
348                     (const char**) t3_in, (const char**) t3_res,
349                     1, (const size_t*) &t3_n_input_items, 
350                     (const size_t*) &t3_n_output_items, 100,
351                     t3_n_code_inputs, t3_n_code_outputs,
352                     (const int*) t3_code_generator,
353                     (const int*) t3_code_feedback,
354                     true, 0, 0, t3_encode_soai);
355 }
356
357 // TEST 4
358 //
359 // checking for SIAO realization (implicitely),
360 // start state is 0, different feedbacks, no termination
361
362 const static int t4_code_generator[] = {1, 4, 0, 3, 1, 6};
363 const static int t4_code_feedback[] = {0, 7, 0, 5, 0, 5};
364 const static int t4_encode_soai = 0;
365
366 const static char t4_in_0[] =
367   {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0};
368 const static char t4_in_1[] =
369   {0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0};
370 const static char* t4_in[] =
371   {t4_in_0, t4_in_1};
372
373 const static size_t t4_n_input_items = sizeof (t4_in_0);
374 const static size_t t4_n_code_inputs = sizeof (t4_in) / sizeof (char*);
375
376 const static char t4_res_0[] =
377   {0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0};
378 const static char t4_res_1[] =
379   {0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0};
380 const static char t4_res_2[] =
381   {0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0};
382 const static char* t4_res[] =
383   {t4_res_0, t4_res_1, t4_res_2};
384
385 const static size_t t4_n_output_items = sizeof (t4_res_0);
386 const static size_t t4_n_code_outputs = sizeof (t4_res) / sizeof (char*);
387
388 void
389 qa_encoder_convolutional_ic1_ic1::t4
390 ()
391 {
392   do_encoder_check (g_do_encode_in_or_out_0_22,
393                     (const char**) t4_in, (const char**) t4_res,
394                     1, (const size_t*) &t4_n_input_items, 
395                     (const size_t*) &t4_n_output_items, 100,
396                     t4_n_code_inputs, t4_n_code_outputs,
397                     (const int*) t4_code_generator,
398                     (const int*) t4_code_feedback,
399                     true, 0, 0, t4_encode_soai);
400 }
401
402 // TEST 5
403 //
404 // checking for SOAI realization (implicitely),
405 // with different feedbacks, no termination
406
407 const static int t5_code_generator[] = {1, 0, 1, 4, 3, 6};
408 const static int t5_code_feedback[] = {0, 0, 0, 5, 7, 7};
409 const static int t5_encode_soai = 1;
410
411 const static char t5_in_0[] =
412   {0, 1, 0, 0, 0, 1, 0, 0, 1};
413 const static char t5_in_1[] =
414   {0, 0, 1, 0, 1, 1, 0, 0, 1};
415 const static char t5_in_2[] =
416   {0, 0, 0, 1, 0, 0, 0, 0, 1};
417 const static char* t5_in[] =
418   {t5_in_0, t5_in_1, t5_in_2};
419
420 const static size_t t5_n_input_items = sizeof (t5_in_0);
421 const static size_t t5_n_code_inputs = sizeof (t5_in) / sizeof (char*);
422
423 const static char t5_res_0[] =
424   {0, 1, 0, 1, 0, 1, 0, 0, 0};
425 const static char t5_res_1[] =
426   {0, 0, 1, 1, 1, 1, 0, 0, 1};
427 const static char* t5_res[] =
428   {t5_res_0, t5_res_1};
429
430 const static size_t t5_n_output_items = sizeof (t5_res_0);
431 const static size_t t5_n_code_outputs = sizeof (t5_res) / sizeof (char*);
432
433 void
434 qa_encoder_convolutional_ic1_ic1::t5
435 ()
436 {
437   do_encoder_check (g_do_encode_in_or_out_0_22,
438                     (const char**) t5_in, (const char**) t5_res,
439                     1, (const size_t*) &t5_n_input_items,
440                     (const size_t*) &t5_n_output_items, 100,
441                     t5_n_code_inputs, t5_n_code_outputs,
442                     (const int*) t5_code_generator,
443                     (const int*) t5_code_feedback, true,
444                     0, 0, t5_encode_soai);
445 }
446
447 // TEST 6
448 //
449 // checking for:
450 // start state is 0, no feedback, termination to 0 state
451
452 const static int t6_code_generator[] = {1, 0, 5, 0, 1, 6};
453
454 const static char t6_in_0[] =
455   {0, 1, 0, 0, 1, 0};
456 const static char t6_in_1[] =
457   {0, 1, 0, 0, 0, 0};
458 const static char t6_in_2[] =
459   {0, 0, 1, 1, 1, 0};
460 const static char* t6_in[] =
461   {t6_in_0, t6_in_1, t6_in_2};
462
463 const static size_t t6_n_input_items = sizeof (t6_in_0);
464 const static size_t t6_n_code_inputs = sizeof (t6_in) / sizeof (char*);
465
466 const static char t6_res_0[] =
467   {0, 1, 1, 1, 1, 1, 1, 0};
468 const static char t6_res_1[] =
469   {0, 1, 0, 1, 0, 0, 1, 0};
470 const static char* t6_res[] =
471   {t6_res_0, t6_res_1};
472
473 const static size_t t6_n_output_items = sizeof (t6_res_0);
474 const static size_t t6_n_code_outputs = sizeof (t6_res) / sizeof (char*);
475
476 void
477 qa_encoder_convolutional_ic1_ic1::t6
478 ()
479 {
480   do_encoder_check (g_do_encode_in_or_out_0_22,
481                     (const char**) t6_in, (const char**) t6_res,
482                     1, (const size_t*) &t6_n_input_items, 
483                     (const size_t*) &t6_n_output_items, 5, t6_n_code_inputs,
484                     t6_n_code_outputs, (const int*) t6_code_generator);
485 }
486
487 // TEST 7
488 //
489 // checking for:
490 // start state is 0, same feedback, termination to 0 state
491 // # of termination bits = 2
492
493 const static int t7_code_generator[] = {1, 0, 5, 0, 1, 6};
494 const static int t7_code_feedback[] = {0, 0, 7, 0, 0, 7};
495
496 const static char t7_in_0[] =
497   {0, 1, 1, 0, 0, 0, 0};
498 const static char t7_in_1[] =
499   {0, 1, 0, 1, 0, 0, 0};
500 const static char t7_in_2[] =
501   {0, 0, 0, 0, 1, 0, 1};
502 const static char* t7_in[] =
503   {t7_in_0, t7_in_1, t7_in_2};
504
505 const static size_t t7_n_input_items = sizeof (t7_in_0);
506 const static size_t t7_n_code_inputs = sizeof (t7_in) / sizeof (char*);
507
508 const static char t7_res_0[] =
509   {0, 1, 1, 0, 1, 0, 1, 0, 1};
510 const static char t7_res_1[] =
511   {0, 1, 0, 1, 0, 1, 1, 0, 0};
512 const static char* t7_res[] =
513   {t7_res_0, t7_res_1};
514
515 const static size_t t7_n_output_items = sizeof (t7_res_0);
516 const static size_t t7_n_code_outputs = sizeof (t7_res) / sizeof (char*);
517
518 void
519 qa_encoder_convolutional_ic1_ic1::t7
520 ()
521 {
522   do_encoder_check (g_do_encode_in_or_out_0_22,
523                     (const char**) t7_in, (const char**) t7_res,
524                     1, (const size_t*) &t7_n_input_items, 
525                     (const size_t*) &t7_n_output_items, 5, t7_n_code_inputs,
526                     t7_n_code_outputs, (const int*) t7_code_generator,
527                     (const int*) t7_code_feedback);
528 }
529
530 // TEST 8
531 //
532 // checking for:
533 // state state is 0, different feedbacks, termination to 0 state
534 // # of term bits will be 4
535
536 const static int t8_code_generator[] = {1, 4, 0, 3, 1, 6};
537 const static int t8_code_feedback[] = {0, 5, 0, 7, 0, 7};
538
539 const static char t8_in_0[] =
540   {0, 1, 0, 0, 0, 1, 0, 1, 1};
541 const static char t8_in_1[] =
542   {0, 0, 0, 1, 1, 1, 0, 1, 0};
543 const static char* t8_in[] =
544   {t8_in_0, t8_in_1};
545
546 const static size_t t8_n_input_items = sizeof (t8_in_0);
547 const static size_t t8_n_code_inputs = sizeof (t8_in) / sizeof (char*);
548
549 const static char t8_res_0[] =
550   {0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1};
551 const static char t8_res_1[] =
552   {0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0};
553 const static char t8_res_2[] =
554   {0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
555 const static char* t8_res[] =
556   {t8_res_0, t8_res_1, t8_res_2};
557
558 const static size_t t8_n_output_items = sizeof (t8_res_0);
559 const static size_t t8_n_code_outputs = sizeof (t8_res) / sizeof (char*);
560
561 void
562 qa_encoder_convolutional_ic1_ic1::t8
563 ()
564 {
565   do_encoder_check (g_do_encode_in_or_out_0_22,
566                     (const char**) t8_in, (const char**) t8_res,
567                     1, (const size_t*) &t8_n_input_items, 
568                     (const size_t*) &t8_n_output_items, 6, t8_n_code_inputs,
569                     t8_n_code_outputs, (const int*) t8_code_generator,
570                     (const int*) t8_code_feedback);
571 }
572
573 // TEST 9
574 //
575 // checking for:
576 // start state is 0, different feedbacks, termination to non-0 state
577 // # of term bits will be 2
578
579 const static int t9_code_generator[] = {1, 0, 1, 4, 3, 6};
580 const static int t9_code_feedback[] = {0, 0, 0, 5, 7, 7};
581 const static size_t t9_term_state = 4;
582
583 const static char t9_in_0[] =
584   {0, 1, 0, 0, 0, 0, 1};
585 const static char t9_in_1[] =
586   {0, 0, 1, 0, 1, 0, 1};
587 const static char t9_in_2[] =
588   {0, 0, 0, 1, 0, 0, 1};
589 const static char* t9_in[] =
590   {t9_in_0, t9_in_1, t9_in_2};
591
592 const static size_t t9_n_input_items = sizeof (t9_in_0);
593 const static size_t t9_n_code_inputs = sizeof (t9_in) / sizeof (char*);
594
595 const static char t9_res_0[] =
596   {0, 1, 0, 1, 0, 1, 1, 0, 0};
597 const static char t9_res_1[] =
598   {0, 0, 1, 1, 1, 1, 1, 0, 1};
599 const static char* t9_res[] =
600   {t9_res_0, t9_res_1};
601
602 const static size_t t9_n_output_items = sizeof (t9_res_0);
603 const static size_t t9_n_code_outputs = sizeof (t9_res) / sizeof (char*);
604
605 void
606 qa_encoder_convolutional_ic1_ic1::t9
607 ()
608 {
609   do_encoder_check (g_do_encode_in_or_out_0_22,
610                     (const char**) t9_in, (const char**) t9_res,
611                     1, (const size_t*) &t9_n_input_items,
612                     (const size_t*) &t9_n_output_items, 5, t9_n_code_inputs,
613                     t9_n_code_outputs, (const int*) t9_code_generator,
614                     (const int*) t9_code_feedback, true, 0, t9_term_state);
615 }
616
617 // TEST 10
618 //
619 // checking for termination to non-0 state, no feedback
620
621 const static int t10_code_generator[] = {1, 0, 3, 0, 1, 6};
622 const static size_t t10_term_state = 2;
623
624 const static char t10_in_0[] =
625   {0, 1, 0, 1, 0, 0, 1, 1};
626 const static char t10_in_1[] =
627   {0, 1, 0, 0, 1, 0, 1, 1};
628 const static char t10_in_2[] =
629   {0, 1, 0, 1, 1, 0, 0, 1};
630 const static char* t10_in[] =
631   {t10_in_0, t10_in_1, t10_in_2};
632
633 const static size_t t10_n_input_items = sizeof (t10_in_0);
634 const static size_t t10_n_code_inputs = sizeof (t10_in) / sizeof (char*);
635
636 const static char t10_res_0[] =
637   {0, 0, 1, 0, 0, 0, 1, 0, 1, 0};
638 const static char t10_res_1[] =
639   {0, 1, 1, 1, 0, 0, 0, 0, 1, 1};
640 const static char* t10_res[] =
641   {t10_res_0, t10_res_1};
642
643 const static size_t t10_n_output_items = sizeof (t10_res_0);
644 const static size_t t10_n_code_outputs = sizeof (t10_res) / sizeof (char*);
645
646 void
647 qa_encoder_convolutional_ic1_ic1::t10
648 ()
649 {
650   do_encoder_check (g_do_encode_in_or_out_0_22,
651                     (const char**) t10_in, (const char**) t10_res,
652                     1, (const size_t*) &t10_n_input_items, 
653                     (const size_t*) &t10_n_output_items, 5,
654                     t10_n_code_inputs, t10_n_code_outputs,
655                     (const int*) t10_code_generator,
656                     0, true, 0, t10_term_state);
657 }
658
659 // TEST 11
660 //
661 // checking for:
662 // start state is not 0, no feedback, terminating to 0 state
663
664 const static int t11_code_generator[] = {1, 0, 3, 0, 1, 6};
665 const static size_t t11_start_state = 1;
666
667 const static char t11_in_0[] =
668   {0, 1, 0, 0, 0, 1, 0};
669 const static char t11_in_1[] =
670   {0, 0, 1, 0, 0, 1, 0};
671 const static char t11_in_2[] =
672   {0, 1, 1, 1, 0, 1, 1};
673 const static char* t11_in[] =
674   {t11_in_0, t11_in_1, t11_in_2};
675
676 const static size_t t11_n_input_items = sizeof (t11_in_0);
677 const static size_t t11_n_code_inputs = sizeof (t11_in) / sizeof (char*);
678
679 const static char t11_res_0[] =
680   {1, 0, 0, 0, 1, 0, 0, 1, 0};
681 const static char t11_res_1[] =
682   {1, 1, 0, 0, 0, 1, 0, 0, 0};
683 const static char* t11_res[] =
684   {t11_res_0, t11_res_1};
685
686 const static size_t t11_n_output_items = sizeof (t11_res_0);
687 const static size_t t11_n_code_outputs = sizeof (t11_res) / sizeof (char*);
688
689 void
690 qa_encoder_convolutional_ic1_ic1::t11
691 ()
692 {
693   do_encoder_check (g_do_encode_in_or_out_0_22,
694                     (const char**) t11_in, (const char**) t11_res,
695                     1, (const size_t*) &t11_n_input_items, 
696                     (const size_t*) &t11_n_output_items, 5,
697                     t11_n_code_inputs, t11_n_code_outputs,
698                     (const int*) t11_code_generator,
699                     0, true, t11_start_state);
700 }
701
702 // TEST 12
703 //
704 // checking for:
705 // start state is not 0, no feedback, terminating to non-0 state
706
707 const static int t12_code_generator[] = {1, 0, 3, 0, 1, 6};
708 const static size_t t12_start_state = 2;
709 const static size_t t12_term_state = 2;
710
711 const static char t12_in_0[] =
712   {0, 1, 1, 1, 0, 1, 0};
713 const static char t12_in_1[] =
714   {0, 1, 0, 0, 0, 0, 1};
715 const static char t12_in_2[] =
716   {0, 1, 1, 0, 1, 0, 1};
717 const static char* t12_in[] =
718   {t12_in_0, t12_in_1, t12_in_2};
719
720 const static size_t t12_n_input_items = sizeof (t12_in_0);
721 const static size_t t12_n_code_inputs = sizeof (t12_in) / sizeof (char*);
722
723 const static char t12_res_0[] =
724   {0, 0, 1, 0, 1, 0, 1, 1, 1};
725 const static char t12_res_1[] =
726   {1, 1, 1, 0, 1, 1, 0, 1, 1};
727 const static char* t12_res[] =
728   {t12_res_0, t12_res_1};
729
730 const static size_t t12_n_output_items = sizeof (t12_res_0);
731 const static size_t t12_n_code_outputs = sizeof (t12_res) / sizeof (char*);
732
733 void
734 qa_encoder_convolutional_ic1_ic1::t12
735 ()
736 {
737   do_encoder_check (g_do_encode_in_or_out_0_22,
738                     (const char**) t12_in, (const char**) t12_res,
739                     1, (const size_t*) &t12_n_input_items,
740                     (const size_t*) &t12_n_output_items, 5, t12_n_code_inputs,
741                     t12_n_code_outputs, (const int*) t12_code_generator,
742                     0, true, t12_start_state, t12_term_state);
743 }
744
745 // TEST 13
746 //
747 // checking for:
748 // start state is not 0, any feedback, termination to 0 state
749
750 const static int t13_code_generator[] = {1, 0, 5, 0, 1, 6};
751 const static int t13_code_feedback[] = {0, 0, 7, 0, 0, 7};
752 const static size_t t13_start_state = 2;
753 const static size_t t13_term_state = 0;
754
755 const static char t13_in_0[] =
756   {0, 1, 0, 0, 0, 1, 0};
757 const static char t13_in_1[] =
758   {0, 0, 1, 1, 0, 1, 0};
759 const static char t13_in_2[] =
760   {0, 0, 0, 0, 1, 0, 0};
761 const static char* t13_in[] =
762   {t13_in_0, t13_in_1, t13_in_2};
763
764 const static size_t t13_n_input_items = sizeof (t13_in_0);
765 const static size_t t13_n_code_inputs = sizeof (t13_in) / sizeof (char*);
766
767 const static char t13_res_0[] =
768   {0, 0, 1, 0, 0, 1, 0, 1, 1};
769 const static char t13_res_1[] =
770   {1, 1, 1, 0, 1, 1, 0, 0, 1};
771 const static char* t13_res[] =
772   {t13_res_0, t13_res_1};
773
774 const static size_t t13_n_output_items = sizeof (t13_res_0);
775 const static size_t t13_n_code_outputs = sizeof (t13_res) / sizeof (char*);
776
777 void
778 qa_encoder_convolutional_ic1_ic1::t13
779 ()
780 {
781   do_encoder_check (g_do_encode_in_or_out_0_22,
782                     (const char**) t13_in, (const char**) t13_res,
783                     1, (const size_t*) &t13_n_input_items,
784                     (const size_t*) &t13_n_output_items, 5,
785                     t13_n_code_inputs, t13_n_code_outputs,
786                     (const int*) t13_code_generator,
787                     (const int*) t13_code_feedback,
788                     true, t13_start_state, t13_term_state);
789 }
790
791 // TEST 14
792 //
793 // checking for:
794 // start state is not 0, any feedback, termination to non-zero state
795
796 const static int t14_code_generator[] = {1, 0, 5, 0, 1, 6};
797 const static int t14_code_feedback[] = {0, 0, 7, 0, 0, 7};
798 const static size_t t14_start_state = 1;
799 const static size_t t14_term_state = 2;
800
801 const static char t14_in_0[] =
802   {0, 1, 0, 1, 0, 1, 0};
803 const static char t14_in_1[] =
804   {0, 0, 0, 0, 1, 1, 0};
805 const static char t14_in_2[] =
806   {0, 1, 0, 0, 0, 1, 1};
807 const static char* t14_in[] =
808   {t14_in_0, t14_in_1, t14_in_2};
809
810 const static size_t t14_n_input_items = sizeof (t14_in_0);
811 const static size_t t14_n_code_inputs = sizeof (t14_in) / sizeof (char*);
812
813 const static char t14_res_0[] =
814   {1, 1, 1, 1, 1, 0, 1, 1, 1};
815 const static char t14_res_1[] =
816   {1, 0, 0, 1, 0, 0, 0, 0, 1};
817 const static char* t14_res[] =
818   {t14_res_0, t14_res_1};
819
820 const static size_t t14_n_output_items = sizeof (t14_res_0);
821 const static size_t t14_n_code_outputs = sizeof (t14_res) / sizeof (char*);
822
823 void
824 qa_encoder_convolutional_ic1_ic1::t14
825 ()
826 {
827   do_encoder_check (g_do_encode_in_or_out_0_22,
828                     (const char**) t14_in, (const char**) t14_res,
829                     1, (const size_t*) &t14_n_input_items,
830                     (const size_t*) &t14_n_output_items, 5,
831                     t14_n_code_inputs, t14_n_code_outputs,
832                     (const int*) t14_code_generator,
833                     (const int*) t14_code_feedback,
834                     true, t14_start_state, t14_term_state);
835 }
836
837 // TEST 15
838 //
839 // checking for:
840 // no feedback, block coding but no termination
841
842 const static int    t15_code_generator[] = {1, 0, 3, 0, 1, 6};
843
844 const static char t15_in_0[] =
845   {0, 1, 0, 1, 0, 0, 1, 1};
846 const static char t15_in_1[] =
847   {0, 1, 0, 0, 1, 0, 1, 1};
848 const static char t15_in_2[] =
849   {0, 1, 0, 1, 1, 0, 0, 1};
850 const static char* t15_in[] =
851   {t15_in_0, t15_in_1, t15_in_2};
852
853 const static size_t t15_n_input_items = sizeof (t15_in_0);
854 const static size_t t15_n_code_inputs = sizeof (t15_in) / sizeof (char*);
855
856 const static char t15_res_0[] =
857   {0, 0, 1, 0, 0, 0, 1, 0};
858 const static char t15_res_1[] =
859   {0, 1, 1, 1, 0, 0, 1, 1};
860 const static char* t15_res[] =
861   {t15_res_0, t15_res_1};
862
863 const static size_t t15_n_output_items = sizeof (t15_res_0);
864 const static size_t t15_n_code_outputs = sizeof (t15_res) / sizeof (char*);
865
866 void
867 qa_encoder_convolutional_ic1_ic1::t15
868 ()
869 {
870   do_encoder_check (g_do_encode_in_or_out_0_22,
871                     (const char**) t15_in, (const char**) t15_res,
872                     1, (const size_t*) &t15_n_input_items, 
873                     (const size_t*) &t15_n_output_items, 5,
874                     t15_n_code_inputs, t15_n_code_outputs,
875                     (const int*) t15_code_generator, 0, false);
876 }
877
878 // TEST 16
879 //
880 // checking for:
881 // start state is 0, same feedback, block but no termination
882
883 const static int t16_code_generator[] = {1, 0, 5, 0, 1, 6};
884 const static int t16_code_feedback[] = {0, 0, 7, 0, 0, 7};
885
886 const static char t16_in_0[] =
887   {0, 1, 1, 0, 0, 0, 0};
888 const static char t16_in_1[] =
889   {0, 1, 0, 1, 0, 0, 0};
890 const static char t16_in_2[] =
891   {0, 0, 0, 0, 1, 0, 1};
892 const static char* t16_in[] =
893   {t16_in_0, t16_in_1, t16_in_2};
894
895 const static size_t t16_n_input_items = sizeof (t16_in_0);
896 const static size_t t16_n_code_inputs = sizeof (t16_in) / sizeof (char*);
897
898 const static char t16_res_0[] =
899   {0, 1, 1, 0, 1, 0, 1};
900 const static char t16_res_1[] =
901   {0, 1, 0, 1, 0, 0, 0};
902 const static char* t16_res[] =
903   {t16_res_0, t16_res_1};
904
905 const static size_t t16_n_output_items = sizeof (t16_res_0);
906 const static size_t t16_n_code_outputs = sizeof (t16_res) / sizeof (char*);
907
908 void
909 qa_encoder_convolutional_ic1_ic1::t16
910 ()
911 {
912   do_encoder_check (g_do_encode_in_or_out_0_22,
913                     (const char**) t16_in, (const char**) t16_res,
914                     1, (const size_t*) &t16_n_input_items, 
915                     (const size_t*) &t16_n_output_items, 5, t16_n_code_inputs,
916                     t16_n_code_outputs, (const int*) t16_code_generator,
917                     (const int*) t16_code_feedback, false);
918 }
919
920 // TEST 17
921 //
922 // checking for:
923 // state state is 0, different feedbacks, block but no termination
924
925 const static int t17_code_generator[] = {1, 4, 0, 3, 1, 6};
926 const static int t17_code_feedback[] = {0, 5, 0, 7, 0, 7};
927
928 const static char t17_in_0[] =
929   {0, 1, 0, 0, 0, 1, 0, 1, 1};
930 const static char t17_in_1[] =
931   {0, 0, 0, 1, 1, 1, 0, 1, 0};
932 const static char* t17_in[] =
933   {t17_in_0, t17_in_1};
934
935 const static size_t t17_n_input_items = sizeof (t17_in_0);
936 const static size_t t17_n_code_inputs = sizeof (t17_in) / sizeof (char*);
937
938 const static char t17_res_0[] =
939   {0, 1, 0, 0, 0, 0, 0, 1, 1};
940 const static char t17_res_1[] =
941   {0, 0, 0, 1, 1, 0, 0, 1, 0};
942 const static char t17_res_2[] =
943   {0, 1, 0, 0, 1, 0, 0, 1, 0};
944 const static char* t17_res[] =
945   {t17_res_0, t17_res_1, t17_res_2};
946
947 const static size_t t17_n_output_items = sizeof (t17_res_0);
948 const static size_t t17_n_code_outputs = sizeof (t17_res) / sizeof (char*);
949
950 void
951 qa_encoder_convolutional_ic1_ic1::t17
952 ()
953 {
954   do_encoder_check (g_do_encode_in_or_out_0_22,
955                     (const char**) t17_in, (const char**) t17_res,
956                     1, (const size_t*) &t17_n_input_items, 
957                     (const size_t*) &t17_n_output_items, 6, t17_n_code_inputs,
958                     t17_n_code_outputs, (const int*) t17_code_generator,
959                     (const int*) t17_code_feedback, false);
960 }
961
962 // TEST 18
963 //
964 // checking for:
965 // start state is not 0, no feedback, terminating to non-0 state
966 // multi-encode, stop output before term bits
967
968 const static int t18_code_generator[] = {1, 0, 3, 0, 1, 6};
969 const static size_t t18_start_state = 2;
970 const static size_t t18_term_state = 2;
971
972 const static char t18_in_0[] =
973   {0, 1, 1, 1, 0, 1, 0};
974 const static char t18_in_1[] =
975   {0, 1, 0, 0, 0, 0, 1};
976 const static char t18_in_2[] =
977   {0, 1, 1, 0, 1, 0, 1};
978 const static char* t18_in[] =
979   {t18_in_0, t18_in_1, t18_in_2};
980
981 const static size_t t18_n_input_items[] = {3, 2, 2};
982 const static size_t t18_n_io_items = (sizeof (t18_n_input_items) /
983                                       sizeof (size_t));
984 const static size_t t18_n_code_inputs = sizeof (t18_in) / sizeof (char*);
985
986 const static char t18_res_0[] =
987   {0, 0, 1, 0, 1, 0, 1, 1, 1};
988 const static char t18_res_1[] =
989   {1, 1, 1, 0, 1, 1, 0, 1, 1};
990 const static char* t18_res[] =
991   {t18_res_0, t18_res_1};
992
993 const static size_t t18_n_output_items[] = {3, 2, 4};
994 const static size_t t18_n_code_outputs = sizeof (t18_res) / sizeof (char*);
995
996 void
997 qa_encoder_convolutional_ic1_ic1::t18
998 ()
999 {
1000   do_encoder_check (g_do_encode_in_or_out_0_22,
1001                     (const char**) t18_in, (const char**) t18_res,
1002                     t18_n_io_items, (const size_t*) t18_n_input_items,
1003                     (const size_t*) t18_n_output_items, 5, t18_n_code_inputs,
1004                     t18_n_code_outputs, (const int*) t18_code_generator,
1005                     0, true, t18_start_state, t18_term_state);
1006 }
1007
1008 // TEST 19
1009 //
1010 // checking for:
1011 // start state is not 0, any feedback, termination to non-zero state
1012 // multi-encode, stop output in the middle of term bits
1013
1014 const static int t19_code_generator[] = {1, 0, 5, 0, 1, 6};
1015 const static int t19_code_feedback[] = {0, 0, 7, 0, 0, 7};
1016 const static size_t t19_start_state = 1;
1017 const static size_t t19_term_state = 2;
1018
1019 const static char t19_in_0[] =
1020   {0, 1, 0, 1, 0, 1, 0};
1021 const static char t19_in_1[] =
1022   {0, 0, 0, 0, 1, 1, 0};
1023 const static char t19_in_2[] =
1024   {0, 1, 0, 0, 0, 1, 1};
1025 const static char* t19_in[] =
1026   {t19_in_0, t19_in_1, t19_in_2};
1027
1028 const static size_t t19_n_input_items[] = {2, 2, 1, 1, 1};
1029 const static size_t t19_n_io_items = (sizeof (t19_n_input_items) /
1030                                       sizeof (size_t));
1031 const static size_t t19_n_code_inputs = sizeof (t19_in) / sizeof (char*);
1032
1033 const static char t19_res_0[] =
1034   {1, 1, 1, 1, 1, 0, 1, 1, 1};
1035 const static char t19_res_1[] =
1036   {1, 0, 0, 1, 0, 0, 0, 0, 1};
1037 const static char* t19_res[] =
1038   {t19_res_0, t19_res_1};
1039
1040 const static size_t t19_n_output_items[] = {2, 2, 2, 2, 1};
1041 const static size_t t19_n_code_outputs = sizeof (t19_res) / sizeof (char*);
1042
1043 void
1044 qa_encoder_convolutional_ic1_ic1::t19
1045 ()
1046 {
1047   do_encoder_check (g_do_encode_in_or_out_0_22,
1048                     (const char**) t19_in, (const char**) t19_res,
1049                     1, (const size_t*) &t19_n_input_items,
1050                     (const size_t*) &t19_n_output_items, 5,
1051                     t19_n_code_inputs, t19_n_code_outputs,
1052                     (const int*) t19_code_generator,
1053                     (const int*) t19_code_feedback,
1054                     true, t19_start_state, t19_term_state);
1055 }
1056
1057 // TEST 20
1058 //
1059 // checking for:
1060 // no feedback, block coding but no termination
1061 // multi-encode
1062
1063 const static int    t20_code_generator[] = {1, 0, 3, 0, 1, 6};
1064
1065 const static char t20_in_0[] =
1066   {0, 1, 0, 1, 0, 0, 1, 1};
1067 const static char t20_in_1[] =
1068   {0, 1, 0, 0, 1, 0, 1, 1};
1069 const static char t20_in_2[] =
1070   {0, 1, 0, 1, 1, 0, 0, 1};
1071 const static char* t20_in[] =
1072   {t20_in_0, t20_in_1, t20_in_2};
1073
1074 const static size_t t20_n_input_items[] = {2, 2, 2, 2};
1075 const static size_t t20_n_n_input_items = (sizeof (t20_n_input_items) /
1076                                            sizeof (size_t));
1077 const static size_t t20_n_code_inputs = sizeof (t20_in) / sizeof (char*);
1078
1079 const static char t20_res_0[] =
1080   {0, 0, 1, 0, 0, 0, 1, 0};
1081 const static char t20_res_1[] =
1082   {0, 1, 1, 1, 0, 0, 1, 1};
1083 const static char* t20_res[] =
1084   {t20_res_0, t20_res_1};
1085
1086 const static size_t t20_n_output_items[] = {2, 2, 2, 2};
1087 const static size_t t20_n_code_outputs = sizeof (t20_res) / sizeof (char*);
1088
1089 void
1090 qa_encoder_convolutional_ic1_ic1::t20
1091 ()
1092 {
1093   do_encoder_check (g_do_encode_in_or_out_0_22,
1094                     (const char**) t20_in, (const char**) t20_res,
1095                     t20_n_n_input_items, (const size_t*) t20_n_input_items, 
1096                     (const size_t*) t20_n_output_items, 5,
1097                     t20_n_code_inputs, t20_n_code_outputs,
1098                     (const int*) t20_code_generator, 0, false);
1099 }
1100
1101 // TEST 21
1102 //
1103 // checking for:
1104 // start state is 0, same feedback, block but no termination
1105 // multi-encode
1106
1107 const static int t21_code_generator[] = {1, 0, 5, 0, 1, 6};
1108 const static int t21_code_feedback[] = {0, 0, 7, 0, 0, 7};
1109
1110 const static char t21_in_0[] =
1111   {0, 1, 1, 0, 0, 0, 0};
1112 const static char t21_in_1[] =
1113   {0, 1, 0, 1, 0, 0, 0};
1114 const static char t21_in_2[] =
1115   {0, 0, 0, 0, 1, 0, 1};
1116 const static char* t21_in[] =
1117   {t21_in_0, t21_in_1, t21_in_2};
1118
1119 const static size_t t21_n_input_items[] = {5, 1, 1};
1120 const static size_t t21_n_n_input_items = (sizeof (t21_n_input_items) /
1121                                            sizeof (size_t));
1122 const static size_t t21_n_code_inputs = sizeof (t21_in) / sizeof (char*);
1123
1124 const static char t21_res_0[] =
1125   {0, 1, 1, 0, 1, 0, 1};
1126 const static char t21_res_1[] =
1127   {0, 1, 0, 1, 0, 0, 0};
1128 const static char* t21_res[] =
1129   {t21_res_0, t21_res_1};
1130
1131 const static size_t t21_n_output_items[] = {5, 1, 1};
1132 const static size_t t21_n_code_outputs = sizeof (t21_res) / sizeof (char*);
1133
1134 void
1135 qa_encoder_convolutional_ic1_ic1::t21
1136 ()
1137 {
1138   do_encoder_check (g_do_encode_in_or_out_0_22,
1139                     (const char**) t21_in, (const char**) t21_res,
1140                     t21_n_n_input_items, (const size_t*) t21_n_input_items, 
1141                     (const size_t*) t21_n_output_items, 5, t21_n_code_inputs,
1142                     t21_n_code_outputs, (const int*) t21_code_generator,
1143                     (const int*) t21_code_feedback, false);
1144 }
1145
1146 // TEST 22
1147 //
1148 // checking for:
1149 // state state is 0, different feedbacks, block but no termination
1150 // multi-encode
1151
1152 const static int t22_code_generator[] = {1, 4, 0, 3, 1, 6};
1153 const static int t22_code_feedback[] = {0, 5, 0, 7, 0, 7};
1154
1155 const static char t22_in_0[] =
1156   {0, 1, 0, 0, 0, 1, 0, 1, 1};
1157 const static char t22_in_1[] =
1158   {0, 0, 0, 1, 1, 1, 0, 1, 0};
1159 const static char* t22_in[] =
1160   {t22_in_0, t22_in_1};
1161
1162 const static size_t t22_n_input_items[] = {5, 4};
1163 const static size_t t22_n_n_input_items = (sizeof (t22_n_input_items) /
1164                                            sizeof (size_t));
1165 const static size_t t22_n_code_inputs = sizeof (t22_in) / sizeof (char*);
1166
1167 const static char t22_res_0[] =
1168   {0, 1, 0, 0, 0, 0, 0, 1, 1};
1169 const static char t22_res_1[] =
1170   {0, 0, 0, 1, 1, 0, 0, 1, 0};
1171 const static char t22_res_2[] =
1172   {0, 1, 0, 0, 1, 0, 0, 1, 0};
1173 const static char* t22_res[] =
1174   {t22_res_0, t22_res_1, t22_res_2};
1175
1176 const static size_t t22_n_output_items[] = {5, 4};
1177 const static size_t t22_n_code_outputs = sizeof (t22_res) / sizeof (char*);
1178
1179 void
1180 qa_encoder_convolutional_ic1_ic1::t22
1181 ()
1182 {
1183   do_encoder_check (g_do_encode_in_or_out_0_22,
1184                     (const char**) t22_in, (const char**) t22_res,
1185                     t22_n_n_input_items, (const size_t*) t22_n_input_items, 
1186                     (const size_t*) t22_n_output_items, 6, t22_n_code_inputs,
1187                     t22_n_code_outputs, (const int*) t22_code_generator,
1188                     (const int*) t22_code_feedback, false);
1189 }
1190
1191 // TESTS 23 through 45 use do_encode_in_or_out as true
1192
1193 static const bool g_do_encode_in_or_out_23_45 = true;
1194
1195 // TEST 23
1196 //
1197 // checking for:
1198 // SIAO realization (implicitely)
1199 // start state is 0, no feedback, no termination
1200
1201 const static int t23_code_generator[] = {1, 0, 5, 0, 1, 6};
1202 const static size_t t23_encode_soai = 0;
1203
1204 const static char t23_in_0[] =
1205   {0, 1, 0, 0, 1, 0, 1, 0, 0, 0};
1206 const static char t23_in_1[] =
1207   {0, 1, 0, 0, 0, 1, 1, 0, 0, 0};
1208 const static char t23_in_2[] =
1209   {0, 0, 1, 1, 1, 1, 1, 0, 0, 0};
1210 const static char* t23_in[] =
1211   {t23_in_0, t23_in_1, t23_in_2};
1212
1213 const static size_t t23_n_input_items = sizeof (t23_in_0);
1214 const static size_t t23_n_code_inputs = sizeof (t23_in) / sizeof (char*);
1215
1216 const static char t23_res_0[] =
1217   {0, 1, 1, 1, 1, 0, 1, 1, 1, 0};
1218 const static char t23_res_1[] =
1219   {0, 1, 0, 1, 0, 1, 1, 0, 1, 0};
1220 const static char* t23_res[] =
1221   {t23_res_0, t23_res_1};
1222
1223 const static size_t t23_n_output_items = sizeof (t23_res_0);
1224 const static size_t t23_n_code_outputs = sizeof (t23_res) / sizeof (char*);
1225
1226 void
1227 qa_encoder_convolutional_ic1_ic1::t23
1228 ()
1229 {
1230   do_encoder_check (g_do_encode_in_or_out_23_45,
1231                     (const char**) t23_in, (const char**) t23_res,
1232                     1, (const size_t*) &t23_n_input_items, 
1233                     (const size_t*) &t23_n_output_items, 100,
1234                     t23_n_code_inputs, t23_n_code_outputs,
1235                     (const int*) t23_code_generator,
1236                     0, true, 0, 0, t23_encode_soai);
1237 }
1238
1239 // TEST 24
1240 //
1241 // checking for SIAO realization (implicitely)
1242 // start state is 0, no feedback, no termination
1243
1244 const static int t24_code_generator[] = {1, 0, 0, 1, 5, 6};
1245 const static size_t t24_encode_soai = 1;
1246
1247 const static char t24_in_0[] =
1248   {0, 1, 1, 1, 0, 0, 0, 1, 0};
1249 const static char t24_in_1[] =
1250   {0, 0, 0, 0, 0, 1, 1, 1, 0};
1251 const static char* t24_in[] =
1252   {t24_in_0, t24_in_1};
1253
1254 const static size_t t24_n_input_items = sizeof (t24_in_0);
1255 const static size_t t24_n_code_inputs = sizeof (t24_in) / sizeof (char*);
1256
1257 const static char t24_res_0[] =
1258   {0, 1, 1, 1, 0, 0, 0, 1, 0};
1259 const static char t24_res_1[] =
1260   {0, 0, 0, 0, 0, 1, 1, 1, 0};
1261 const static char t24_res_2[] =
1262   {0, 1, 1, 0, 1, 1, 1, 1, 0};
1263 const static char* t24_res[] =
1264   {t24_res_0, t24_res_1, t24_res_2};
1265
1266 const static size_t t24_n_output_items = sizeof (t24_res_0);
1267 const static size_t t24_n_code_outputs = sizeof (t24_res) / sizeof (char*);
1268
1269 void
1270 qa_encoder_convolutional_ic1_ic1::t24
1271 ()
1272 {
1273   do_encoder_check (g_do_encode_in_or_out_23_45,
1274                     (const char**) t24_in, (const char**) t24_res,
1275                     1, (const size_t*) &t24_n_input_items, 
1276                     (const size_t*) &t24_n_output_items, 100,
1277                     t24_n_code_inputs, t24_n_code_outputs,
1278                     (const int*) t24_code_generator,
1279                     0, true, 0, 0, t24_encode_soai);
1280 }
1281
1282 // TEST 25
1283 //
1284 // checking for SOAI realization (implicitely)
1285 // start state is 0, same feedback, no termination
1286
1287 const static int t25_code_generator[] = {1, 0, 0, 1, 5, 6};
1288 const static int t25_code_feedback[] = {0, 0, 0, 0, 7, 7};
1289 const static int t25_encode_soai = 1;
1290
1291 const static char t25_in_0[] =
1292   {0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0};
1293 const static char t25_in_1[] =
1294   {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0};
1295 const static char* t25_in[] =
1296   {t25_in_0, t25_in_1};
1297
1298 const static size_t t25_n_input_items = sizeof (t25_in_0);
1299 const static size_t t25_n_code_inputs = sizeof (t25_in) / sizeof (char*);
1300
1301 const static char t25_res_0[] =
1302   {0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0};
1303 const static char t25_res_1[] =
1304   {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0};
1305 const static char t25_res_2[] =
1306   {0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0};
1307 const static char* t25_res[] =
1308   {t25_res_0, t25_res_1, t25_res_2};
1309
1310 const static size_t t25_n_output_items = sizeof (t25_res_0);
1311 const static size_t t25_n_code_outputs = sizeof (t25_res) / sizeof (char*);
1312
1313 void
1314 qa_encoder_convolutional_ic1_ic1::t25
1315 ()
1316 {
1317   do_encoder_check (g_do_encode_in_or_out_23_45,
1318                     (const char**) t25_in, (const char**) t25_res,
1319                     1, (const size_t*) &t25_n_input_items, 
1320                     (const size_t*) &t25_n_output_items, 100,
1321                     t25_n_code_inputs, t25_n_code_outputs,
1322                     (const int*) t25_code_generator,
1323                     (const int*) t25_code_feedback,
1324                     true, 0, 0, t25_encode_soai);
1325 }
1326
1327 // TEST 26
1328 //
1329 // checking for SIAO realization (implicitely)
1330 // start state is 0, same feedback, no termination
1331
1332 const static int t26_code_generator[] = {1, 0, 5, 0, 1, 6};
1333 const static int t26_code_feedback[] = {0, 0, 7, 0, 0, 7};
1334 const static int t26_encode_soai = 0;
1335
1336 const static char t26_in_0[] =
1337   {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0};
1338 const static char t26_in_1[] =
1339   {0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1340 const static char t26_in_2[] =
1341   {0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0};
1342 const static char* t26_in[] =
1343   {t26_in_0, t26_in_1, t26_in_2};
1344
1345 const static size_t t26_n_input_items = sizeof (t26_in_0);
1346 const static size_t t26_n_code_inputs = sizeof (t26_in) / sizeof (char*);
1347
1348 const static char t26_res_0[] =
1349   {0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0};
1350 const static char t26_res_1[] =
1351   {0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0};
1352 const static char* t26_res[] =
1353   {t26_res_0, t26_res_1};
1354
1355 const static size_t t26_n_output_items = sizeof (t26_res_0);
1356 const static size_t t26_n_code_outputs = sizeof (t26_res) / sizeof (char*);
1357
1358 void
1359 qa_encoder_convolutional_ic1_ic1::t26
1360 ()
1361 {
1362   do_encoder_check (g_do_encode_in_or_out_23_45,
1363                     (const char**) t26_in, (const char**) t26_res,
1364                     1, (const size_t*) &t26_n_input_items, 
1365                     (const size_t*) &t26_n_output_items, 100,
1366                     t26_n_code_inputs, t26_n_code_outputs,
1367                     (const int*) t26_code_generator,
1368                     (const int*) t26_code_feedback,
1369                     true, 0, 0, t26_encode_soai);
1370 }
1371
1372 // TEST 27
1373 //
1374 // checking for SIAO realization (implicitely),
1375 // start state is 0, different feedbacks, no termination
1376
1377 const static int t27_code_generator[] = {1, 4, 0, 3, 1, 6};
1378 const static int t27_code_feedback[] = {0, 7, 0, 5, 0, 5};
1379 const static int t27_encode_soai = 0;
1380
1381 const static char t27_in_0[] =
1382   {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0};
1383 const static char t27_in_1[] =
1384   {0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0};
1385 const static char* t27_in[] =
1386   {t27_in_0, t27_in_1};
1387
1388 const static size_t t27_n_input_items = sizeof (t27_in_0);
1389 const static size_t t27_n_code_inputs = sizeof (t27_in) / sizeof (char*);
1390
1391 const static char t27_res_0[] =
1392   {0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0};
1393 const static char t27_res_1[] =
1394   {0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0};
1395 const static char t27_res_2[] =
1396   {0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0};
1397 const static char* t27_res[] =
1398   {t27_res_0, t27_res_1, t27_res_2};
1399
1400 const static size_t t27_n_output_items = sizeof (t27_res_0);
1401 const static size_t t27_n_code_outputs = sizeof (t27_res) / sizeof (char*);
1402
1403 void
1404 qa_encoder_convolutional_ic1_ic1::t27
1405 ()
1406 {
1407   do_encoder_check (g_do_encode_in_or_out_23_45,
1408                     (const char**) t27_in, (const char**) t27_res,
1409                     1, (const size_t*) &t27_n_input_items, 
1410                     (const size_t*) &t27_n_output_items, 100,
1411                     t27_n_code_inputs, t27_n_code_outputs,
1412                     (const int*) t27_code_generator,
1413                     (const int*) t27_code_feedback,
1414                     true, 0, 0, t27_encode_soai);
1415 }
1416
1417 // TEST 28
1418 //
1419 // checking for SOAI realization (implicitely),
1420 // with different feedbacks, no termination
1421
1422 const static int t28_code_generator[] = {1, 0, 1, 4, 3, 6};
1423 const static int t28_code_feedback[] = {0, 0, 0, 5, 7, 7};
1424 const static int t28_encode_soai = 1;
1425
1426 const static char t28_in_0[] =
1427   {0, 1, 0, 0, 0, 1, 0, 0, 1};
1428 const static char t28_in_1[] =
1429   {0, 0, 1, 0, 1, 1, 0, 0, 1};
1430 const static char t28_in_2[] =
1431   {0, 0, 0, 1, 0, 0, 0, 0, 1};
1432 const static char* t28_in[] =
1433   {t28_in_0, t28_in_1, t28_in_2};
1434
1435 const static size_t t28_n_input_items = sizeof (t28_in_0);
1436 const static size_t t28_n_code_inputs = sizeof (t28_in) / sizeof (char*);
1437
1438 const static char t28_res_0[] =
1439   {0, 1, 0, 1, 0, 1, 0, 0, 0};
1440 const static char t28_res_1[] =
1441   {0, 0, 1, 1, 1, 1, 0, 0, 1};
1442 const static char* t28_res[] =
1443   {t28_res_0, t28_res_1};
1444
1445 const static size_t t28_n_output_items = sizeof (t28_res_0);
1446 const static size_t t28_n_code_outputs = sizeof (t28_res) / sizeof (char*);
1447
1448 void
1449 qa_encoder_convolutional_ic1_ic1::t28
1450 ()
1451 {
1452   do_encoder_check (g_do_encode_in_or_out_23_45,
1453                     (const char**) t28_in, (const char**) t28_res,
1454                     1, (const size_t*) &t28_n_input_items,
1455                     (const size_t*) &t28_n_output_items, 100,
1456                     t28_n_code_inputs, t28_n_code_outputs,
1457                     (const int*) t28_code_generator,
1458                     (const int*) t28_code_feedback, true,
1459                     0, 0, t28_encode_soai);
1460 }
1461
1462 // TEST 29
1463 //
1464 // checking for:
1465 // start state is 0, no feedback, termination to 0 state
1466
1467 const static int t29_code_generator[] = {1, 0, 5, 0, 1, 6};
1468
1469 const static char t29_in_0[] =
1470   {0, 1, 0, 0, 1, 0};
1471 const static char t29_in_1[] =
1472   {0, 1, 0, 0, 0, 0};
1473 const static char t29_in_2[] =
1474   {0, 0, 1, 1, 1, 0};
1475 const static char* t29_in[] =
1476   {t29_in_0, t29_in_1, t29_in_2};
1477
1478 const static size_t t29_n_input_items = sizeof (t29_in_0);
1479 const static size_t t29_n_code_inputs = sizeof (t29_in) / sizeof (char*);
1480
1481 const static char t29_res_0[] =
1482   {0, 1, 1, 1, 1, 1, 1, 0};
1483 const static char t29_res_1[] =
1484   {0, 1, 0, 1, 0, 0, 1, 0};
1485 const static char* t29_res[] =
1486   {t29_res_0, t29_res_1};
1487
1488 const static size_t t29_n_output_items = sizeof (t29_res_0);
1489 const static size_t t29_n_code_outputs = sizeof (t29_res) / sizeof (char*);
1490
1491 void
1492 qa_encoder_convolutional_ic1_ic1::t29
1493 ()
1494 {
1495   do_encoder_check (g_do_encode_in_or_out_23_45,
1496                     (const char**) t29_in, (const char**) t29_res,
1497                     1, (const size_t*) &t29_n_input_items, 
1498                     (const size_t*) &t29_n_output_items, 5, t29_n_code_inputs,
1499                     t29_n_code_outputs, (const int*) t29_code_generator);
1500 }
1501
1502 // TEST 30
1503 //
1504 // checking for:
1505 // start state is 0, same feedback, termination to 0 state
1506 // # of termination bits = 2
1507
1508 const static int t30_code_generator[] = {1, 0, 5, 0, 1, 6};
1509 const static int t30_code_feedback[] = {0, 0, 7, 0, 0, 7};
1510
1511 const static char t30_in_0[] =
1512   {0, 1, 1, 0, 0, 0, 0};
1513 const static char t30_in_1[] =
1514   {0, 1, 0, 1, 0, 0, 0};
1515 const static char t30_in_2[] =
1516   {0, 0, 0, 0, 1, 0, 1};
1517 const static char* t30_in[] =
1518   {t30_in_0, t30_in_1, t30_in_2};
1519
1520 const static size_t t30_n_input_items = sizeof (t30_in_0);
1521 const static size_t t30_n_code_inputs = sizeof (t30_in) / sizeof (char*);
1522
1523 const static char t30_res_0[] =
1524   {0, 1, 1, 0, 1, 0, 1, 0, 1};
1525 const static char t30_res_1[] =
1526   {0, 1, 0, 1, 0, 1, 1, 0, 0};
1527 const static char* t30_res[] =
1528   {t30_res_0, t30_res_1};
1529
1530 const static size_t t30_n_output_items = sizeof (t30_res_0);
1531 const static size_t t30_n_code_outputs = sizeof (t30_res) / sizeof (char*);
1532
1533 void
1534 qa_encoder_convolutional_ic1_ic1::t30
1535 ()
1536 {
1537   do_encoder_check (g_do_encode_in_or_out_23_45,
1538                     (const char**) t30_in, (const char**) t30_res,
1539                     1, (const size_t*) &t30_n_input_items, 
1540                     (const size_t*) &t30_n_output_items, 5, t30_n_code_inputs,
1541                     t30_n_code_outputs, (const int*) t30_code_generator,
1542                     (const int*) t30_code_feedback);
1543 }
1544
1545 // TEST 31
1546 //
1547 // checking for:
1548 // state state is 0, different feedbacks, termination to 0 state
1549 // # of term bits will be 4
1550
1551 const static int t31_code_generator[] = {1, 4, 0, 3, 1, 6};
1552 const static int t31_code_feedback[] = {0, 5, 0, 7, 0, 7};
1553
1554 const static char t31_in_0[] =
1555   {0, 1, 0, 0, 0, 1, 0, 1, 1};
1556 const static char t31_in_1[] =
1557   {0, 0, 0, 1, 1, 1, 0, 1, 0};
1558 const static char* t31_in[] =
1559   {t31_in_0, t31_in_1};
1560
1561 const static size_t t31_n_input_items = sizeof (t31_in_0);
1562 const static size_t t31_n_code_inputs = sizeof (t31_in) / sizeof (char*);
1563
1564 const static char t31_res_0[] =
1565   {0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1};
1566 const static char t31_res_1[] =
1567   {0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0};
1568 const static char t31_res_2[] =
1569   {0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
1570 const static char* t31_res[] =
1571   {t31_res_0, t31_res_1, t31_res_2};
1572
1573 const static size_t t31_n_output_items = sizeof (t31_res_0);
1574 const static size_t t31_n_code_outputs = sizeof (t31_res) / sizeof (char*);
1575
1576 void
1577 qa_encoder_convolutional_ic1_ic1::t31
1578 ()
1579 {
1580   do_encoder_check (g_do_encode_in_or_out_23_45,
1581                     (const char**) t31_in, (const char**) t31_res,
1582                     1, (const size_t*) &t31_n_input_items, 
1583                     (const size_t*) &t31_n_output_items, 6, t31_n_code_inputs,
1584                     t31_n_code_outputs, (const int*) t31_code_generator,
1585                     (const int*) t31_code_feedback);
1586 }
1587
1588 // TEST 32
1589 //
1590 // checking for:
1591 // start state is 0, different feedbacks, termination to non-0 state
1592 // # of term bits will be 2
1593
1594 const static int t32_code_generator[] = {1, 0, 1, 4, 3, 6};
1595 const static int t32_code_feedback[] = {0, 0, 0, 5, 7, 7};
1596 const static size_t t32_term_state = 4;
1597
1598 const static char t32_in_0[] =
1599   {0, 1, 0, 0, 0, 0, 1};
1600 const static char t32_in_1[] =
1601   {0, 0, 1, 0, 1, 0, 1};
1602 const static char t32_in_2[] =
1603   {0, 0, 0, 1, 0, 0, 1};
1604 const static char* t32_in[] =
1605   {t32_in_0, t32_in_1, t32_in_2};
1606
1607 const static size_t t32_n_input_items = sizeof (t32_in_0);
1608 const static size_t t32_n_code_inputs = sizeof (t32_in) / sizeof (char*);
1609
1610 const static char t32_res_0[] =
1611   {0, 1, 0, 1, 0, 1, 1, 0, 0};
1612 const static char t32_res_1[] =
1613   {0, 0, 1, 1, 1, 1, 1, 0, 1};
1614 const static char* t32_res[] =
1615   {t32_res_0, t32_res_1};
1616
1617 const static size_t t32_n_output_items = sizeof (t32_res_0);
1618 const static size_t t32_n_code_outputs = sizeof (t32_res) / sizeof (char*);
1619
1620 void
1621 qa_encoder_convolutional_ic1_ic1::t32
1622 ()
1623 {
1624   do_encoder_check (g_do_encode_in_or_out_23_45,
1625                     (const char**) t32_in, (const char**) t32_res,
1626                     1, (const size_t*) &t32_n_input_items,
1627                     (const size_t*) &t32_n_output_items, 5, t32_n_code_inputs,
1628                     t32_n_code_outputs, (const int*) t32_code_generator,
1629                     (const int*) t32_code_feedback, true, 0, t32_term_state);
1630 }
1631
1632 // TEST 33
1633 //
1634 // checking for termination to non-0 state, no feedback
1635
1636 const static int t33_code_generator[] = {1, 0, 3, 0, 1, 6};
1637 const static size_t t33_term_state = 2;
1638
1639 const static char t33_in_0[] =
1640   {0, 1, 0, 1, 0, 0, 1, 1};
1641 const static char t33_in_1[] =
1642   {0, 1, 0, 0, 1, 0, 1, 1};
1643 const static char t33_in_2[] =
1644   {0, 1, 0, 1, 1, 0, 0, 1};
1645 const static char* t33_in[] =
1646   {t33_in_0, t33_in_1, t33_in_2};
1647
1648 const static size_t t33_n_input_items = sizeof (t33_in_0);
1649 const static size_t t33_n_code_inputs = sizeof (t33_in) / sizeof (char*);
1650
1651 const static char t33_res_0[] =
1652   {0, 0, 1, 0, 0, 0, 1, 0, 1, 0};
1653 const static char t33_res_1[] =
1654   {0, 1, 1, 1, 0, 0, 0, 0, 1, 1};
1655 const static char* t33_res[] =
1656   {t33_res_0, t33_res_1};
1657
1658 const static size_t t33_n_output_items = sizeof (t33_res_0);
1659 const static size_t t33_n_code_outputs = sizeof (t33_res) / sizeof (char*);
1660
1661 void
1662 qa_encoder_convolutional_ic1_ic1::t33
1663 ()
1664 {
1665   do_encoder_check (g_do_encode_in_or_out_23_45,
1666                     (const char**) t33_in, (const char**) t33_res,
1667                     1, (const size_t*) &t33_n_input_items, 
1668                     (const size_t*) &t33_n_output_items, 5,
1669                     t33_n_code_inputs, t33_n_code_outputs,
1670                     (const int*) t33_code_generator,
1671                     0, true, 0, t33_term_state);
1672 }
1673
1674 // TEST 34
1675 //
1676 // checking for:
1677 // start state is not 0, no feedback, terminating to 0 state
1678
1679 const static int t34_code_generator[] = {1, 0, 3, 0, 1, 6};
1680 const static size_t t34_start_state = 1;
1681
1682 const static char t34_in_0[] =
1683   {0, 1, 0, 0, 0, 1, 0};
1684 const static char t34_in_1[] =
1685   {0, 0, 1, 0, 0, 1, 0};
1686 const static char t34_in_2[] =
1687   {0, 1, 1, 1, 0, 1, 1};
1688 const static char* t34_in[] =
1689   {t34_in_0, t34_in_1, t34_in_2};
1690
1691 const static size_t t34_n_input_items = sizeof (t34_in_0);
1692 const static size_t t34_n_code_inputs = sizeof (t34_in) / sizeof (char*);
1693
1694 const static char t34_res_0[] =
1695   {1, 0, 0, 0, 1, 0, 0, 1, 0};
1696 const static char t34_res_1[] =
1697   {1, 1, 0, 0, 0, 1, 0, 0, 0};
1698 const static char* t34_res[] =
1699   {t34_res_0, t34_res_1};
1700
1701 const static size_t t34_n_output_items = sizeof (t34_res_0);
1702 const static size_t t34_n_code_outputs = sizeof (t34_res) / sizeof (char*);
1703
1704 void
1705 qa_encoder_convolutional_ic1_ic1::t34
1706 ()
1707 {
1708   do_encoder_check (g_do_encode_in_or_out_23_45,
1709                     (const char**) t34_in, (const char**) t34_res,
1710                     1, (const size_t*) &t34_n_input_items, 
1711                     (const size_t*) &t34_n_output_items, 5,
1712                     t34_n_code_inputs, t34_n_code_outputs,
1713                     (const int*) t34_code_generator,
1714                     0, true, t34_start_state);
1715 }
1716
1717 // TEST 35
1718 //
1719 // checking for:
1720 // start state is not 0, no feedback, terminating to non-0 state
1721
1722 const static int t35_code_generator[] = {1, 0, 3, 0, 1, 6};
1723 const static size_t t35_start_state = 2;
1724 const static size_t t35_term_state = 2;
1725
1726 const static char t35_in_0[] =
1727   {0, 1, 1, 1, 0, 1, 0};
1728 const static char t35_in_1[] =
1729   {0, 1, 0, 0, 0, 0, 1};
1730 const static char t35_in_2[] =
1731   {0, 1, 1, 0, 1, 0, 1};
1732 const static char* t35_in[] =
1733   {t35_in_0, t35_in_1, t35_in_2};
1734
1735 const static size_t t35_n_input_items = sizeof (t35_in_0);
1736 const static size_t t35_n_code_inputs = sizeof (t35_in) / sizeof (char*);
1737
1738 const static char t35_res_0[] =
1739   {0, 0, 1, 0, 1, 0, 1, 1, 1};
1740 const static char t35_res_1[] =
1741   {1, 1, 1, 0, 1, 1, 0, 1, 1};
1742 const static char* t35_res[] =
1743   {t35_res_0, t35_res_1};
1744
1745 const static size_t t35_n_output_items = sizeof (t35_res_0);
1746 const static size_t t35_n_code_outputs = sizeof (t35_res) / sizeof (char*);
1747
1748 void
1749 qa_encoder_convolutional_ic1_ic1::t35
1750 ()
1751 {
1752   do_encoder_check (g_do_encode_in_or_out_23_45,
1753                     (const char**) t35_in, (const char**) t35_res,
1754                     1, (const size_t*) &t35_n_input_items,
1755                     (const size_t*) &t35_n_output_items, 5, t35_n_code_inputs,
1756                     t35_n_code_outputs, (const int*) t35_code_generator,
1757                     0, true, t35_start_state, t35_term_state);
1758 }
1759
1760 // TEST 36
1761 //
1762 // checking for:
1763 // start state is not 0, any feedback, termination to 0 state
1764
1765 const static int t36_code_generator[] = {1, 0, 5, 0, 1, 6};
1766 const static int t36_code_feedback[] = {0, 0, 7, 0, 0, 7};
1767 const static size_t t36_start_state = 2;
1768 const static size_t t36_term_state = 0;
1769
1770 const static char t36_in_0[] =
1771   {0, 1, 0, 0, 0, 1, 0};
1772 const static char t36_in_1[] =
1773   {0, 0, 1, 1, 0, 1, 0};
1774 const static char t36_in_2[] =
1775   {0, 0, 0, 0, 1, 0, 0};
1776 const static char* t36_in[] =
1777   {t36_in_0, t36_in_1, t36_in_2};
1778
1779 const static size_t t36_n_input_items = sizeof (t36_in_0);
1780 const static size_t t36_n_code_inputs = sizeof (t36_in) / sizeof (char*);
1781
1782 const static char t36_res_0[] =
1783   {0, 0, 1, 0, 0, 1, 0, 1, 1};
1784 const static char t36_res_1[] =
1785   {1, 1, 1, 0, 1, 1, 0, 0, 1};
1786 const static char* t36_res[] =
1787   {t36_res_0, t36_res_1};
1788
1789 const static size_t t36_n_output_items = sizeof (t36_res_0);
1790 const static size_t t36_n_code_outputs = sizeof (t36_res) / sizeof (char*);
1791
1792 void
1793 qa_encoder_convolutional_ic1_ic1::t36
1794 ()
1795 {
1796   do_encoder_check (g_do_encode_in_or_out_23_45,
1797                     (const char**) t36_in, (const char**) t36_res,
1798                     1, (const size_t*) &t36_n_input_items,
1799                     (const size_t*) &t36_n_output_items, 5,
1800                     t36_n_code_inputs, t36_n_code_outputs,
1801                     (const int*) t36_code_generator,
1802                     (const int*) t36_code_feedback,
1803                     true, t36_start_state, t36_term_state);
1804 }
1805
1806 // TEST 37
1807 //
1808 // checking for:
1809 // start state is not 0, any feedback, termination to non-zero state
1810
1811 const static int t37_code_generator[] = {1, 0, 5, 0, 1, 6};
1812 const static int t37_code_feedback[] = {0, 0, 7, 0, 0, 7};
1813 const static size_t t37_start_state = 1;
1814 const static size_t t37_term_state = 2;
1815
1816 const static char t37_in_0[] =
1817   {0, 1, 0, 1, 0, 1, 0};
1818 const static char t37_in_1[] =
1819   {0, 0, 0, 0, 1, 1, 0};
1820 const static char t37_in_2[] =
1821   {0, 1, 0, 0, 0, 1, 1};
1822 const static char* t37_in[] =
1823   {t37_in_0, t37_in_1, t37_in_2};
1824
1825 const static size_t t37_n_input_items = sizeof (t37_in_0);
1826 const static size_t t37_n_code_inputs = sizeof (t37_in) / sizeof (char*);
1827
1828 const static char t37_res_0[] =
1829   {1, 1, 1, 1, 1, 0, 1, 1, 1};
1830 const static char t37_res_1[] =
1831   {1, 0, 0, 1, 0, 0, 0, 0, 1};
1832 const static char* t37_res[] =
1833   {t37_res_0, t37_res_1};
1834
1835 const static size_t t37_n_output_items = sizeof (t37_res_0);
1836 const static size_t t37_n_code_outputs = sizeof (t37_res) / sizeof (char*);
1837
1838 void
1839 qa_encoder_convolutional_ic1_ic1::t37
1840 ()
1841 {
1842   do_encoder_check (g_do_encode_in_or_out_23_45,
1843                     (const char**) t37_in, (const char**) t37_res,
1844                     1, (const size_t*) &t37_n_input_items,
1845                     (const size_t*) &t37_n_output_items, 5,
1846                     t37_n_code_inputs, t37_n_code_outputs,
1847                     (const int*) t37_code_generator,
1848                     (const int*) t37_code_feedback,
1849                     true, t37_start_state, t37_term_state);
1850 }
1851
1852 // TEST 38
1853 //
1854 // checking for:
1855 // no feedback, block coding but no termination
1856
1857 const static int    t38_code_generator[] = {1, 0, 3, 0, 1, 6};
1858
1859 const static char t38_in_0[] =
1860   {0, 1, 0, 1, 0, 0, 1, 1};
1861 const static char t38_in_1[] =
1862   {0, 1, 0, 0, 1, 0, 1, 1};
1863 const static char t38_in_2[] =
1864   {0, 1, 0, 1, 1, 0, 0, 1};
1865 const static char* t38_in[] =
1866   {t38_in_0, t38_in_1, t38_in_2};
1867
1868 const static size_t t38_n_input_items = sizeof (t38_in_0);
1869 const static size_t t38_n_code_inputs = sizeof (t38_in) / sizeof (char*);
1870
1871 const static char t38_res_0[] =
1872   {0, 0, 1, 0, 0, 0, 1, 0};
1873 const static char t38_res_1[] =
1874   {0, 1, 1, 1, 0, 0, 1, 1};
1875 const static char* t38_res[] =
1876   {t38_res_0, t38_res_1};
1877
1878 const static size_t t38_n_output_items = sizeof (t38_res_0);
1879 const static size_t t38_n_code_outputs = sizeof (t38_res) / sizeof (char*);
1880
1881 void
1882 qa_encoder_convolutional_ic1_ic1::t38
1883 ()
1884 {
1885   do_encoder_check (g_do_encode_in_or_out_23_45,
1886                     (const char**) t38_in, (const char**) t38_res,
1887                     1, (const size_t*) &t38_n_input_items, 
1888                     (const size_t*) &t38_n_output_items, 5,
1889                     t38_n_code_inputs, t38_n_code_outputs,
1890                     (const int*) t38_code_generator, 0, false);
1891 }
1892
1893 // TEST 39
1894 //
1895 // checking for:
1896 // start state is 0, same feedback, block but no termination
1897
1898 const static int t39_code_generator[] = {1, 0, 5, 0, 1, 6};
1899 const static int t39_code_feedback[] = {0, 0, 7, 0, 0, 7};
1900
1901 const static char t39_in_0[] =
1902   {0, 1, 1, 0, 0, 0, 0};
1903 const static char t39_in_1[] =
1904   {0, 1, 0, 1, 0, 0, 0};
1905 const static char t39_in_2[] =
1906   {0, 0, 0, 0, 1, 0, 1};
1907 const static char* t39_in[] =
1908   {t39_in_0, t39_in_1, t39_in_2};
1909
1910 const static size_t t39_n_input_items = sizeof (t39_in_0);
1911 const static size_t t39_n_code_inputs = sizeof (t39_in) / sizeof (char*);
1912
1913 const static char t39_res_0[] =
1914   {0, 1, 1, 0, 1, 0, 1};
1915 const static char t39_res_1[] =
1916   {0, 1, 0, 1, 0, 0, 0};
1917 const static char* t39_res[] =
1918   {t39_res_0, t39_res_1};
1919
1920 const static size_t t39_n_output_items = sizeof (t39_res_0);
1921 const static size_t t39_n_code_outputs = sizeof (t39_res) / sizeof (char*);
1922
1923 void
1924 qa_encoder_convolutional_ic1_ic1::t39
1925 ()
1926 {
1927   do_encoder_check (g_do_encode_in_or_out_23_45,
1928                     (const char**) t39_in, (const char**) t39_res,
1929                     1, (const size_t*) &t39_n_input_items, 
1930                     (const size_t*) &t39_n_output_items, 5, t39_n_code_inputs,
1931                     t39_n_code_outputs, (const int*) t39_code_generator,
1932                     (const int*) t39_code_feedback, false);
1933 }
1934
1935 // TEST 40
1936 //
1937 // checking for:
1938 // state state is 0, different feedbacks, block but no termination
1939
1940 const static int t40_code_generator[] = {1, 4, 0, 3, 1, 6};
1941 const static int t40_code_feedback[] = {0, 5, 0, 7, 0, 7};
1942
1943 const static char t40_in_0[] =
1944   {0, 1, 0, 0, 0, 1, 0, 1, 1};
1945 const static char t40_in_1[] =
1946   {0, 0, 0, 1, 1, 1, 0, 1, 0};
1947 const static char* t40_in[] =
1948   {t40_in_0, t40_in_1};
1949
1950 const static size_t t40_n_input_items = sizeof (t40_in_0);
1951 const static size_t t40_n_code_inputs = sizeof (t40_in) / sizeof (char*);
1952
1953 const static char t40_res_0[] =
1954   {0, 1, 0, 0, 0, 0, 0, 1, 1};
1955 const static char t40_res_1[] =
1956   {0, 0, 0, 1, 1, 0, 0, 1, 0};
1957 const static char t40_res_2[] =
1958   {0, 1, 0, 0, 1, 0, 0, 1, 0};
1959 const static char* t40_res[] =
1960   {t40_res_0, t40_res_1, t40_res_2};
1961
1962 const static size_t t40_n_output_items = sizeof (t40_res_0);
1963 const static size_t t40_n_code_outputs = sizeof (t40_res) / sizeof (char*);
1964
1965 void
1966 qa_encoder_convolutional_ic1_ic1::t40
1967 ()
1968 {
1969   do_encoder_check (g_do_encode_in_or_out_23_45,
1970                     (const char**) t40_in, (const char**) t40_res,
1971                     1, (const size_t*) &t40_n_input_items, 
1972                     (const size_t*) &t40_n_output_items, 6, t40_n_code_inputs,
1973                     t40_n_code_outputs, (const int*) t40_code_generator,
1974                     (const int*) t40_code_feedback, false);
1975 }
1976
1977 // TEST 41
1978 //
1979 // checking for:
1980 // start state is not 0, no feedback, terminating to non-0 state
1981 // multi-encode, forced to retrieve all term outputs
1982
1983 const static int t41_code_generator[] = {1, 0, 3, 0, 1, 6};
1984 const static size_t t41_start_state = 2;
1985 const static size_t t41_term_state = 2;
1986
1987 const static char t41_in_0[] =
1988   {0, 1, 1, 1, 0, 1, 0};
1989 const static char t41_in_1[] =
1990   {0, 1, 0, 0, 0, 0, 1};
1991 const static char t41_in_2[] =
1992   {0, 1, 1, 0, 1, 0, 1};
1993 const static char* t41_in[] =
1994   {t41_in_0, t41_in_1, t41_in_2};
1995
1996 const static size_t t41_n_input_items[] = {3, 2, 2};
1997 const static size_t t41_n_io_items = (sizeof (t41_n_input_items) /
1998                                       sizeof (size_t));
1999 const static size_t t41_n_code_inputs = sizeof (t41_in) / sizeof (char*);
2000
2001 const static char t41_res_0[] =
2002   {0, 0, 1, 0, 1, 0, 1, 1, 1};
2003 const static char t41_res_1[] =
2004   {1, 1, 1, 0, 1, 1, 0, 1, 1};
2005 const static char* t41_res[] =
2006   {t41_res_0, t41_res_1};
2007
2008 const static size_t t41_n_output_items[] = {3, 4, 2};
2009 const static size_t t41_n_code_outputs = sizeof (t41_res) / sizeof (char*);
2010
2011 void
2012 qa_encoder_convolutional_ic1_ic1::t41
2013 ()
2014 {
2015   do_encoder_check (g_do_encode_in_or_out_23_45,
2016                     (const char**) t41_in, (const char**) t41_res,
2017                     t41_n_io_items, (const size_t*) t41_n_input_items,
2018                     (const size_t*) t41_n_output_items, 5, t41_n_code_inputs,
2019                     t41_n_code_outputs, (const int*) t41_code_generator,
2020                     0, true, t41_start_state, t41_term_state);
2021 }
2022
2023 // TEST 42
2024 //
2025 // checking for:
2026 // start state is not 0, any feedback, termination to non-zero state
2027 // multi-encode
2028
2029 const static int t42_code_generator[] = {1, 0, 5, 0, 1, 6};
2030 const static int t42_code_feedback[] = {0, 0, 7, 0, 0, 7};
2031 const static size_t t42_start_state = 1;
2032 const static size_t t42_term_state = 2;
2033
2034 const static char t42_in_0[] =
2035   {0, 1, 0, 1, 0, 1, 0};
2036 const static char t42_in_1[] =
2037   {0, 0, 0, 0, 1, 1, 0};
2038 const static char t42_in_2[] =
2039   {0, 1, 0, 0, 0, 1, 1};
2040 const static char* t42_in[] =
2041   {t42_in_0, t42_in_1, t42_in_2};
2042
2043 const static size_t t42_n_input_items[] = {2, 2, 1, 1, 1};
2044 const static size_t t42_n_io_items = (sizeof (t42_n_input_items) /
2045                                       sizeof (size_t));
2046 const static size_t t42_n_code_inputs = sizeof (t42_in) / sizeof (char*);
2047
2048 const static char t42_res_0[] =
2049   {1, 1, 1, 1, 1, 0, 1, 1, 1};
2050 const static char t42_res_1[] =
2051   {1, 0, 0, 1, 0, 0, 0, 0, 1};
2052 const static char* t42_res[] =
2053   {t42_res_0, t42_res_1};
2054
2055 const static size_t t42_n_output_items[] = {2, 2, 3, 1, 1};
2056 const static size_t t42_n_code_outputs = sizeof (t42_res) / sizeof (char*);
2057
2058 void
2059 qa_encoder_convolutional_ic1_ic1::t42
2060 ()
2061 {
2062   do_encoder_check (g_do_encode_in_or_out_23_45,
2063                     (const char**) t42_in, (const char**) t42_res,
2064                     1, (const size_t*) &t42_n_input_items,
2065                     (const size_t*) &t42_n_output_items, 5,
2066                     t42_n_code_inputs, t42_n_code_outputs,
2067                     (const int*) t42_code_generator,
2068                     (const int*) t42_code_feedback,
2069                     true, t42_start_state, t42_term_state);
2070 }
2071
2072 // TEST 43
2073 //
2074 // checking for:
2075 // no feedback, block coding but no termination
2076 // multi-encode
2077
2078 const static int    t43_code_generator[] = {1, 0, 3, 0, 1, 6};
2079
2080 const static char t43_in_0[] =
2081   {0, 1, 0, 1, 0, 0, 1, 1};
2082 const static char t43_in_1[] =
2083   {0, 1, 0, 0, 1, 0, 1, 1};
2084 const static char t43_in_2[] =
2085   {0, 1, 0, 1, 1, 0, 0, 1};
2086 const static char* t43_in[] =
2087   {t43_in_0, t43_in_1, t43_in_2};
2088
2089 const static size_t t43_n_input_items[] = {2, 2, 2, 2};
2090 const static size_t t43_n_n_input_items = (sizeof (t43_n_input_items) /
2091                                            sizeof (size_t));
2092 const static size_t t43_n_code_inputs = sizeof (t43_in) / sizeof (char*);
2093
2094 const static char t43_res_0[] =
2095   {0, 0, 1, 0, 0, 0, 1, 0};
2096 const static char t43_res_1[] =
2097   {0, 1, 1, 1, 0, 0, 1, 1};
2098 const static char* t43_res[] =
2099   {t43_res_0, t43_res_1};
2100
2101 const static size_t t43_n_output_items[] = {2, 2, 2, 2};
2102 const static size_t t43_n_code_outputs = sizeof (t43_res) / sizeof (char*);
2103
2104 void
2105 qa_encoder_convolutional_ic1_ic1::t43
2106 ()
2107 {
2108   do_encoder_check (g_do_encode_in_or_out_23_45,
2109                     (const char**) t43_in, (const char**) t43_res,
2110                     t43_n_n_input_items, (const size_t*) t43_n_input_items, 
2111                     (const size_t*) t43_n_output_items, 5,
2112                     t43_n_code_inputs, t43_n_code_outputs,
2113                     (const int*) t43_code_generator, 0, false);
2114 }
2115
2116 // TEST 44
2117 //
2118 // checking for:
2119 // start state is 0, same feedback, block but no termination
2120 // multi-encode
2121
2122 const static int t44_code_generator[] = {1, 0, 5, 0, 1, 6};
2123 const static int t44_code_feedback[] = {0, 0, 7, 0, 0, 7};
2124
2125 const static char t44_in_0[] =
2126   {0, 1, 1, 0, 0, 0, 0};
2127 const static char t44_in_1[] =
2128   {0, 1, 0, 1, 0, 0, 0};
2129 const static char t44_in_2[] =
2130   {0, 0, 0, 0, 1, 0, 1};
2131 const static char* t44_in[] =
2132   {t44_in_0, t44_in_1, t44_in_2};
2133
2134 const static size_t t44_n_input_items[] = {5, 1, 1};
2135 const static size_t t44_n_n_input_items = (sizeof (t44_n_input_items) /
2136                                            sizeof (size_t));
2137 const static size_t t44_n_code_inputs = sizeof (t44_in) / sizeof (char*);
2138
2139 const static char t44_res_0[] =
2140   {0, 1, 1, 0, 1, 0, 1};
2141 const static char t44_res_1[] =
2142   {0, 1, 0, 1, 0, 0, 0};
2143 const static char* t44_res[] =
2144   {t44_res_0, t44_res_1};
2145
2146 const static size_t t44_n_output_items[] = {5, 1, 1};
2147 const static size_t t44_n_code_outputs = sizeof (t44_res) / sizeof (char*);
2148
2149 void
2150 qa_encoder_convolutional_ic1_ic1::t44
2151 ()
2152 {
2153   do_encoder_check (g_do_encode_in_or_out_23_45,
2154                     (const char**) t44_in, (const char**) t44_res,
2155                     t44_n_n_input_items, (const size_t*) t44_n_input_items, 
2156                     (const size_t*) t44_n_output_items, 5, t44_n_code_inputs,
2157                     t44_n_code_outputs, (const int*) t44_code_generator,
2158                     (const int*) t44_code_feedback, false);
2159 }
2160
2161 // TEST 45
2162 //
2163 // checking for:
2164 // state state is 0, different feedbacks, block but no termination
2165 // multi-encode
2166
2167 const static int t45_code_generator[] = {1, 4, 0, 3, 1, 6};
2168 const static int t45_code_feedback[] = {0, 5, 0, 7, 0, 7};
2169
2170 const static char t45_in_0[] =
2171   {0, 1, 0, 0, 0, 1, 0, 1, 1};
2172 const static char t45_in_1[] =
2173   {0, 0, 0, 1, 1, 1, 0, 1, 0};
2174 const static char* t45_in[] =
2175   {t45_in_0, t45_in_1};
2176
2177 const static size_t t45_n_input_items[] = {5, 4};
2178 const static size_t t45_n_n_input_items = (sizeof (t45_n_input_items) /
2179                                            sizeof (size_t));
2180 const static size_t t45_n_code_inputs = sizeof (t45_in) / sizeof (char*);
2181
2182 const static char t45_res_0[] =
2183   {0, 1, 0, 0, 0, 0, 0, 1, 1};
2184 const static char t45_res_1[] =
2185   {0, 0, 0, 1, 1, 0, 0, 1, 0};
2186 const static char t45_res_2[] =
2187   {0, 1, 0, 0, 1, 0, 0, 1, 0};
2188 const static char* t45_res[] =
2189   {t45_res_0, t45_res_1, t45_res_2};
2190
2191 const static size_t t45_n_output_items[] = {5, 4};
2192 const static size_t t45_n_code_outputs = sizeof (t45_res) / sizeof (char*);
2193
2194 void
2195 qa_encoder_convolutional_ic1_ic1::t45
2196 ()
2197 {
2198   do_encoder_check (g_do_encode_in_or_out_23_45,
2199                     (const char**) t45_in, (const char**) t45_res,
2200                     t45_n_n_input_items, (const size_t*) t45_n_input_items, 
2201                     (const size_t*) t45_n_output_items, 6, t45_n_code_inputs,
2202                     t45_n_code_outputs, (const int*) t45_code_generator,
2203                     (const int*) t45_code_feedback, false);
2204 }
2205
2206 // TEST 46
2207 //
2208 // checking for:
2209 // start state is not 0, no feedback, terminating to non-0 state
2210 // multi-encode, input dictates encoding: forced to retrieve all term
2211 // outputs; multiple encoding blocks
2212
2213 const static int t46_code_generator[] = {1, 0, 3, 0, 1, 6};
2214 const static size_t t46_start_state = 2;
2215 const static size_t t46_term_state = 2;
2216
2217 const static char t46_in_0[] =
2218   {0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0};
2219 const static char t46_in_1[] =
2220   {0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0};
2221 const static char t46_in_2[] =
2222   {0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0};
2223 const static char* t46_in[] =
2224   {t46_in_0, t46_in_1, t46_in_2};
2225
2226 const static size_t t46_n_input_items[] = {5, 0, 4, 1, 1};
2227 const static size_t t46_n_io_items = (sizeof (t46_n_input_items) /
2228                                       sizeof (size_t));
2229 const static size_t t46_n_code_inputs = sizeof (t46_in) / sizeof (char*);
2230
2231 const static char t46_res_0[] =
2232   {0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0};
2233 const static char t46_res_1[] =
2234   {1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1};
2235 const static char* t46_res[] =
2236   {t46_res_0, t46_res_1};
2237
2238 const static size_t t46_n_output_items[] = {7, 0, 4, 3, 1};
2239 const static size_t t46_n_code_outputs = sizeof (t46_res) / sizeof (char*);
2240
2241 void
2242 qa_encoder_convolutional_ic1_ic1::t46
2243 ()
2244 {
2245   do_encoder_check (true,
2246                     (const char**) t46_in, (const char**) t46_res,
2247                     t46_n_io_items, (const size_t*) t46_n_input_items,
2248                     (const size_t*) t46_n_output_items, 5, t46_n_code_inputs,
2249                     t46_n_code_outputs, (const int*) t46_code_generator,
2250                     0, true, t46_start_state, t46_term_state);
2251 }
2252
2253 // TEST 47
2254 //
2255 // checking for:
2256 // start state is not 0, no feedback, terminating to non-0 state
2257 // multi-encode, output dictates encoding; multiple encoding blocks
2258
2259 const static int t47_code_generator[] = {1, 0, 3, 0, 1, 6};
2260 const static size_t t47_start_state = 2;
2261 const static size_t t47_term_state = 2;
2262
2263 const static char t47_in_0[] =
2264   {0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0};
2265 const static char t47_in_1[] =
2266   {0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0};
2267 const static char t47_in_2[] =
2268   {0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0};
2269 const static char* t47_in[] =
2270   {t47_in_0, t47_in_1, t47_in_2};
2271
2272 const static size_t t47_n_input_items[] = {5, 0, 0, 4, 1, 0, 0, 1};
2273 const static size_t t47_n_io_items = (sizeof (t47_n_input_items) /
2274                                       sizeof (size_t));
2275 const static size_t t47_n_code_inputs = sizeof (t47_in) / sizeof (char*);
2276
2277 const static char t47_res_0[] =
2278   {0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0};
2279 const static char t47_res_1[] =
2280   {1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1};
2281 const static char* t47_res[] =
2282   {t47_res_0, t47_res_1};
2283
2284 const static size_t t47_n_output_items[] = {6, 0, 1, 4, 1, 1, 1, 1};
2285 const static size_t t47_n_code_outputs = sizeof (t47_res) / sizeof (char*);
2286
2287 void
2288 qa_encoder_convolutional_ic1_ic1::t47
2289 ()
2290 {
2291   do_encoder_check (false,
2292                     (const char**) t47_in, (const char**) t47_res,
2293                     t47_n_io_items, (const size_t*) t47_n_input_items,
2294                     (const size_t*) t47_n_output_items, 5, t47_n_code_inputs,
2295                     t47_n_code_outputs, (const int*) t47_code_generator,
2296                     0, true, t47_start_state, t47_term_state);
2297 }
2298