Home | History | Annotate | Line # | Download | only in tests
unit_test_sample.c revision 1.1
      1 /*	$NetBSD: unit_test_sample.c,v 1.1 2018/04/07 22:34:28 christos Exp $	*/
      2 
      3 #include "config.h"
      4 #include "t_api.h"
      5 
      6 static void foo(void);
      7 
      8 /*
      9  * T_testlist is a list of tests that are invoked.
     10  */
     11 testspec_t T_testlist[] = {
     12 	{	foo,		"sample test" 	},
     13 	{	NULL,		NULL 		}
     14 };
     15 
     16 static void
     17 foo(void) {
     18 	static const char *test_desc =
     19 		"this is an example test, for no actual module";
     20 
     21 	t_assert("sample", 1, T_REQUIRED, test_desc);
     22 
     23 	/* ... */	/* Test code would go here. */
     24 
     25 	t_result(T_PASS);
     26 }
     27 
     28