Index: tests/.expect/alloc2.txt
===================================================================
--- tests/.expect/alloc2.txt	(revision 447b0d2b78a565216fda1aae8b888fe3bc1640be)
+++ tests/.expect/alloc2.txt	(revision 447b0d2b78a565216fda1aae8b888fe3bc1640be)
@@ -0,0 +1,6 @@
+PASSED alloc tests
+
+PASSED alloc tests (aligned struct)
+
+(if applicable) alignment error below indicates memory trashing caused by test_use.
+
Index: tests/alloc2.cfa
===================================================================
--- tests/alloc2.cfa	(revision 4bc27c03d9f04802e4c9ca0b6c465377c0ed8763)
+++ tests/alloc2.cfa	(revision 447b0d2b78a565216fda1aae8b888fe3bc1640be)
@@ -1,6 +1,2 @@
-/*
-	some tests are commented-out because of resize/realloc bug from 0p. They should be uncommented after that bug is resolved.
-*/
-
 #include <malloc.h>										// malloc_usable_size
 #include <stdint.h>										// uintptr_t
@@ -20,8 +16,5 @@
 	if (!passed) {
 		printf("failed test %3d: %4lu %4lu but got %4lu ( %3lu ) %4lu\n", tests_total, size, align, malloc_size(ip), malloc_usable_size(ip), malloc_alignment(ip));
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -34,8 +27,5 @@
 	if (!passed) {
 		printf("failed test %3d: fill C\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -48,8 +38,5 @@
 	if (!passed) {
 		printf("failed test %3d: fill int\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -60,8 +47,5 @@
 	if (!passed) {
 		printf("failed test %3d: fill int A\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -74,8 +58,5 @@
 	if (!passed) {
 		printf("failed test %3d: fill T1\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -86,8 +67,5 @@
 	if (!passed) {
 		printf("failed test %3d: fill T1 A\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -100,8 +78,5 @@
 	if (!passed) {
 		printf("failed test %3d: use int\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -114,8 +89,5 @@
 	if (!passed) {
 		printf("failed test %3d: use T1\n", tests_total);
-//		if (last_failed != tests_total) {
-			tests_failed += 1;
-//			last_failed = tests_total;
-//		}
+		tests_failed += 1;
 	}
 }
@@ -331,7 +303,7 @@
 	free(ip);
 
-//	ip = alloc( 0, ((int*)0p)`realloc, FillT`fill );
-//	est_base(ip, 0, libAlign);
-//	free(ip);
+	ip = alloc( 0, ((int*)0p)`realloc, FillT`fill );
+	test_base(ip, 0, libAlign);
+	free(ip);
 
 	ip = alloc( align`align );
@@ -356,8 +328,8 @@
 	free(ip);
 
-//	ip = alloc( ((int*)0p)`realloc, align`align );
-//	est_base(ip, elemSize, align);
-//	est_use(ip, elemSize / elemSize);
-//	free(ip);
+	ip = alloc( ((int*)0p)`realloc, align`align );
+	test_base(ip, elemSize, align);
+	test_use(ip, elemSize / elemSize);
+	free(ip);
 
 	dp = alloc( dim );
@@ -367,8 +339,8 @@
 	free(ip);
 
-//	ip = alloc( ((double*)0p)`resize, align`align );
-//	est_base(ip, elemSize, align);
-//	est_use(ip, elemSize / elemSize);
-//	free(ip);
+	ip = alloc( ((double*)0p)`resize, align`align );
+	test_base(ip, elemSize, align);
+	test_use(ip, elemSize / elemSize);
+	free(ip);
 
 	op = alloc( dim, ((int)0xdeadbeef)`fill);
@@ -384,12 +356,12 @@
 	free(ip);
 
-//	ip = alloc( dim, ((int*)0p)`realloc, align`align );
-//	est_base(ip, size, align);
-//	est_use(ip, size / elemSize);
-//	free(ip);
-
-//	ip = alloc( 0, ((int*)0p)`realloc, align`align );
-//	est_base(ip, 0, align);
-//	free(ip);
+	ip = alloc( dim, ((int*)0p)`realloc, align`align );
+	test_base(ip, size, align);
+	test_use(ip, size / elemSize);
+	free(ip);
+
+	ip = alloc( 0, ((int*)0p)`realloc, align`align );
+	test_base(ip, 0, libAlign);
+	free(ip);
 
 	ip = alloc( align`align, FillC`fill );
@@ -462,13 +434,13 @@
 	free(ip);
 
-//	ip = alloc( dim, ((int*)0p)`realloc, align`align, FillC`fill );
-//	est_base(ip, size, align);
-//	est_fill(ip, 0, size, FillC);
-//	est_use(ip, size / elemSize);
-//	free(ip);
-
-//	ip = alloc( 0, ((int*)0p)`realloc, align`align, FillC`fill );
-//	est_base(ip, 0, align);
-//	free(ip);
+	ip = alloc( dim, ((int*)0p)`realloc, align`align, FillC`fill );
+	test_base(ip, size, align);
+	test_fill(ip, 0, size, FillC);
+	test_use(ip, size / elemSize);
+	free(ip);
+
+	ip = alloc( 0, ((int*)0p)`realloc, align`align, FillC`fill );
+	test_base(ip, 0, libAlign);
+	free(ip);
 
 	op = alloc( dim, ((int)0xdeadbeef)`fill );
@@ -499,13 +471,13 @@
 	free(ip);
 
-//	ip = alloc( dim, ((int*)0p)`realloc, align`align, FillT`fill );
-//	est_base(ip, size, align);
-//	est_fill(ip, 0, dim, FillT);
-//	est_use(ip, size / elemSize);
-//	free(ip);
-
-//	ip = alloc( 0, ((int*)0p)`realloc, align`align, FillT`fill );
-//	est_base(ip, 0, align);
-//	free(ip);
+	ip = alloc( dim, ((int*)0p)`realloc, align`align, FillT`fill );
+	test_base(ip, size, align);
+	test_fill(ip, 0, dim, FillT);
+	test_use(ip, size / elemSize);
+	free(ip);
+
+	ip = alloc( 0, ((int*)0p)`realloc, align`align, FillT`fill );
+	test_base(ip, 0, libAlign);
+	free(ip);
 
 	if (tests_failed == 0) printf("PASSED alloc tests\n\n");
@@ -704,7 +676,7 @@
 	free(t1p);
 
-//	t1p = alloc( (T1*)0p, 0, FillT1 );
-//	est_base(t1p, 0, tAlign);
-//	free(t1p);
+	t1p = alloc( 0, ((T1*)0p)`realloc, FillT1`fill );
+	test_base(t1p, 0, libAlign);
+	free(t1p);
 
 	t1p = alloc( align`align );
@@ -729,8 +701,8 @@
 	free(t1p);
 
-//	t1p = alloc( ((T1*)0p)`realloc, align`align );
-//	est_base(t1p, elemSize, align);
-//	est_use(t1p, elemSize / elemSize);
-//	free(t1p);
+	t1p = alloc( ((T1*)0p)`realloc, align`align );
+	test_base(t1p, elemSize, align);
+	test_use(t1p, elemSize / elemSize);
+	free(t1p);
 
 	dp = alloc( dim );
@@ -740,8 +712,8 @@
 	free(t1p);
 
-//	t1p = alloc( ((double*)0p)`resize, align`align );
-//	est_base(t1p, elemSize, align);
-//	est_use(t1p, elemSize / elemSize);
-//	free(t1p);
+	t1p = alloc( ((double*)0p)`resize, align`align );
+	test_base(t1p, elemSize, align);
+	test_use(t1p, elemSize / elemSize);
+	free(t1p);
 
 	t1op = alloc( dim, ((T1){0xdeadbeef})`fill );
@@ -757,12 +729,12 @@
 	free(t1p);
 
-//	t1p = alloc( dim, ((T1*)0p)`realloc, align`align );
-//	est_base(t1p, size, align);
-//	est_use(t1p, size / elemSize);
-//	free(t1p);
-
-//	t1p = alloc( 0, ((T1*)0p)`realloc, align`align );
-//	est_base(t1p, 0, align);
-//	free(t1p);
+	t1p = alloc( dim, ((T1*)0p)`realloc, align`align );
+	test_base(t1p, size, align);
+	test_use(t1p, size / elemSize);
+	free(t1p);
+
+	t1p = alloc( 0, ((T1*)0p)`realloc, align`align );
+	test_base(t1p, 0, libAlign);
+	free(t1p);
 
 	t1p = alloc( align`align, FillC`fill );
@@ -835,13 +807,13 @@
 	free(t1p);
 
-//	t1p = alloc( dim, ((T1*)0p)`realloc, align`align, FillC`fill );
-//	est_base(t1p, size, align);
-//	est_fill(t1p, 0, size, FillC);
-//	est_use(t1p, size / elemSize);
-//	free(t1p);
-
-//	t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillC`fill );
-//	est_base(t1p, 0, align);
-//	free(t1p);
+	t1p = alloc( dim, ((T1*)0p)`realloc, align`align, FillC`fill );
+	test_base(t1p, size, align);
+	test_fill(t1p, 0, size, FillC);
+	test_use(t1p, size / elemSize);
+	free(t1p);
+
+	t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillC`fill );
+	test_base(t1p, 0, libAlign);
+	free(t1p);
 
 	t1op = alloc( dim, ((T1){0xdeadbeef})`fill);
@@ -872,13 +844,13 @@
 	free(t1p);
 
-//	t1p = alloc( dim, ((T1*)0p)`realloc, align`aling, FillT1`fill );
-//	est_base(t1p, size, align);
-//	est_fill(t1p, 0, dim, FillT1);
-//	est_use(t1p, size / elemSize);
-//	free(t1p);
-
-//	t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillT1`fill );
-//	est_base(t1p, 0, align);
-//	free(t1p);
+	t1p = alloc( dim, ((T1*)0p)`realloc, align`align, FillT1`fill );
+	test_base(t1p, size, align);
+	test_fill(t1p, 0, dim, FillT1);
+	test_use(t1p, size / elemSize);
+	free(t1p);
+
+	t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillT1`fill );
+	test_base(t1p, 0, libAlign);
+	free(t1p);
 
 	if (tests_failed == 0) printf("PASSED alloc tests (aligned struct)\n\n");
Index: tests/malloc.cfa
===================================================================
--- tests/malloc.cfa	(revision 4bc27c03d9f04802e4c9ca0b6c465377c0ed8763)
+++ tests/malloc.cfa	(revision 447b0d2b78a565216fda1aae8b888fe3bc1640be)
@@ -252,4 +252,16 @@
 
 	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);
@@ -270,4 +282,18 @@
 	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);
@@ -437,5 +463,5 @@
 	else printf("failed CFA malloc tests : %d/%d\n\n", tests_failed, tests_total);
 
-	// testing CFA malloc
+	// testing CFA malloc with aligned struct
 
 	elemSize = sizeof(T1);
@@ -518,15 +544,13 @@
 	free(tp);
 
-/*
 	tp = realloc( (T1*)0p, size  );
-	est_base(tp, size , tAlign );
-	est_use(tp);
+	test_base(tp, size , tAlign );
+	test_use(tp);
 	free(tp);
 
 	tp = realloc( (T1*)0p, size );
-	est_base(tp, size, tAlign );
-	est_use(tp);
-	free(tp);
-*/
+	test_base(tp, size, tAlign );
+	test_use(tp);
+	free(tp);
 
 	tp = memalign( align );
