Index: tests/.expect/alloc.txt
===================================================================
--- tests/.expect/alloc.txt	(revision d0a00a5acab80e606b4d6c089cdfddf9d565bc4e)
+++ tests/.expect/alloc.txt	(revision 116a2ead213b741d89ecb016dba4e1dd7d9b6e6a)
@@ -35,4 +35,10 @@
 CFA realloc array alloc, fill
 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 
+CFA realloc array alloc, 5
+0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 
+CFA realloc array alloc, 5
+0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 
+CFA realloc array alloc, 5
+0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 0x5 
 
 C   memalign 42 42.5
Index: tests/alloc.cfa
===================================================================
--- tests/alloc.cfa	(revision d0a00a5acab80e606b4d6c089cdfddf9d565bc4e)
+++ tests/alloc.cfa	(revision 116a2ead213b741d89ecb016dba4e1dd7d9b6e6a)
@@ -10,6 +10,6 @@
 // Created On       : Wed Feb  3 07:56:22 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Apr 18 17:13:52 2022
-// Update Count     : 433
+// Last Modified On : Fri Jul 29 10:57:02 2022
+// Update Count     : 436
 //
 
@@ -154,5 +154,5 @@
 	printf( "\n" );
 	// do not free
-#if 0 // FIX ME
+
 	ip = alloc( 5 * dim, ip`realloc, 5`fill );			// CFA realloc array alloc, 5
 	printf( "CFA realloc array alloc, 5\n" );
@@ -171,5 +171,5 @@
 	for ( i; 5 * dim ) { printf( "%#x ", ip[i] ); }
 	printf( "\n" );
-#endif // 0
+
 	free( ip );
 
Index: tests/alloc2.cfa
===================================================================
--- tests/alloc2.cfa	(revision d0a00a5acab80e606b4d6c089cdfddf9d565bc4e)
+++ tests/alloc2.cfa	(revision 116a2ead213b741d89ecb016dba4e1dd7d9b6e6a)
@@ -1,2 +1,3 @@
+#include <fstream.hfa>									// sout
 #include <malloc.h>										// malloc_usable_size
 #include <stdint.h>										// uintptr_t
@@ -4,5 +5,4 @@
 #include <string.h>										// memcmp
 
-int last_failed;
 int tests_total;
 int tests_failed;
