#ifndef SEATEST_H #define SEATEST_H #include /* Defines */ #define SEATEST_VERSION "0.5" #define SEATEST_PROJECT_HOME "http://code.google.com/p/seatest/" #define SEATEST_PRINT_BUFFER_SIZE 100000 /* Typedefs */ typedef void (*seatest_void_void)(void); typedef void (*seatest_void_string)(char*); /* Declarations */ void (*seatest_simple_test_result)(int passed, char* reason, const char* function, unsigned int line); void seatest_test_fixture_start(char* filepath); void seatest_test_fixture_end( void ); void seatest_simple_test_result_log(int passed, char* reason, const char* function, unsigned int line); void seatest_assert_true(int test, const char* function, unsigned int line); void seatest_assert_false(int test, const char* function, unsigned int line); void seatest_assert_int_equal(int expected, int actual, const char* function, unsigned int line); void seatest_assert_ulong_equal(unsigned long expected, unsigned long actual, const char* function, unsigned int line); void seatest_assert_float_equal(float expected, float actual, float delta, const char* function, unsigned int line); void seatest_assert_double_equal(double expected, double actual, double delta, const char* function, unsigned int line); void seatest_assert_string_equal(char* expected, char* actual, const char* function, unsigned int line); void seatest_assert_string_ends_with(char* expected, char* actual, const char* function, unsigned int line); void seatest_assert_string_starts_with(char* expected, char* actual, const char* function, unsigned int line); void seatest_assert_string_contains(char* expected, char* actual, const char* function, unsigned int line); void seatest_assert_string_doesnt_contain(char* expected, char* actual, const char* function, unsigned int line); int seatest_should_run( char* fixture, char* test); void seatest_before_run( char* fixture, char* test); void seatest_run_test(char* fixture, char* test); void seatest_setup( void ); void seatest_teardown( void ); void seatest_suite_teardown( void ); void seatest_suite_setup( void ); /* Assert Macros */ #define assert_true(test) do { seatest_assert_true(test, __FUNCTION__, __LINE__); } while (0) #define assert_false(test) do { seatest_assert_false(test, __FUNCTION__, __LINE__); } while (0) #define assert_int_equal(expected, actual) do { seatest_assert_int_equal(expected, actual, __FUNCTION__, __LINE__); } while (0) #define assert_ulong_equal(expected, actual) do { seatest_assert_ulong_equal(expected, actual, __FUNCTION__, __LINE__); } while (0) #define assert_string_equal(expected, actual) do { seatest_assert_string_equal(expected, actual, __FUNCTION__, __LINE__); } while (0) #define assert_n_array_equal(expected, actual, n) do { int seatest_count; for(seatest_count=0; seatest_count