示例#1
0
int main(void)
{
	init();
	format();
	test_create_partition();
	create_objects();
	create_collection();
	#ifdef FULL_TEST
		remove_objects();
		write_objects();
		read_objects();
	#endif
	fini();
	return 0;
}
示例#2
0
void _create_collection()
{
  collection_t* collection = create_collection(0, 0);
  assert(collection);
  assert(collection_count(collection) == 0);
}
示例#3
0
{
	int id; 
	char name[64];
} test_obj_t;

void _create_collection()
{
  collection_t* collection = create_collection(0, 0);
  assert(collection);
  assert(collection_count(collection) == 0);
}

void _add_item_to_collection()
{
  test_obj_t test_obj = { .name="_add_item_to_collection" };
  collection_t* collection = create_collection(1, sizeof(test_obj_t));
  collection_push(collection, &test_obj);

  assert(collection_count(collection) == 1);
  assert(collection_any(collection));
}

void _get_first_item_from_collection()
{
	assert(collection_first(0) == 0);

	collection_t* collection = create_collection(1, sizeof(test_obj_t));
	assert(collection_first(collection) == 0);

	test_obj_t test_obj = { .name = "_get_first_item_from_collection" };
	collection_push(collection, &test_obj);