@@ -13,98 +13,98 @@
 void test_base( void * ip, size_t size, size_t align ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total);
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = (malloc_size( ip ) == size) && (malloc_usable_size( ip ) >= size) && (malloc_alignment( ip ) == align) && ((uintptr_t)ip % align  == 0);
 	if ( ! passed ) {
-		printf( "failed test %3d: %4zu %4zu but got %4zu ( %3zu ) %4zu\n", tests_total, size, align, malloc_size( ip ), malloc_usable_size( ip ), malloc_alignment( ip ) );
+		sout | "base failed test" | tests_total | "ip" | ip | "size" | size | "align" | align | "but got size" | malloc_size( ip ) | "usable" | malloc_usable_size( ip ) | "align" | malloc_alignment( ip );
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total);
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_fill( void * ip_, size_t start, size_t end, char fill ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = true;
 	char * ip = (char *) ip_;
 	for ( i; start ~ end ) passed = passed && (ip[i] == fill);
 	if ( ! passed ) {
-		printf( "failed test %3d: fill C\n", tests_total );
+		sout | "fill1 failed test" | tests_total | "fill C";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_fill( void * ip_, size_t start, size_t end, int fill ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" tests_total;
 	bool passed = true;
 	int * ip = (int *)ip_;
-	for (i; start ~ end ) passed = passed && (ip[i] == fill);
+	for ( i; start ~ end ) passed = passed && (ip[i] == fill);
 	if ( ! passed ) {
-		printf( "failed test %3d: fill int\n", tests_total );
+		sout | "fill2 failed test" | tests_total | "fill int";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_fill( void * ip_, size_t start, size_t end, int * fill ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = memcmp((void*)((uintptr_t )ip_ + start ), (void*)fill, end ) == 0;
 	if ( ! passed ) {
-		printf( "failed test %3d: fill int A\n", tests_total );
+		sout | "fill3 failed test" | tests_total | "fill int A";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_fill( void * ip_, size_t start, size_t end, T1 fill ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = true;
 	T1 * ip = (T1 *) ip_;
 	for ( i; start ~ end ) passed = passed && (ip[i].data == fill.data );
 	if ( ! passed ) {
-		printf( "failed test %3d: fill T1\n", tests_total );
+		sout | "fill4 failed test" | tests_total | "fill T1";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_fill( void * ip_, size_t start, size_t end, T1 * fill ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = memcmp( (void*)((uintptr_t )ip_ + start ), (void*)fill, end ) == 0;
 	if ( ! passed ) {
-		printf( "failed test %3d: fill T1 A\n", tests_total );
+		sout | "fill5 failed test" | tests_total | "fill T1 A";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_use( int * ip, size_t dim ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = true;
 	for ( i; 0 ~ dim ) ip[i] = 0xdeadbeef;
 	for ( i; 0 ~ dim ) passed = passed &&  (ip[i] == 0xdeadbeef);
 	if ( ! passed ) {
-		printf( "failed test %3d: use int\n", tests_total );
+		sout | "use1 failed test" | tests_total | "use int";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
 void test_use( T1 * ip, size_t dim ) {
 	tests_total += 1;
-//	printf( "DEBUG: starting test %d\n", tests_total );
+	// sout | "DEBUG: starting test" | tests_total;
 	bool passed = true;
 	for ( i; 0 ~ dim ) ip[i].data = 0xdeadbeef;
 	for ( i; 0 ~ dim ) passed = passed &&  (ip[i].data == 0xdeadbeef);
 	if ( ! passed ) {
-		printf( "failed test %3d: use T1\n", tests_total );
+		sout | "use2 failed test" | tests_total | "use T1";
 		tests_failed += 1;
 	} // if
-//	printf( "DEBUG: done test %d\n", tests_total );
+	// sout | "DEBUG: done test" | tests_total;
 }
 
@@ -117,4 +117,5 @@
 	char FillC = 'a';
 	int * FillA = calloc( dim / 4 );
+
 	T1 FillT1 = { FillT };
 	T1 * FillT1A = (T1 *)(void *) malloc( (dim / 4) * sizeof(T1) );
@@ -129,5 +130,4 @@
 	// testing alloc
 
-	last_failed = -1;
 	tests_total = 0;
 	tests_failed = 0;
@@ -153,5 +153,5 @@
 	free( ip );
 
-	ip = alloc( ((double *)0p)`resize );
+	ip = alloc( 0p`resize );
 	test_base( ip, elemSize, libAlign );
 	test_use( ip, elemSize / elemSize );
@@ -495,12 +495,11 @@
 	free( ip );
 
-	if ( tests_failed == 0 ) printf( "PASSED alloc tests\n\n" );
-	else printf( "failed alloc tests : %d/%d\n\n", tests_failed, tests_total );
-
-	// testing alloc ( aligned struct )
+	if ( tests_failed == 0 ) sout | "PASSED alloc tests" | nl | nl;
+	else sout | "failed alloc tests :" | tests_failed | tests_total | nl | nl;
+
+	// testing alloc (aligned struct)
 
 	elemSize = sizeof(T1);
 	size = dim * elemSize;
-	last_failed = -1;
 	tests_total = 0;
 	tests_failed = 0;
@@ -868,8 +867,8 @@
 	free( t1p );
 
-	if ( tests_failed == 0) printf( "PASSED alloc tests (aligned struct)\n\n");
-	else printf( "failed alloc tests ( aligned struct ) : %d/%d\n\n", tests_failed, tests_total );
-
-	printf( "(if applicable) alignment error below indicates memory trashing caused by test_use.\n\n");
+	if ( tests_failed == 0) sout | "PASSED alloc tests (aligned struct)" | nl | nl;
+	else sout | "failed alloc tests ( aligned struct ) :" | tests_failed | tests_total | nl;
+
+	sout | "(if applicable) alignment error below indicates memory trashing caused by test_use." | nl | nl;
 	free( FillA );
 	free( FillT1A );
Index: tests/malloc.cfa
===================================================================
--- tests/malloc.cfa	(revision d0a00a5acab80e606b4d6c089cdfddf9d565bc4e)
+++ tests/malloc.cfa	(revision 116a2ead213b741d89ecb016dba4e1dd7d9b6e6a)
@@ -1,7 +1,5 @@
-#include <assert.h>
+#include <fstream.hfa>									// sout
 #include <malloc.h>										// malloc_usable_size
 #include <stdint.h>										// uintptr_t
-#include <stdlib.h>										// posix_memalign
-#include <fstream.hfa>
 #include <stdlib.hfa>									// access C malloc, realloc
 #include <unistd.h>										// getpagesize
@@ -10,318 +8,316 @@
 int tests_failed;
 size_t tAlign = 32;
-struct S1 { int d1; } __attribute__((aligned(32)));
+struct S1 { int data; } __attribute__(( aligned(32)));
 typedef struct S1 T1;
 
-void test_base( void * ip, size_t size, size_t align) {
+void test_base( void * ip, size_t size, size_t align ) {
 	tests_total += 1;
-	bool passed = (malloc_size(ip) == size) && (malloc_usable_size(ip) >= size) && (malloc_alignment(ip) == align) && ((uintptr_t)ip % align  == 0);
-	if (!passed) {
-		printf("failed test %2d: %4lu %4lu but got %4lu ( %3lu ) %4lu\n", tests_total, size, align, malloc_size(ip), malloc_usable_size(ip), malloc_alignment(ip));
+	bool passed = (malloc_size( ip ) == size) && (malloc_usable_size( ip ) >= size) && (malloc_alignment( ip ) == align) && ((uintptr_t)ip % align  == 0);
+	if ( ! passed ) {
+		sout | "base failed test" | tests_total | "ip" | ip | "size" | size | "align" | align | "but got size" | malloc_size( ip ) | "usable" | malloc_usable_size( ip ) | "align" | malloc_alignment( ip );
+		tests_failed += 1;
+	} // if
+}
+
+void test_fill( void * ip_, size_t start, size_t end, char fill ) {
+	tests_total += 1;
+	bool passed = true;
+	char * ip = (char *) ip_;
+	for ( i; start ~ end ) passed = passed && (ip[i] == fill);
+	if ( ! passed ) {
+		sout | "fill1 failed test" | tests_total | "fill C";
+		tests_failed += 1;
+	} // if
+}
+
+void test_use( void * ip_ ) {
+	tests_total += 1;
+	bool passed = true;
+	int * ip = (int *) ip_;
+	size_t size = malloc_size( ip );
+	for ( i; 0 ~ size ~ sizeof(int)) ip[i/sizeof(int)] = 0xdeadbeef;
+	for ( i; 0 ~ size ~ sizeof(int)) passed = passed && (ip[i / sizeof(int)] == 0xdeadbeef);
+	size_t usize = malloc_usable_size( ip );
+	for ( i; size ~ usize ~ sizeof(int)) ip[i / sizeof(int)] = -1;
+	for ( i; size ~ usize ~ sizeof(int)) passed = passed &&  (ip[i / sizeof(int)] == -1);
+	if ( ! passed ) {
+		sout | "failed test" | tests_total | "use";
 		tests_failed += 1;
 	}
 }
 
-void test_fill( void * ip_, size_t start, size_t end, char fill) {
-	tests_total += 1;
-	bool passed = true;
-	char * ip = (char *) ip_;
-	for (i; start ~ end) passed = passed && (ip[i] == fill);
-	if (!passed) {
-		printf("failed test %2d: fill\n", tests_total);
-		tests_failed += 1;
-	}
-}
-
-void test_use( void * ip_) {
-	tests_total += 1;
-	bool passed = true;
-	int * ip = (int *) ip_;
-	size_t size = malloc_size(ip);
-	for (i; 0 ~ size ~ sizeof(int)) ip[i/sizeof(int)] = 0xdeadbeef;
-	for (i; 0 ~ size ~ sizeof(int)) passed = passed &&  (ip[i/sizeof(int)] == 0xdeadbeef);
-	size_t usize = malloc_usable_size(ip);
-	for (i; size ~ usize ~ sizeof(int)) ip[i/sizeof(int)] = -1;
-	for (i; size ~ usize ~ sizeof(int)) passed = passed &&  (ip[i/sizeof(int)] == -1);
-	if (!passed) {
-		printf("failed test %2d: use\n", tests_total);
-		tests_failed += 1;
-	}
-}
-
 int main( void ) {
+	enum { dim = 8, align = 64, libAlign = libAlign() };
 	size_t elemSize = sizeof(int);
-	size_t dim = 8;
 	size_t size = dim * elemSize;
-	size_t align = 64;
-	const size_t libAlign = libAlign();
 	char fill = '\xde';
 	int * ip;
 	T1 * tp;
 
-	// testing C   malloc
+	// testing C malloc
 
 	tests_total = 0;
 	tests_failed = 0;
 
-	ip = (int *) (void *) malloc( size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aalloc( dim, elemSize );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aalloc( 0, elemSize );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aalloc( dim, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aalloc( 0, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	test_base(ip, size, libAlign);
-	test_fill(ip, 0, size, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( 0, elemSize );
-	test_base(ip, 0, libAlign);
-	test_fill(ip, 0, 0, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, 0 );
-	test_base(ip, 0, libAlign);
-	test_fill(ip, 0, 0, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( size );
-	ip = (int *) (void *) resize( (void *) ip, size / 4 );
-	test_base(ip, size / 4, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( size );
-	ip = (int *) (void *) resize( (void *) ip, size * 4 );
-	test_base(ip, size * 4, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( size );
-	ip = (int *) (void *) resize( (void *) ip, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) resize( NULL, size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) resize( 0p, size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, size / 4 );
-	test_base(ip, size / 4, libAlign);
-	test_fill(ip, 0, size / 4, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, size * 4 );
-	test_base(ip, size * 4, libAlign);
-	test_fill(ip, 0, size * 4, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) realloc( NULL, size  );
-	test_base(ip, size , libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) realloc( 0p, size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) memalign( align, size );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) memalign( align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) amemalign( align, dim, elemSize );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) amemalign( align, 0, elemSize );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) amemalign( align, dim, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) cmemalign( align, dim, elemSize );
-	test_base(ip, size, align);
-	test_fill(ip, 0, size, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) cmemalign( align, 0, elemSize );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) cmemalign( align, dim, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aligned_alloc( align, size );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aligned_alloc( align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	(int) posix_memalign( (void **) &ip, align, size );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
-
-	(int) posix_memalign( (void **) &ip, align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) valloc( size );
-	test_base(ip, size, getpagesize());
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) valloc( 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) pvalloc( getpagesize() * 3 / 2 );
-	test_base(ip, getpagesize() * 2, getpagesize());
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) pvalloc( 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( size );
-	ip = (int *) (void *) resize( (void *) ip, libAlign, size / 2 );
-	test_base(ip, size / 2, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) aligned_alloc( align, size );
-	ip = (int *) (void *) resize( (void *) ip, align, size / 2 );
-	test_base(ip, size / 2, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( size );
-	ip = (int *) (void *) resize( (void *) ip, align, size / 4 );
-	test_base(ip, size / 4, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) malloc( size );
-	ip = (int *) (void *) resize( (void *) ip, align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) resize( NULL, align, size );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) resize( 0p, align, size );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, libAlign, size / 2 );
-	test_base(ip, size / 2, libAlign);
-	test_fill(ip, 0, size / 2, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) cmemalign( align, dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, align, size / 2 );
-	test_base(ip, size / 2, align);
-	test_fill(ip, 0, size / 2, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, align, size / 4 );
-	test_base(ip, size / 4, align);
-	test_fill(ip, 0, size / 4, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, 0, size * 4 );
-	test_base(ip, size * 4, libAlign);
-	test_fill(ip, 0, size * 4, '\0');
-	test_use(ip);
-	free(ip);
-
-	ip = (int *) (void *) calloc( dim, elemSize );
-	ip = (int *) (void *) realloc( (void *) ip, align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	free( 0p ); // sanity check
-	free( NULL ); // sanity check
-
-	if (tests_failed == 0) printf("PASSED C malloc tests\n\n");
-	else printf("failed C malloc tests : %d/%d\n\n", tests_failed, tests_total);
+	ip = (int *)malloc( size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aalloc( dim, elemSize );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aalloc( 0, elemSize );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aalloc( dim, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aalloc( 0, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	test_base( ip, size, libAlign );
+	test_fill( ip, 0, size, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( 0, elemSize );
+	test_base( ip, 0, libAlign );
+	test_fill( ip, 0, 0, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, 0 );
+	test_base( ip, 0, libAlign );
+	test_fill( ip, 0, 0, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( size );
+	ip = (int *)resize( ip, size / 4 );
+	test_base( ip, size / 4, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( size );
+	ip = (int *)resize( ip, size * 4 );
+	test_base( ip, size * 4, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( size );
+	ip = (int *)resize( ip, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)resize( NULL, size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)resize( 0p, size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, size / 4 );
+	test_base( ip, size / 4, libAlign );
+	test_fill( ip, 0, size / 4, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, size * 4 );
+	test_base( ip, size * 4, libAlign );
+	test_fill( ip, 0, size * 4, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)realloc( NULL, size  );
+	test_base( ip, size , libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)realloc( 0p, size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)memalign( align, size );
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)memalign( align, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)amemalign( align, dim, elemSize );
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)amemalign( align, 0, elemSize );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)amemalign( align, dim, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)cmemalign( align, dim, elemSize );
+	test_base( ip, size, align );
+	test_fill( ip, 0, size, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)cmemalign( align, 0, elemSize );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)cmemalign( align, dim, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aligned_alloc( align, size );
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aligned_alloc( align, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	posix_memalign( (void **) &ip, align, size );
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
+
+	posix_memalign( (void **) &ip, align, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)valloc( size );
+	test_base( ip, size, getpagesize() );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)valloc( 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)pvalloc( getpagesize() * 3 / 2 );
+	test_base( ip, getpagesize() * 2, getpagesize() );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)pvalloc( 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( size );
+	ip = (int *)resize( ip, libAlign, size / 2 );
+	test_base( ip, size / 2, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)aligned_alloc( align, size );
+	ip = (int *)resize( ip, align, size / 2 );
+	test_base( ip, size / 2, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( size );
+	ip = (int *)resize( ip, align, size / 4 );
+	test_base( ip, size / 4, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)malloc( size );
+	ip = (int *)resize( ip, align, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)resize( NULL, align, size );
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)resize( 0p, align, size );
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, libAlign, size / 2 );
+	test_base( ip, size / 2, libAlign );
+	test_fill( ip, 0, size / 2, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)cmemalign( align, dim, elemSize );
+	ip = (int *)realloc( ip, align, size / 2 );
+	test_base( ip, size / 2, align );
+	test_fill( ip, 0, size / 2, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, align, size / 4 );
+	test_base( ip, size / 4, align );
+	test_fill( ip, 0, size / 4, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, libAlign, size * 4 );
+	test_base( ip, size * 4, libAlign );
+	test_fill( ip, 0, size * 4, '\0' );
+	test_use( ip );
+	free( ip );
+
+	ip = (int *)calloc( dim, elemSize );
+	ip = (int *)realloc( ip, align, 0 );
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	free( 0p );											// sanity check
+	free( NULL );										// sanity check
+
+	if (tests_failed == 0) sout | "PASSED C malloc tests" | nl | nl;
+	else sout | "failed C malloc tests" | tests_failed | tests_total | nl | nl;
 
 	// testing CFA malloc
@@ -331,135 +327,135 @@
 
 	ip = malloc();
-	test_base(ip, elemSize, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, elemSize, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = aalloc( dim );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = aalloc( 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = calloc( dim );
-	test_base(ip, size, libAlign);
-	test_fill(ip, 0, size, '\0');
-	test_use(ip);
-	free(ip);
+	test_base( ip, size, libAlign );
+	test_fill( ip, 0, size, '\0' );
+	test_use( ip );
+	free( ip );
 
 	ip = calloc( 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = aalloc( dim );
 	ip = resize( ip, size / 4 );
-	test_base(ip, size / 4, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, size / 4, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = aalloc( dim );
 	ip = resize( ip, size * 4 );
-	test_base(ip, size * 4, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, size * 4, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = aalloc( dim );
 	ip = resize( ip, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = resize( (int*)0p, size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = resize( (int*)0p, size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = resize( 0p, size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = resize( 0p, size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = calloc( dim );
 	ip = realloc( ip, size / 4 );
-	test_base(ip, size / 4, libAlign);
-	test_fill(ip, 0, size / 4, '\0');
-	test_use(ip);
-	free(ip);
+	test_base( ip, size / 4, libAlign );
+	test_fill( ip, 0, size / 4, '\0' );
+	test_use( ip );
+	free( ip );
 
 	ip = calloc( dim );
 	ip = realloc( ip, size * 4 );
-	test_base(ip, size * 4, libAlign);
-	test_fill(ip, 0, size, '\0');
-	test_use(ip);
-	free(ip);
+	test_base( ip, size * 4, libAlign );
+	test_fill( ip, 0, size, '\0' );
+	test_use( ip );
+	free( ip );
 
 	ip = calloc( dim );
 	ip = realloc( ip, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = realloc( (int*)0p, size );
-	test_base(ip, size , libAlign);
-	test_use(ip);
-	free(ip);
-
-	ip = realloc( (int*)0p, size );
-	test_base(ip, size, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = realloc( 0p, size );
+	test_base( ip, size , libAlign );
+	test_use( ip );
+	free( ip );
+
+	ip = realloc( 0p, size );
+	test_base( ip, size, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = memalign( align );
-	test_base(ip, elemSize, align);
-	test_use(ip);
-	free(ip);
+	test_base( ip, elemSize, align );
+	test_use( ip );
+	free( ip );
 
 	ip = amemalign( align, dim );
-	test_base(ip, size, align);
-	test_use(ip);
-	free(ip);
+	test_base( ip, size, align );
+	test_use( ip );
+	free( ip );
 
 	ip = amemalign( align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = cmemalign( align, dim );
-	test_base(ip, size, align);
-	test_fill(ip, 0, size, '\0');
-	test_use(ip);
-	free(ip);
+	test_base( ip, size, align );
+	test_fill( ip, 0, size, '\0' );
+	test_use( ip );
+	free( ip );
 
 	ip = cmemalign( align, 0 );
-	test_base(ip, 0, libAlign);
-	test_use(ip);
-	free(ip);
+	test_base( ip, 0, libAlign );
+	test_use( ip );
+	free( ip );
 
 	ip = aligned_alloc( align );
-	test_base(ip, elemSize, align);
-	test_use(ip);
-	free(ip);
-
-	(int) posix_memalign( (int **) &ip, align );
-	test_base(ip, elemSize, align);
-	test_use(ip);
-	free(ip);
+	test_base( ip, elemSize, align );
+	test_use( ip );
+	free( ip );
+
+	posix_memalign( (int **) &ip, align );
+	test_base( ip, elemSize, align );
+	test_use( ip );
+	free( ip );
 
 	ip = valloc();
-	test_base(ip, elemSize, getpagesize());
-	test_use(ip);
-	free(ip);
+	test_base( ip, elemSize, getpagesize() );
+	test_use( ip );
+	free( ip );
 
 	ip = pvalloc();
-	test_base(ip, getpagesize(), getpagesize());
-	test_use(ip);
-	free(ip);
-
-	if (tests_failed == 0) printf("PASSED CFA malloc tests\n\n");
-	else printf("failed CFA malloc tests : %d/%d\n\n", tests_failed, tests_total);
+	test_base( ip, getpagesize(), getpagesize() );
+	test_use( ip );
+	free( ip );
+
+	if (tests_failed == 0) sout | "PASSED CFA malloc tests" | nl | nl;
+	else sout | "failed CFA malloc tests" | tests_failed | tests_total | nl | nl;
 
 	// testing CFA malloc with aligned struct
@@ -471,137 +467,135 @@
 
 	tp = malloc();
-	test_base(tp, elemSize, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, elemSize, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = aalloc( dim );
-	test_base(tp, size, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = aalloc( 0 );
-	test_base(tp, 0, libAlign);
-	test_use(tp);
-	free(tp);
+	test_base( tp, 0, libAlign );
+	test_use( tp );
+	free( tp );
 
 	tp = calloc( dim );
-	test_base(tp, size, tAlign );
-	test_fill(tp, 0, size, '\0');
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, tAlign  );
+	test_fill( tp, 0, size, '\0' );
+	test_use( tp );
+	free( tp );
 
 	tp = calloc( 0 );
-	test_base(tp, 0, libAlign);
-	test_use(tp);
-	free(tp);
+	test_base( tp, 0, libAlign );
+	test_use( tp );
+	free( tp );
 
 	tp = aalloc( dim );
 	tp = resize( tp, size / 4 );
-	test_base(tp, size / 4, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size / 4, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = malloc();
 	tp = resize( tp, size * 4 );
-	test_base(tp, size * 4, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size * 4, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = aalloc( dim );
 	tp = resize( tp, 0 );
-	test_base(tp, 0, libAlign);
-	test_use(tp);
-	free(tp);
+	test_base( tp, 0, libAlign );
+	test_use( tp );
+	free( tp );
 
 	tp = resize( (T1*)0p, size );
-	test_base(tp, size, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = resize( (T1*)0p, size );
-	test_base(tp, size, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = calloc( dim );
 	tp = realloc( tp, size / 4 );
-	test_base(tp, size / 4, tAlign );
-	test_fill(tp, 0, size / 4, '\0');
-	test_use(tp);
-	free(tp);
+	test_base( tp, size / 4, tAlign  );
+	test_fill( tp, 0, size / 4, '\0' );
+	test_use( tp );
+	free( tp );
 
 	tp = calloc( dim );
 	tp = realloc( tp, size * 4 );
-	test_base(tp, size * 4, tAlign );
-	test_fill(tp, 0, size, '\0');
-	test_use(tp);
-	free(tp);
+	test_base( tp, size * 4, tAlign  );
+	test_fill( tp, 0, size, '\0' );
+	test_use( tp );
+	free( tp );
 
 	tp = calloc( dim );
 	tp = realloc( tp, 0 );
-	test_base(tp, 0, libAlign);
-	test_use(tp);
-	free(tp);
+	test_base( tp, 0, libAlign );
+	test_use( tp );
+	free( tp );
 
 	tp = realloc( (T1*)0p, size  );
-	test_base(tp, size , tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size , tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = realloc( (T1*)0p, size );
-	test_base(tp, size, tAlign );
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, tAlign  );
+	test_use( tp );
+	free( tp );
 
 	tp = memalign( align );
-	test_base(tp, elemSize, align);
-	test_use(tp);
-	free(tp);
+	test_base( tp, elemSize, align );
+	test_use( tp );
+	free( tp );
 
 	tp = amemalign( align, dim );
-	test_base(tp, size, align);
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, align );
+	test_use( tp );
+	free( tp );
 
 	tp = amemalign( align, 0 );
-	test_base(tp, 0, libAlign);
-	test_use(tp);
-	free(tp);
+	test_base( tp, 0, libAlign );
+	test_use( tp );
+	free( tp );
 
 	tp = cmemalign( align, dim );
-	test_base(tp, size, align);
-	test_fill(tp, 0, size, '\0');
-	test_use(tp);
-	free(tp);
+	test_base( tp, size, align );
+	test_fill( tp, 0, size, '\0' );
+	test_use( tp );
+	free( tp );
 
 	tp = cmemalign( align, 0 );
-	test_base(tp, 0, libAlign);
-	test_use(tp);
-	free(tp);
+	test_base( tp, 0, libAlign );
+	test_use( tp );
+	free( tp );
 
 	tp = aligned_alloc( align );
-	test_base(tp, elemSize, align);
-	test_use(tp);
-	free(tp);
-
-	(int) posix_memalign( (T1 **) &tp, align );
-	test_base(tp, elemSize, align);
-	test_use(tp);
-	free(tp);
+	test_base( tp, elemSize, align );
+	test_use( tp );
+	free( tp );
+
+	posix_memalign( (T1 **)&tp, align );
+	test_base( tp, elemSize, align );
+	test_use( tp );
+	free( tp );
 
 	tp = valloc();
-	test_base(tp, elemSize, getpagesize());
-	test_use(tp);
-	free(tp);
+	test_base( tp, elemSize, getpagesize() );
+	test_use( tp );
+	free( tp );
 
 	tp = pvalloc();
-	test_base(tp, getpagesize(), getpagesize());
-	test_use(tp);
-	free(tp);
-
-	if (tests_failed == 0) printf("PASSED CFA malloc tests (aligned struct)\n\n");
-	else printf("failed CFA malloc tests (aligned struct) : %d/%d\n\n", tests_failed, tests_total);
-
-	return 0;
+	test_base( tp, getpagesize(), getpagesize() );
+	test_use( tp );
+	free( tp );
+
+	if ( tests_failed == 0 ) sout | "PASSED CFA malloc tests (aligned struct)" | nl | nl;
+	else sout | "failed CFA malloc tests (aligned struct)" | tests_failed | tests_total | nl | nl;
 }
 
