Пример #1
0
int main(void)
{
  int i, strict;
  //  srand(time(NULL));
  srand(0);
  intdim = 0;
  /*for (intdim=1;intdim<2;intdim++) {*/

  for (strict=0;strict<2;strict++) {
    /* init */
    pk = pk_manager_alloc(strict);
    ppl = ap_ppl_poly_manager_alloc(strict);
    for (i=0;i<AP_EXC_SIZE;i++){
      pk->option.abort_if_exception[i] = true;
      ppl->option.abort_if_exception[i] = true;
    }
    
    printf("\n\ncomparing libraries:\n- %s (%s)\n- %s (%s)\nwith strict=%i int=%i\n\n",
	   pk->library,pk->version,ppl->library,ppl->version,strict,intdim);
    /* run tests */
    test_conv();
    test_join();
    test_meet();
    test_join_array();
    test_meet_array();
    test_dimadd();
    test_dimrem();
    test_forget();
    test_permute();
    test_expand();
    test_fold();
    test_add_lincons();
    test_add_ray();
    test_box();
    test_vbound();
    test_lbound();
    test_csat();
    test_isat();
    test_assign();
    test_par_assign();
    test_subst();
    test_par_subst();
    if (!strict) test_widen(); // behave differently in strict mode
   
    /* clean-up */
    ap_manager_free(pk);
    ap_manager_free(ppl);
  }

  /*}*/

  if (error_) printf("\n%i error(s)!\n",error_);
  else printf("\nall tests passed\n");
  return 0;
}
Пример #2
0
int main()
{
    test_bool_vals();
    test_bool_ops();
    test_cmp_ops();
    test_arithmetic();
    test_attr();
    test_param();
    test_compound();
    test_conv();

    return 0;
}
Пример #3
0
int main(int argc, char *argv[]) {

	int ret;

	warnx("Host execution started");

	char* args[] = {argv[0], "../ROMFS/px4fmu_common/mixers/IO_pass.mix",
				 "../ROMFS/px4fmu_common/mixers/FMU_quad_w.mix"};

	if (ret = test_mixer(3, args));

	test_conv(1, args);

	return 0;
}
Пример #4
0
void test_convert()
{
	v8pp::context context;
	v8::Isolate* isolate = context.isolate();
	v8::HandleScope scope(isolate);

	test_conv(isolate, 1);
	test_conv(isolate, 2.2);
	test_conv(isolate, true);
	test_conv(isolate, 'a');
	test_conv(isolate, "qaz");

	std::vector<int> vector = { 1, 2, 3 };
	test_conv(isolate, vector);
	check("vector to array", v8pp::to_v8(isolate, vector.begin(), vector.end())->IsArray());

	std::list<int> list = { 1, 2, 3 };
	check("list to array", v8pp::to_v8(isolate, list.begin(), list.end())->IsArray());

	std::map<char, int> map = { { 'a', 1 }, { 'b', 2 }, { 'c', 3 } };
	test_conv(isolate, map);
}
void assert_test_result(correct_convolutional *conv, void *fec,
                        void (*decode)(void *, uint8_t *, size_t, uint8_t *),
                        conv_testbench **testbench, size_t test_length, size_t rate, size_t order,
                        double eb_n0, double error_rate) {
    double bpsk_voltage = 1.0 / sqrt(2.0);
    double bpsk_sym_energy = 2 * pow(bpsk_voltage, 2.0);
    double bpsk_bit_energy = bpsk_sym_energy * rate;

    size_t error_count =
        test_conv(conv, fec, decode, testbench, test_length, eb_n0, bpsk_bit_energy, bpsk_voltage);
    double observed_error_rate = error_count / ((double)test_length * 8);
    if (observed_error_rate > error_rate) {
        printf(
            "test failed, expected error rate=%.2e, observed error rate=%.2e @%.1fdB for rate %zu "
            "order %zu\n",
            error_rate, observed_error_rate, eb_n0, rate, order);
        exit(1);
    } else {
        printf(
            "test passed, expected error rate=%.2e, observed error rate=%.2e @%.1fdB for rate %zu "
            "order %zu\n",
            error_rate, observed_error_rate, eb_n0, rate, order);
    }
}