Esempio n. 1
0
int
main (int argc, char* argv[])
{
  if (argc > 1 && !strcmp (argv[1], "--verbose"))
    verbose = 1;
  else if (argc > 1 && !strcmp (argv[1], "--debug"))
    verbose = debug = 1;

  if (!gcry_check_version (GCRYPT_VERSION))
    {
      fputs ("version mismatch\n", stderr);
      exit (1);
    }
  gcry_control(GCRYCTL_DISABLE_SECMEM);

  test_const_and_immutable ();
  test_opaque ();
  test_cmp ();
  test_add ();
  test_sub ();
  test_mul ();
  test_powm ();

  return !!error_count;
}
Esempio n. 2
0
int main()
{
	test_ptr_();
	test_constant_();
	test_null_();
	test_counted_();
	test_range_();

	test_cmp();
	test_rotate();
	/*	test_e();
	test_apply_();
	test_end_();
	test_iota_();
	test_until_();

	test_copy();
	test_rotate();
	test_swap();

	test_copy_until();
	test_counted_enumerator();
	test_pair_();

	test_past();
	test_upto();


	test_skip();
*/
	return 0;
}
Esempio n. 3
0
int main(void)
{
	test_v4();
	test_v6();
	test_cmp();
	printf("Test successful\n");
	return EXIT_SUCCESS;
}
Esempio n. 4
0
int main (int argc, char *argv[])
{
	my_stack = iks_stack_new (1024, 1024);

	test_id ("jabber:[email protected]/cabbar", "*****@*****.**", "madcat", "jabber.org", "cabbar");
	test_id ("*****@*****.**", "*****@*****.**", "bob", "silent.org", NULL);

	test_cmp ("[email protected]/hell", "[email protected]/heaven", IKS_ID_PARTIAL, 0);
	test_cmp ("[email protected]/cabbar", "[email protected]/jabberx", IKS_ID_FULL, IKS_ID_RESOURCE);
	test_cmp ("[email protected]/pda", "[email protected]/jabberx", IKS_ID_FULL, IKS_ID_USER | IKS_ID_RESOURCE);
	test_cmp ("[email protected]/gabber", "[email protected]/gsm", IKS_ID_FULL, IKS_ID_FULL);
	test_cmp ("*****@*****.**", "[email protected]/clam", IKS_ID_PARTIAL, 0);

	iks_stack_delete (my_stack);

	return 0;
}
Esempio n. 5
0
int main ( void ) {
	plan_tests(119);
	
	test_variables();
	test_literals();
	test_resources();
	test_bnodes();
	test_cmp();
	test_store();
	
	return exit_status();
}
Esempio n. 6
0
int
main ()
{
  test_cmp ();

  /* Test comparison with non-BMP characters.  */
  {
    static const UNIT input1[] = { 0x1D51F };
    static const UNIT input2[] = { 0xFEFF };
    ASSERT (U_CMP (input1, input2, 1) > 0);
    ASSERT (U_CMP (input2, input1, 1) < 0);
  }

  return 0;
}
Esempio n. 7
0
int
main ()
{
  test_cmp ();

  /* Test comparison with non-BMP characters.  */
  {
    static const UNIT input1[] = { 0xF0, 0x9D, 0x94, 0x9E };
    static const UNIT input2[] = { 0xEF, 0xBB, 0xBF, 0x00 };
    ASSERT (U_CMP (input1, input2, 4) > 0);
    ASSERT (U_CMP (input2, input1, 4) < 0);
  }

  return 0;
}
Esempio n. 8
0
static int
query_test(const char * raw_query, int exp_error, struct expected exp[], int flags) {
    evhtp_query_t   * query;
    struct expected * check;
    int               key_idx    = 0;
    int               idx        = 0;
    int               num_errors = 0;

    /* print whether error is expected or not */
    printf("%-7s  ", exp_error ? "(error)" : "");
    query = evhtp_parse_query_wflags(raw_query, strlen(raw_query), flags);
    if (!query) {
        printf("<error>");
        return exp_error == 0;
    }

    printf("{");
    evhtp_kvs_for_each(query, kvs_print, &key_idx);
    /* TODO check for keys in query but not in exp */
    printf("}");

    while (1) {
        evhtp_kv_t * kvobj  = NULL;
        const char * valstr = NULL;

        check = &exp[idx++];

        if (check == NULL || check->key == NULL) {
            break;
        }

        kvobj  = evhtp_kvs_find_kv(query, check->key);
        valstr = evhtp_kv_find(query, check->key);

        if (test_cmp(query, kvobj, valstr, check) == -1) {
            num_errors += 1;
            printf("         ");
        }
    }

    if (exp_error) {
        return -1;
    }

    return num_errors;
} /* query_test */
int
main ()
{
  test_cmp ();

  /* Test comparison with non-BMP characters, split into surrogates.  */
  {
    static const UNIT input1[] = { 0xD835, 0xDD1E };
    static const UNIT input2[] = { 0xFEFF, 0xFFE5 };
    ASSERT (U_CMP (input1, input2, 2) > 0);
    ASSERT (U_CMP (input2, input1, 2) < 0);
    ASSERT (U_CMP (input1, input2, 1) > 0);
    ASSERT (U_CMP (input2, input1, 1) < 0);
  }

  return 0;
}