@ -70,7 +70,7 @@ static void print_list(struct test_container *x, char *expect)
strcat ( buff , " <=> " ) ;
}
ast_ log( LOG_NOTICE , " Got: %s [expect %s] \n " , buff , expect ) ;
ast_ debug( 1 , " Got: %s [expect %s] \n " , buff , expect ) ;
}
static void print_list_backwards ( struct test_container * x , char * expect )
@ -84,7 +84,7 @@ static void print_list_backwards(struct test_container *x, char *expect)
strcat ( buff , " <=> " ) ;
}
ast_ log( LOG_NOTICE , " Got: %s [expect %s] \n " , buff , expect ) ;
ast_ debug( 1 , " Got: %s [expect %s] \n " , buff , expect ) ;
}
static struct test_container * make_cont ( void )
@ -180,7 +180,7 @@ static void dll_tests(void)
struct test1 * d ;
struct test1 * e ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_INSERT_HEAD, AST_DLLIST_TRAVERSE, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_INSERT_HEAD, AST_DLLIST_TRAVERSE, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END \n " ) ;
tc = make_cont ( ) ;
a = make_test1 ( " A " ) ;
b = make_test1 ( " B " ) ;
@ -197,9 +197,9 @@ static void dll_tests(void)
tc = make_cont ( ) ;
if ( AST_DLLIST_EMPTY ( & tc - > entries ) )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_EMPTY....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_EMPTY....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_EMPTY....PROBLEM!! \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_EMPTY....PROBLEM!! \n " ) ;
a = make_test1 ( " A " ) ;
@ -207,7 +207,7 @@ static void dll_tests(void)
c = make_test1 ( " C " ) ;
d = make_test1 ( " D " ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_INSERT_TAIL \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_INSERT_TAIL \n " ) ;
AST_DLLIST_INSERT_TAIL ( & tc - > entries , a , list ) ;
AST_DLLIST_INSERT_TAIL ( & tc - > entries , b , list ) ;
AST_DLLIST_INSERT_TAIL ( & tc - > entries , c , list ) ;
@ -215,24 +215,24 @@ static void dll_tests(void)
print_list ( tc , " A <=> B <=> C <=> D " ) ;
if ( AST_DLLIST_FIRST ( & tc - > entries ) = = a )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_FIRST....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_FIRST....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_FIRST....PROBLEM \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_FIRST....PROBLEM \n " ) ;
if ( AST_DLLIST_LAST ( & tc - > entries ) = = d )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_LAST....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_LAST....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_LAST....PROBLEM \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_LAST....PROBLEM \n " ) ;
if ( AST_DLLIST_NEXT ( a , list ) = = b )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_NEXT....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_NEXT....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_NEXT....PROBLEM \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_NEXT....PROBLEM \n " ) ;
if ( AST_DLLIST_PREV ( d , list ) = = c )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_PREV....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_PREV....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_PREV....PROBLEM \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_PREV....PROBLEM \n " ) ;
destroy_test_container ( tc ) ;
@ -243,35 +243,35 @@ static void dll_tests(void)
c = make_test1 ( " C " ) ;
d = make_test1 ( " D " ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_INSERT_AFTER, AST_DLLIST_TRAVERSE_BACKWARDS \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_INSERT_AFTER, AST_DLLIST_TRAVERSE_BACKWARDS \n " ) ;
AST_DLLIST_INSERT_HEAD ( & tc - > entries , a , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , a , b , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , b , c , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , c , d , list ) ;
print_list_backwards ( tc , " D <=> C <=> B <=> A " ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE_HEAD \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE_HEAD \n " ) ;
AST_DLLIST_REMOVE_HEAD ( & tc - > entries , list ) ;
print_list_backwards ( tc , " D <=> C <=> B " ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE_HEAD \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE_HEAD \n " ) ;
AST_DLLIST_REMOVE_HEAD ( & tc - > entries , list ) ;
print_list_backwards ( tc , " D <=> C " ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE_HEAD \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE_HEAD \n " ) ;
AST_DLLIST_REMOVE_HEAD ( & tc - > entries , list ) ;
print_list_backwards ( tc , " D " ) ;
AST_DLLIST_REMOVE_HEAD ( & tc - > entries , list ) ;
if ( AST_DLLIST_EMPTY ( & tc - > entries ) )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE_HEAD....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE_HEAD....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_REMOVE_HEAD....PROBLEM!! \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_REMOVE_HEAD....PROBLEM!! \n " ) ;
AST_DLLIST_INSERT_HEAD ( & tc - > entries , a , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , a , b , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , b , c , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , c , d , list ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE \n " ) ;
AST_DLLIST_REMOVE ( & tc - > entries , c , list ) ;
print_list ( tc , " A <=> B <=> D " ) ;
AST_DLLIST_REMOVE ( & tc - > entries , a , list ) ;
@ -281,9 +281,9 @@ static void dll_tests(void)
AST_DLLIST_REMOVE ( & tc - > entries , b , list ) ;
if ( AST_DLLIST_EMPTY ( & tc - > entries ) )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE....OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE....OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_REMOVE....PROBLEM!! \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_REMOVE....PROBLEM!! \n " ) ;
AST_DLLIST_INSERT_HEAD ( & tc - > entries , a , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , a , b , list ) ;
@ -295,11 +295,11 @@ static void dll_tests(void)
}
AST_DLLIST_TRAVERSE_SAFE_END ;
if ( AST_DLLIST_EMPTY ( & tc - > entries ) )
ast_ log( LOG_NOTICE , " Test AST_DLLIST_REMOVE_CURRENT... OK \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_REMOVE_CURRENT... OK \n " ) ;
else
ast_log ( LOG_ NOTICE , " Test AST_DLLIST_REMOVE_CURRENT... PROBLEM \n " ) ;
ast_log ( LOG_ ERROR , " Test AST_DLLIST_REMOVE_CURRENT... PROBLEM \n " ) ;
ast_ log( LOG_NOTICE , " Test AST_DLLIST_MOVE_CURRENT, AST_DLLIST_INSERT_BEFORE_CURRENT \n " ) ;
ast_ debug( 1 , " Test AST_DLLIST_MOVE_CURRENT, AST_DLLIST_INSERT_BEFORE_CURRENT \n " ) ;
AST_DLLIST_INSERT_HEAD ( & tc - > entries , a , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , a , b , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , b , c , list ) ;
@ -325,7 +325,7 @@ static void dll_tests(void)
c = make_test1 ( " C " ) ;
d = make_test1 ( " D " ) ;
ast_ log( LOG_NOTICE , " Test: AST_DLLIST_MOVE_CURRENT_BACKWARDS and AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS \n " ) ;
ast_ debug( 1 , " Test: AST_DLLIST_MOVE_CURRENT_BACKWARDS and AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS \n " ) ;
AST_DLLIST_INSERT_HEAD ( & tc - > entries , a , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , a , b , list ) ;
AST_DLLIST_INSERT_AFTER ( & tc - > entries , b , c , list ) ;