From 7d5453e30c18a59b27b486298c3589046adbc308 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 9 Mar 2019 11:39:37 +0100 Subject: tests/transformation_check: Tidy up and be louder --- tests/transformation_check.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'tests/transformation_check.c') diff --git a/tests/transformation_check.c b/tests/transformation_check.c index 06521061..ba189e4e 100644 --- a/tests/transformation_check.c +++ b/tests/transformation_check.c @@ -147,7 +147,8 @@ static int check_same_reflections(UnitCell *cell, UnitCell *cnew) if ( compare_rvecs(vecs, na, tvecs, nb) || compare_rvecs(tvecs, nb, vecs, na) ) { - ERROR("******* Transformed cell didn't predict the same reflections\n"); + ERROR("********************************************** "); + ERROR("Transformed cell didn't predict the same reflections\n"); //printf("---\n"); //for ( i=0; i Before transformation:\n"); @@ -188,6 +185,8 @@ static int check_transformation(UnitCell *cell, IntegerMatrix *tfn, intmat_print(tfn); STATUS("----> After transformation:\n"); cell_print(cnew); + STATUS("----> After back transformation:\n"); + cell_print(cback); if ( pred_test ) { check_same_reflections(cell, cnew); @@ -210,7 +209,8 @@ static int check_transformation(UnitCell *cell, IntegerMatrix *tfn, } if ( fail ) { - ERROR("******* Original cell not recovered after transformation:\n"); + ERROR("********************************************** "); + ERROR("Original cell not recovered after transformation:\n"); STATUS("----> After transformation and transformation back:\n"); cell_print(cback); } else { @@ -262,6 +262,7 @@ static int check_uncentering(UnitCell *cell) } if ( fail ) { + ERROR("********************************************** "); ERROR("Original cell not recovered after back transformation\n"); } @@ -305,6 +306,7 @@ static int check_identity(UnitCell *cell, IntegerMatrix *tfn) } if ( fail ) { + ERROR("********************************************** "); ERROR("Original cell not recovered after identity transformation:\n"); cell_print(cell); intmat_print(tfn); @@ -342,28 +344,28 @@ int main(int argc, char *argv[]) intmat_set_all_3x3(tfn, 0,1,0, 0,0,1, 1,0,0); - fail += check_transformation(cell, tfn, 1, NULL); + fail += check_transformation(cell, tfn, 1); /* Doubling of cell in one direction */ if ( tfn == NULL ) return 1; intmat_set_all_3x3(tfn, 2,0,0, 0,1,0, 0,0,1); - fail += check_transformation(cell, tfn, 0, NULL); + fail += check_transformation(cell, tfn, 0); /* Shearing */ if ( tfn == NULL ) return 1; intmat_set_all_3x3(tfn, 1,1,0, 0,1,0, 0,0,1); - fail += check_transformation(cell, tfn, 1, NULL); + fail += check_transformation(cell, tfn, 1); /* Crazy */ if ( tfn == NULL ) return 1; intmat_set_all_3x3(tfn, 1,1,0, 0,1,0, 0,1,1); - fail += check_transformation(cell, tfn, 0, NULL); + fail += check_transformation(cell, tfn, 0); /* Identity in two parts */ part1 = intmat_identity(3); -- cgit v1.2.3