static int
run_test (int /*unused*/, char* /*unused*/ [])
{
    test_simple_throw ();

    // constructors
    test_size_ctor ();
    test_npos_ctor ();

    test_max_size_ctor1 ();
    test_max_size_ctor2 ();

    test_len_ctor ();

    // member functions
    test_resize ();
    test_reserve ();
    test_at ();
    test_append ();
    test_assign ();

    test_insert1 ();
    test_insert2 ();

    test_erase ();

    test_replace1 ();
    test_replace2 ();
    test_replace3 ();

    test_copy ();
    test_substr ();

    return 0;
}
int
main()
{
    std::deque<int> const data = build_deque();
    test_assign(data);
    test_assign2(data);
    test_at(data);
    test_back(data);
    test_begin(data);
    test_clear(data);
    test_front(data);
    test_empty(data);
    test_end(data);
    test_erase(data);
    test_get_allocator(data);
    return boost::report_errors();
}
Beispiel #3
0
int main()
{
  test_realloc();

  test_user_supplied_free();

  test_at();

  test_front_and_back();

  //test_vector_copy();
  
  test_vector_reserve();

  test_empty();

  return 0;
}
Beispiel #4
0
int
main(void) {
  test_construct_with_null();
  test_construct_with_empty_string();
  test_construct_with_nonempty_string();
  test_append_char();
  test_at();
  test_back();
  test_capacity();
  test_clear();
  test_compare();
  test_data();
  test_empty();
  test_free();
  test_front();
  test_length();
  test_max_size();
  test_pop_back();
  test_push_back();
  test_reserve();
  test_resize();
  test_size();
  return EXIT_SUCCESS;
}
Beispiel #5
0
 symbolOop function_name()			{ return symbolOop(test_at(test_2_instruction_offset)->data()); }
Beispiel #6
0
 symbolOop dll_name()				{ return symbolOop(test_at(test_1_instruction_offset)->data()); }
Beispiel #7
0
int t_map()
{
	c_map map;

	c_map_create(&map, int_comparer);

	
	assert(__c_rb_tree_verify(map._l));
	printf("0. test create with insert unique\n");
	create_with_insert_unique(&map);
	print_map(&map);
	rprint_map(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n1. test clear\n");
	test_clear(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n2. test size and empty\n");
	test_size_empty(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n3. test create with insert equal\n");
	c_map_clear(&map);
	create_with_insert_equal(&map);
	print_map(&map);
	rprint_map(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n4. test swap\n");
	create_with_insert_unique(&map);
	test_swap(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n5. test create with insert unique1\n");
	create_with_insert_unique1(&map);
	print_map(&map);
	rprint_map(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n6. test create with insert equal1\n");
	c_map_clear(&map);
	create_with_insert_equal1(&map);
	print_map(&map);
	rprint_map(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n7. test create with insert unique2\n");
	c_map_clear(&map);
	create_with_insert_unique2(&map);
	print_map(&map);
	rprint_map(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n8. test create with insert equal2\n");
	c_map_clear(&map);
	create_with_insert_equal2(&map);
	print_map(&map);
	rprint_map(&map);
	assert(__c_rb_tree_verify(map._l));
	
	printf("\n\n9. test erase\n");
	c_map_clear(&map);
	create_with_insert_unique(&map);
	test_erase(&map);
	create_with_insert_unique(&map);	
	test_reverse_erase(&map);	
	print_map(&map);
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n10. test find and erase\n");
	c_map_clear(&map);
	printf("* test_find_erase:\n");
	create_with_insert_unique(&map);
	print_map(&map);	
	test_find_erase(&map);
	print_map(&map);	
	printf("* test_reverse_find_erase:\n");
	create_with_insert_unique(&map);
	print_map(&map);	
	test_reverse_find_erase(&map);
	print_map(&map);	
	assert(__c_rb_tree_verify(map._l));

	printf("\n\n11. test count:\n"); // 'lower_bound' 'upper_bound' 'equal_range' used	
	create_with_insert_unique(&map);
	test_count(&map);

	printf("\n\n12. test less:\n");
	test_less();

	printf("\n\n13. test equal:\n");
	test_equal();

	printf("\n\n14. test at:\n");
	test_at();
	
	c_map_destroy(&map);
	printf("\n\nfinish testing map!\n");
	return 0;
}