Four macros were added : - TTAIL_CHECK_START(char *test_suite_str, char *test_case_str) - TTAIL_SET_FIXTURE(void (*setup)(), void (*teardown)()) - TTAIL_ADD_TEST( libcheck_test test) - TTAIL_CHECK_END
		
			
				
	
	
		
			43 lines
		
	
	
	
		
			857 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
	
		
			857 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include <check.h>
 | |
| #include <errno.h>
 | |
| #include <stdio.h>
 | |
| #include <unistd.h>
 | |
| 
 | |
| #include "ttail_check.h"
 | |
| #include "ttail.h"
 | |
| #include "ttail_init.h"
 | |
| 
 | |
| START_TEST (test_argparse_fmt_short)
 | |
| {
 | |
| 	ttail_t *t;
 | |
| 	char *args[] = {"foo", "-f", "%m"};
 | |
| 	t = ttail_init(3, args);
 | |
| 	ck_assert(t != NULL);
 | |
| }
 | |
| END_TEST
 | |
| 
 | |
| START_TEST (test_argparse_fmt_long)
 | |
| {
 | |
| 	ttail_t *t;
 | |
| 	char *args[] = {"foo", "--date-format", "%m"};
 | |
| 	t = ttail_init(3, args);
 | |
| 	ck_assert(t != NULL);
 | |
| }
 | |
| END_TEST
 | |
| 
 | |
| START_TEST (test_argparse_fmt_multiple)
 | |
| {
 | |
| 	ttail_t *t;
 | |
| 	char *args[] = {"foo", "-f", "%m", "-f", "%d"};
 | |
| 	t = ttail_init(5, args);
 | |
| 	ck_assert(t == NULL);
 | |
| }
 | |
| END_TEST
 | |
| 
 | |
| TTAIL_CHECK_START(	"ttail argument parsing checks", \
 | |
| 			"date format arguments parsing")
 | |
| 	TTAIL_ADD_TEST(test_argparse_fmt_short);
 | |
| 	TTAIL_ADD_TEST(test_argparse_fmt_long);
 | |
| 	TTAIL_ADD_TEST(test_argparse_fmt_multiple);
 | |
| TTAIL_CHECK_END
 | |
| 
 |