aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-08-09 13:59:47 +0200
committerThomas White <taw@physics.org>2019-08-16 10:27:00 +0200
commit88b2fdfb4a43c6cb9104b9d9dd9b63d422846d0a (patch)
tree1fd50f59a19988162fb479fd9af1a1acd22289e8 /tests
parent41d5529aa1a6ef6c29c59d4c39767de61c57df12 (diff)
Pass transformation matrix for debugging
Diffstat (limited to 'tests')
-rw-r--r--tests/cellcompare_check.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/cellcompare_check.c b/tests/cellcompare_check.c
index b3810378..44ba9307 100644
--- a/tests/cellcompare_check.c
+++ b/tests/cellcompare_check.c
@@ -180,7 +180,7 @@ static int check_cpcpao(UnitCell *cell, UnitCell *cref, double *tols,
static int check_crcp(UnitCell *cell, UnitCell *cref, double *tols,
- int should_match)
+ RationalMatrix *tr, int should_match)
{
RationalMatrix *m = NULL;
const char *a;
@@ -189,9 +189,14 @@ static int check_crcp(UnitCell *cell, UnitCell *cref, double *tols,
a = should_match ? "" : "NOT ";
b = " with compare_reindexed_cell_parameters";
- if ( compare_reindexed_cell_parameters(cell, cref, tols, 0, &m) != should_match )
+ if ( compare_reindexed_cell_parameters(cref, cell, tols, 1, &m) != should_match )
{
complain(cell, cref, a, b);
+ STATUS("The transformation matrix to create the cell was:\n");
+ rtnl_mtx_print(tr);
+ STATUS("Cell comparison says do this to the reference to "
+ "create the cell:\n");
+ rtnl_mtx_print(m);
rtnl_mtx_free(m);
return 1;
}
@@ -227,7 +232,7 @@ int main(int argc, char *argv[])
if ( check_cpcp(cell, cref, tols, 1) ) return 1;
if ( check_ccpao(cell, cref, tols, 0) ) return 1;
if ( check_cpcpao(cell, cref, tols, 0) ) return 1;
- if ( check_crcp(cell, cref, tols, 1) ) return 1;
+ if ( check_crcp(cell, cref, tols, NULL, 1) ) return 1;
cell_free(cell);
}
@@ -245,7 +250,7 @@ int main(int argc, char *argv[])
if ( check_cpcp(cell, cref, tols, 1) ) return 1;
if ( check_ccpao(cell, cref, tols, intmat_is_identity(tr)) ) return 1;
if ( check_cpcpao(cell, cref, tols, 1) ) return 1;
- if ( check_crcp(cell, cref, tols, 1) ) return 1;
+ if ( check_crcp(cell, cref, tols, NULL, 1) ) return 1;
cell_free(cell);
intmat_free(tr);
@@ -269,7 +274,7 @@ int main(int argc, char *argv[])
if ( check_cpcp(cell, cref, tols, 1) ) return 1;
if ( check_ccpao(cell, cref, tols, 0) ) return 1;
if ( check_cpcpao(cell, cref, tols, 0) ) return 1;
- if ( check_crcp(cell, cref, tols, 1) ) return 1;
+ if ( check_crcp(cell, cref, tols, NULL, 1) ) return 1;
cell_free(cell);
intmat_free(tr);
@@ -294,7 +299,7 @@ int main(int argc, char *argv[])
if ( check_cpcp(cell, cref, tols, rtnl_mtx_is_perm(tr)) ) return 1;
if ( check_ccpao(cell, cref, tols, rtnl_mtx_is_identity(tr)) ) return 1;
if ( check_cpcpao(cell, cref, tols, rtnl_mtx_is_perm(tr)) ) return 1;
- if ( check_crcp(cell, cref, tols, 1) ) return 1;
+ if ( check_crcp(cell, cref, tols, tr, 1) ) return 1;
cell_free(cell);
rtnl_mtx_free(tr);
@@ -324,7 +329,7 @@ int main(int argc, char *argv[])
if ( check_cpcp(cell, cref, tols, rtnl_mtx_is_perm(tr)) ) return 1;
if ( check_ccpao(cell, cref, tols, 0) ) return 1;
if ( check_cpcpao(cell, cref, tols, 0) ) return 1;
- if ( check_crcp(cell, cref, tols, 1) ) return 1;
+ if ( check_crcp(cell, cref, tols, tr, 1) ) return 1;
cell_free(cell);
rtnl_mtx_free(tr);