/* Time-stamp: <2009/06/02 11:24:00 Shinya Abe> */

#include <stdlib.h>
#include "cue/cue.h"
#include "../src/add.h"

void 
test_add()
{
  CU_ASSERT_INT_EQUAL(add(1, 2), 3);
  CU_ASSERT_INT_EQUAL(add(2, -3), -1);
}

/* Example assertions */
void
test_assertion()
{
  CU_PASS("pass");
  CU_ASSERT_TRUE(1);
  CU_ASSERT_FALSE(0);
  CU_ASSERT_INT_EQUAL(1, 1);
  CU_ASSERT_INT_NOT_EQUAL(0, 1);
  CU_ASSERT_STRING_EQUAL("cue", "cue");
  CU_ASSERT_STRING_NOT_EQUAL("cue", "euc");
  CU_ASSERT_NSTRING_EQUAL("cue", "cue", 3);
  CU_ASSERT_NSTRING_NOT_EQUAL("cue", "euc", 3);
  CU_ASSERT_DOUBLE_EQUAL(1.11, 1.12, 0.05);
  CU_ASSERT_DOUBLE_NOT_EQUAL(1.11, 1.12, 0.005);
}

int
main(int argc, char **argv)
{
  CU_TEST_CASE(test_add);
  CU_TEST_CASE(test_assertion);

  return EXIT_SUCCESS;
}
