示例#1
0
int
main(int argc, char *argv[])
{

	printf("1..7\n");

	test_special();
	printf("ok 1 - special\n");

	test_special_atan2();
	printf("ok 2 - atan2 special\n");

	test_accuracy();
	printf("ok 3 - accuracy\n");

	test_p2x_atan2();
	printf("ok 4 - atan2 p2x\n");

	test_tiny();
	printf("ok 5 - tiny inputs\n");

	test_atan_huge();
	printf("ok 6 - atan huge inputs\n");

	test_inverse();
	printf("ok 7 - inverse\n");

	return (0);
}
示例#2
0
int
main(int argc, char **argv)
{
    krb5_keyblock keyblock;
    krb5_error_code ret;
    krb5_context context;
    krb5_crypto crypto;
    int i;

    ret = krb5_init_context(&context);
    if (ret)
	errx(1, "krb5_context_init: %d", ret);

    ret = krb5_generate_random_keyblock(context,
					ENCTYPE_AES256_CTS_HMAC_SHA1_96,
					&keyblock);
    if (ret)
	krb5_err(context, 1, ret, "krb5_generate_random_keyblock");

    ret = krb5_crypto_init(context, &keyblock, 0, &crypto);
    if (ret)
	krb5_err(context, 1, ret, "krb5_crypto_init");

    test_special(context, crypto, 1, 60);
    test_special(context, crypto, 0, 60);

    for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {
	test_range(&tests[i], 1, context, crypto);
	test_range(&tests[i], 0, context, crypto);
    }

    krb5_free_keyblock_contents(context, &keyblock);
    krb5_crypto_destroy(context, crypto);
    krb5_free_context(context);

    return 0;
}
示例#3
0
文件: tgrandom.c 项目: epowers/mpfr
int
main (int argc, char *argv[])
{
  long nbtests;
  int verbose;
  tests_start_mpfr ();

  verbose = 0;
  nbtests = 10;
  if (argc > 1)
    {
      long a = atol (argv[1]);
      verbose = 1;
      if (a != 0)
        nbtests = a;
    }

  test_grandom (nbtests, 420, MPFR_RNDN, verbose);
  test_special (2);
  test_special (42000);

  tests_end_mpfr ();
  return 0;
}
示例#4
0
int
main (int argc, char *argv[])
{
  mpfr_exp_t emin;

  tests_start_mpfr ();

  /* mpfr_round_nearest_away requires emin is not the smallest possible */
  if ((emin = mpfr_get_emin ()) == mpfr_get_emin_min ())
    mpfr_set_emin (mpfr_get_emin_min () + 1);

  test_special ();

  test_nonspecial ();

  mpfr_set_emin (emin);

  tests_end_mpfr ();
  return 0;
}