示例#1
0
void test_cvector_pop_back()
{
  cvector vec;
  int tester = 1;

  /* start the test */

  /* run the functions */
  cvector_init(&vec, int_function_registry());
  cvector_push_back(vec, &tester);
  cvector_pop_back(vec);

  /* test the results */
  FO_ASSERT_EQUAL(vec->size, 0);
  FO_ASSERT_PTR_EQUAL(vec->data[0], NULL);

  cvector_destroy(vec);
}
示例#2
0
void test_cvector_pop_back()
{
  cvector vec;
  int tester = 1;

  /* start the test */
  printf("Test cvector_pop_back:");

  /* run the functions */
  cvector_init(&vec, int_function_registry());
  cvector_push_back(vec, &tester);
  cvector_pop_back(vec);

  /* test the results */
  CU_ASSERT_EQUAL(vec->size, 0);
  CU_ASSERT_EQUAL(vec->data[0], NULL);

  cvector_destroy(vec);
  test_failure();
  printf("\n");
}