From 270e5b0444f67781856bf80db51650af9cb89b0c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 17 Jul 2025 08:54:44 +0200 Subject: Renamed tests to make space for more coordinate tests --- test/080_allowedmoves/00_empty.in | 1 - test/080_allowedmoves/00_empty.out | 1 - test/080_allowedmoves/01_onemove.in | 2 - test/080_allowedmoves/01_onemove.out | 1 - test/080_allowedmoves/02_F_F2.in | 3 - test/080_allowedmoves/02_F_F2.out | 1 - test/080_allowedmoves/03_U_F.in | 3 - test/080_allowedmoves/03_U_F.out | 1 - test/080_allowedmoves/04_R_L_R.in | 4 - test/080_allowedmoves/04_R_L_R.out | 1 - test/080_allowedmoves/05_longer_true.in | 12 - test/080_allowedmoves/05_longer_true.out | 1 - test/080_allowedmoves/06_longer_false.in | 12 - test/080_allowedmoves/06_longer_false.out | 1 - test/080_allowedmoves/07_D_U_false_order.in | 3 - test/080_allowedmoves/07_D_U_false_order.out | 1 - test/080_allowedmoves/allowedmoves_tests.c | 31 --- test/081_getcube/00_solved_0.in | 4 - test/081_getcube/00_solved_0.out | 1 - test/081_getcube/02_scrambled.in | 4 - test/081_getcube/02_scrambled.out | 1 - test/081_getcube/getcube_tests.c | 32 --- test/090_allowedmoves/00_empty.in | 1 + test/090_allowedmoves/00_empty.out | 1 + test/090_allowedmoves/01_onemove.in | 2 + test/090_allowedmoves/01_onemove.out | 1 + test/090_allowedmoves/02_F_F2.in | 3 + test/090_allowedmoves/02_F_F2.out | 1 + test/090_allowedmoves/03_U_F.in | 3 + test/090_allowedmoves/03_U_F.out | 1 + test/090_allowedmoves/04_R_L_R.in | 4 + test/090_allowedmoves/04_R_L_R.out | 1 + test/090_allowedmoves/05_longer_true.in | 12 + test/090_allowedmoves/05_longer_true.out | 1 + test/090_allowedmoves/06_longer_false.in | 12 + test/090_allowedmoves/06_longer_false.out | 1 + test/090_allowedmoves/07_D_U_false_order.in | 3 + test/090_allowedmoves/07_D_U_false_order.out | 1 + test/090_allowedmoves/allowedmoves_tests.c | 31 +++ test/090_tables_readwrite/00_table.in | 35 --- test/090_tables_readwrite/00_table.out | 35 --- test/090_tables_readwrite/tables_readwrite_tests.c | 76 ------ test/091_getcube/00_solved_0.in | 4 + test/091_getcube/00_solved_0.out | 1 + test/091_getcube/02_scrambled.in | 4 + test/091_getcube/02_scrambled.out | 1 + test/091_getcube/getcube_tests.c | 32 +++ test/100_gendata_cocsep/00_all.in | 0 test/100_gendata_cocsep/00_all.out | 13 - test/100_gendata_cocsep/gendata_cocsep_tests.c | 27 -- test/100_tables_readwrite/00_table.in | 35 +++ test/100_tables_readwrite/00_table.out | 35 +++ test/100_tables_readwrite/tables_readwrite_tests.c | 76 ++++++ test/101_cocsep_transform_invariant/00_solved.in | 1 - test/101_cocsep_transform_invariant/00_solved.out | 0 test/101_cocsep_transform_invariant/01_U.in | 1 - test/101_cocsep_transform_invariant/01_U.out | 0 .../101_cocsep_transform_invariant/02_scrambled.in | 1 - .../02_scrambled.out | 0 .../cocsep_transform_invariant.c | 31 --- test/102_cocsep_selfsim/00_all.in | 2 - test/102_cocsep_selfsim/00_all.out | 2 - test/102_cocsep_selfsim/cocsep_selfsim_tests.c | 39 --- test/103_cocsep_selfsim_distribution/00_all.in | 0 test/103_cocsep_selfsim_distribution/00_all.out | 12 - .../cocsep_selfsim_distribution_tests.c | 38 --- test/104_cocsep_ttrep/00_all.in | 0 test/104_cocsep_ttrep/00_all.out | 0 test/104_cocsep_ttrep/cocsep_ttrep_tests.c | 34 --- test/105_gendata_eoesep/00_all.in | 0 test/105_gendata_eoesep/00_all.out | 9 - test/105_gendata_eoesep/gendata_eoesep_tests.c | 46 ---- test/110_coord_invcoord_h48/00_all.in | 8 - test/110_coord_invcoord_h48/00_all.out | 8 - .../coord_invcoord_h48_tests.c | 37 --- test/110_gendata_cocsep/00_all.in | 0 test/110_gendata_cocsep/00_all.out | 13 + test/110_gendata_cocsep/gendata_cocsep_tests.c | 27 ++ test/111_cocsep_transform_invariant/00_solved.in | 1 + test/111_cocsep_transform_invariant/00_solved.out | 0 test/111_cocsep_transform_invariant/01_U.in | 1 + test/111_cocsep_transform_invariant/01_U.out | 0 .../111_cocsep_transform_invariant/02_scrambled.in | 1 + .../02_scrambled.out | 0 .../cocsep_transform_invariant.c | 31 +++ test/111_h48map/00_small.in | 11 - test/111_h48map/00_small.out | 3 - test/111_h48map/01_large.in | 303 --------------------- test/111_h48map/01_large.out | 83 ------ test/111_h48map/h48map_tests.c | 70 ----- test/112_cocsep_selfsim/00_all.in | 2 + test/112_cocsep_selfsim/00_all.out | 2 + test/112_cocsep_selfsim/cocsep_selfsim_tests.c | 39 +++ test/112_gendata_h48short/00_depth_1.in | 28 -- test/112_gendata_h48short/00_depth_1.out | 3 - test/112_gendata_h48short/01_depth_3.in | 3 - test/112_gendata_h48short/01_depth_3.out | 40 --- test/112_gendata_h48short/gendata_h48short_tests.c | 61 ----- test/113_cocsep_selfsim_distribution/00_all.in | 0 test/113_cocsep_selfsim_distribution/00_all.out | 12 + .../cocsep_selfsim_distribution_tests.c | 38 +++ test/114_cocsep_ttrep/00_all.in | 0 test/114_cocsep_ttrep/00_all.out | 0 test/114_cocsep_ttrep/cocsep_ttrep_tests.c | 34 +++ test/115_gendata_eoesep/00_all.in | 0 test/115_gendata_eoesep/00_all.out | 9 + test/115_gendata_eoesep/gendata_eoesep_tests.c | 46 ++++ test/120_coord_invcoord_h48/00_all.in | 8 + test/120_coord_invcoord_h48/00_all.out | 8 + .../coord_invcoord_h48_tests.c | 37 +++ test/120_gendata_eo/00_all.in | 0 test/120_gendata_eo/00_all.out | 12 - test/120_gendata_eo/gendata_eo_tests.c | 38 --- test/121_coorddata_dr/00_all.in | 0 test/121_coorddata_dr/00_all.out | 1 - test/121_coorddata_dr/coorddata_dr.c | 61 ----- test/121_h48map/00_small.in | 11 + test/121_h48map/00_small.out | 3 + test/121_h48map/01_large.in | 303 +++++++++++++++++++++ test/121_h48map/01_large.out | 83 ++++++ test/121_h48map/h48map_tests.c | 70 +++++ test/122_coorddata_dreo/00_all.in | 0 test/122_coorddata_dreo/00_all.out | 1 - test/122_coorddata_dreo/coorddata_dreo.c | 61 ----- test/122_gendata_h48short/00_depth_1.in | 28 ++ test/122_gendata_h48short/00_depth_1.out | 3 + test/122_gendata_h48short/01_depth_3.in | 3 + test/122_gendata_h48short/01_depth_3.out | 40 +++ test/122_gendata_h48short/gendata_h48short_tests.c | 61 +++++ test/130_appendsolution/00_empty.in | 5 - test/130_appendsolution/00_empty.out | 4 - .../01_simple_onlynormal_nounniss.in | 5 - .../01_simple_onlynormal_nounniss.out | 4 - .../02_simple_onlynormal_nounnis_multitrans.in | 8 - .../02_simple_onlynormal_nounnis_multitrans.out | 7 - test/130_appendsolution/03_simple_unniss.in | 5 - test/130_appendsolution/03_simple_unniss.out | 4 - test/130_appendsolution/04_niss_nounniss.in | 5 - test/130_appendsolution/04_niss_nounniss.out | 4 - test/130_appendsolution/05_sort_parallel.in | 5 - test/130_appendsolution/05_sort_parallel.out | 4 - test/130_appendsolution/06_unniss_trans_sort.in | 5 - test/130_appendsolution/06_unniss_trans_sort.out | 4 - test/130_appendsolution/07_unniss_cancel_nosol.in | 5 - test/130_appendsolution/07_unniss_cancel_nosol.out | 3 - .../08_unniss_cancel_nosol_v2.in | 5 - .../08_unniss_cancel_nosol_v2.out | 3 - test/130_appendsolution/09_fullinverse_niss.in | 5 - test/130_appendsolution/09_fullinverse_niss.out | 4 - test/130_appendsolution/10_rotated.in | 5 - test/130_appendsolution/10_rotated.out | 4 - test/130_appendsolution/appendsolution_tests.c | 68 ----- test/130_gendata_eo/00_all.in | 0 test/130_gendata_eo/00_all.out | 12 + test/130_gendata_eo/gendata_eo_tests.c | 38 +++ test/131_coorddata_dr/00_all.in | 0 test/131_coorddata_dr/00_all.out | 1 + test/131_coorddata_dr/coorddata_dr.c | 61 +++++ test/132_coorddata_dreo/00_all.in | 0 test/132_coorddata_dreo/00_all.out | 1 + test/132_coorddata_dreo/coorddata_dreo.c | 61 +++++ test/140_appendsolution/00_empty.in | 5 + test/140_appendsolution/00_empty.out | 4 + .../01_simple_onlynormal_nounniss.in | 5 + .../01_simple_onlynormal_nounniss.out | 4 + .../02_simple_onlynormal_nounnis_multitrans.in | 8 + .../02_simple_onlynormal_nounnis_multitrans.out | 7 + test/140_appendsolution/03_simple_unniss.in | 5 + test/140_appendsolution/03_simple_unniss.out | 4 + test/140_appendsolution/04_niss_nounniss.in | 5 + test/140_appendsolution/04_niss_nounniss.out | 4 + test/140_appendsolution/05_sort_parallel.in | 5 + test/140_appendsolution/05_sort_parallel.out | 4 + test/140_appendsolution/06_unniss_trans_sort.in | 5 + test/140_appendsolution/06_unniss_trans_sort.out | 4 + test/140_appendsolution/07_unniss_cancel_nosol.in | 5 + test/140_appendsolution/07_unniss_cancel_nosol.out | 3 + .../08_unniss_cancel_nosol_v2.in | 5 + .../08_unniss_cancel_nosol_v2.out | 3 + test/140_appendsolution/09_fullinverse_niss.in | 5 + test/140_appendsolution/09_fullinverse_niss.out | 4 + test/140_appendsolution/10_rotated.in | 5 + test/140_appendsolution/10_rotated.out | 4 + test/140_appendsolution/appendsolution_tests.c | 68 +++++ 184 files changed, 1526 insertions(+), 1526 deletions(-) delete mode 100644 test/080_allowedmoves/00_empty.in delete mode 100644 test/080_allowedmoves/00_empty.out delete mode 100644 test/080_allowedmoves/01_onemove.in delete mode 100644 test/080_allowedmoves/01_onemove.out delete mode 100644 test/080_allowedmoves/02_F_F2.in delete mode 100644 test/080_allowedmoves/02_F_F2.out delete mode 100644 test/080_allowedmoves/03_U_F.in delete mode 100644 test/080_allowedmoves/03_U_F.out delete mode 100644 test/080_allowedmoves/04_R_L_R.in delete mode 100644 test/080_allowedmoves/04_R_L_R.out delete mode 100644 test/080_allowedmoves/05_longer_true.in delete mode 100644 test/080_allowedmoves/05_longer_true.out delete mode 100644 test/080_allowedmoves/06_longer_false.in delete mode 100644 test/080_allowedmoves/06_longer_false.out delete mode 100644 test/080_allowedmoves/07_D_U_false_order.in delete mode 100644 test/080_allowedmoves/07_D_U_false_order.out delete mode 100644 test/080_allowedmoves/allowedmoves_tests.c delete mode 100644 test/081_getcube/00_solved_0.in delete mode 100644 test/081_getcube/00_solved_0.out delete mode 100644 test/081_getcube/02_scrambled.in delete mode 100644 test/081_getcube/02_scrambled.out delete mode 100644 test/081_getcube/getcube_tests.c create mode 100644 test/090_allowedmoves/00_empty.in create mode 100644 test/090_allowedmoves/00_empty.out create mode 100644 test/090_allowedmoves/01_onemove.in create mode 100644 test/090_allowedmoves/01_onemove.out create mode 100644 test/090_allowedmoves/02_F_F2.in create mode 100644 test/090_allowedmoves/02_F_F2.out create mode 100644 test/090_allowedmoves/03_U_F.in create mode 100644 test/090_allowedmoves/03_U_F.out create mode 100644 test/090_allowedmoves/04_R_L_R.in create mode 100644 test/090_allowedmoves/04_R_L_R.out create mode 100644 test/090_allowedmoves/05_longer_true.in create mode 100644 test/090_allowedmoves/05_longer_true.out create mode 100644 test/090_allowedmoves/06_longer_false.in create mode 100644 test/090_allowedmoves/06_longer_false.out create mode 100644 test/090_allowedmoves/07_D_U_false_order.in create mode 100644 test/090_allowedmoves/07_D_U_false_order.out create mode 100644 test/090_allowedmoves/allowedmoves_tests.c delete mode 100644 test/090_tables_readwrite/00_table.in delete mode 100644 test/090_tables_readwrite/00_table.out delete mode 100644 test/090_tables_readwrite/tables_readwrite_tests.c create mode 100644 test/091_getcube/00_solved_0.in create mode 100644 test/091_getcube/00_solved_0.out create mode 100644 test/091_getcube/02_scrambled.in create mode 100644 test/091_getcube/02_scrambled.out create mode 100644 test/091_getcube/getcube_tests.c delete mode 100644 test/100_gendata_cocsep/00_all.in delete mode 100644 test/100_gendata_cocsep/00_all.out delete mode 100644 test/100_gendata_cocsep/gendata_cocsep_tests.c create mode 100644 test/100_tables_readwrite/00_table.in create mode 100644 test/100_tables_readwrite/00_table.out create mode 100644 test/100_tables_readwrite/tables_readwrite_tests.c delete mode 100644 test/101_cocsep_transform_invariant/00_solved.in delete mode 100644 test/101_cocsep_transform_invariant/00_solved.out delete mode 100644 test/101_cocsep_transform_invariant/01_U.in delete mode 100644 test/101_cocsep_transform_invariant/01_U.out delete mode 100644 test/101_cocsep_transform_invariant/02_scrambled.in delete mode 100644 test/101_cocsep_transform_invariant/02_scrambled.out delete mode 100644 test/101_cocsep_transform_invariant/cocsep_transform_invariant.c delete mode 100644 test/102_cocsep_selfsim/00_all.in delete mode 100644 test/102_cocsep_selfsim/00_all.out delete mode 100644 test/102_cocsep_selfsim/cocsep_selfsim_tests.c delete mode 100644 test/103_cocsep_selfsim_distribution/00_all.in delete mode 100644 test/103_cocsep_selfsim_distribution/00_all.out delete mode 100644 test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c delete mode 100644 test/104_cocsep_ttrep/00_all.in delete mode 100644 test/104_cocsep_ttrep/00_all.out delete mode 100644 test/104_cocsep_ttrep/cocsep_ttrep_tests.c delete mode 100644 test/105_gendata_eoesep/00_all.in delete mode 100644 test/105_gendata_eoesep/00_all.out delete mode 100644 test/105_gendata_eoesep/gendata_eoesep_tests.c delete mode 100644 test/110_coord_invcoord_h48/00_all.in delete mode 100644 test/110_coord_invcoord_h48/00_all.out delete mode 100644 test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c create mode 100644 test/110_gendata_cocsep/00_all.in create mode 100644 test/110_gendata_cocsep/00_all.out create mode 100644 test/110_gendata_cocsep/gendata_cocsep_tests.c create mode 100644 test/111_cocsep_transform_invariant/00_solved.in create mode 100644 test/111_cocsep_transform_invariant/00_solved.out create mode 100644 test/111_cocsep_transform_invariant/01_U.in create mode 100644 test/111_cocsep_transform_invariant/01_U.out create mode 100644 test/111_cocsep_transform_invariant/02_scrambled.in create mode 100644 test/111_cocsep_transform_invariant/02_scrambled.out create mode 100644 test/111_cocsep_transform_invariant/cocsep_transform_invariant.c delete mode 100644 test/111_h48map/00_small.in delete mode 100644 test/111_h48map/00_small.out delete mode 100644 test/111_h48map/01_large.in delete mode 100644 test/111_h48map/01_large.out delete mode 100644 test/111_h48map/h48map_tests.c create mode 100644 test/112_cocsep_selfsim/00_all.in create mode 100644 test/112_cocsep_selfsim/00_all.out create mode 100644 test/112_cocsep_selfsim/cocsep_selfsim_tests.c delete mode 100644 test/112_gendata_h48short/00_depth_1.in delete mode 100644 test/112_gendata_h48short/00_depth_1.out delete mode 100644 test/112_gendata_h48short/01_depth_3.in delete mode 100644 test/112_gendata_h48short/01_depth_3.out delete mode 100644 test/112_gendata_h48short/gendata_h48short_tests.c create mode 100644 test/113_cocsep_selfsim_distribution/00_all.in create mode 100644 test/113_cocsep_selfsim_distribution/00_all.out create mode 100644 test/113_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c create mode 100644 test/114_cocsep_ttrep/00_all.in create mode 100644 test/114_cocsep_ttrep/00_all.out create mode 100644 test/114_cocsep_ttrep/cocsep_ttrep_tests.c create mode 100644 test/115_gendata_eoesep/00_all.in create mode 100644 test/115_gendata_eoesep/00_all.out create mode 100644 test/115_gendata_eoesep/gendata_eoesep_tests.c create mode 100644 test/120_coord_invcoord_h48/00_all.in create mode 100644 test/120_coord_invcoord_h48/00_all.out create mode 100644 test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c delete mode 100644 test/120_gendata_eo/00_all.in delete mode 100644 test/120_gendata_eo/00_all.out delete mode 100644 test/120_gendata_eo/gendata_eo_tests.c delete mode 100644 test/121_coorddata_dr/00_all.in delete mode 100644 test/121_coorddata_dr/00_all.out delete mode 100644 test/121_coorddata_dr/coorddata_dr.c create mode 100644 test/121_h48map/00_small.in create mode 100644 test/121_h48map/00_small.out create mode 100644 test/121_h48map/01_large.in create mode 100644 test/121_h48map/01_large.out create mode 100644 test/121_h48map/h48map_tests.c delete mode 100644 test/122_coorddata_dreo/00_all.in delete mode 100644 test/122_coorddata_dreo/00_all.out delete mode 100644 test/122_coorddata_dreo/coorddata_dreo.c create mode 100644 test/122_gendata_h48short/00_depth_1.in create mode 100644 test/122_gendata_h48short/00_depth_1.out create mode 100644 test/122_gendata_h48short/01_depth_3.in create mode 100644 test/122_gendata_h48short/01_depth_3.out create mode 100644 test/122_gendata_h48short/gendata_h48short_tests.c delete mode 100644 test/130_appendsolution/00_empty.in delete mode 100644 test/130_appendsolution/00_empty.out delete mode 100644 test/130_appendsolution/01_simple_onlynormal_nounniss.in delete mode 100644 test/130_appendsolution/01_simple_onlynormal_nounniss.out delete mode 100644 test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in delete mode 100644 test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.out delete mode 100644 test/130_appendsolution/03_simple_unniss.in delete mode 100644 test/130_appendsolution/03_simple_unniss.out delete mode 100644 test/130_appendsolution/04_niss_nounniss.in delete mode 100644 test/130_appendsolution/04_niss_nounniss.out delete mode 100644 test/130_appendsolution/05_sort_parallel.in delete mode 100644 test/130_appendsolution/05_sort_parallel.out delete mode 100644 test/130_appendsolution/06_unniss_trans_sort.in delete mode 100644 test/130_appendsolution/06_unniss_trans_sort.out delete mode 100644 test/130_appendsolution/07_unniss_cancel_nosol.in delete mode 100644 test/130_appendsolution/07_unniss_cancel_nosol.out delete mode 100644 test/130_appendsolution/08_unniss_cancel_nosol_v2.in delete mode 100644 test/130_appendsolution/08_unniss_cancel_nosol_v2.out delete mode 100644 test/130_appendsolution/09_fullinverse_niss.in delete mode 100644 test/130_appendsolution/09_fullinverse_niss.out delete mode 100644 test/130_appendsolution/10_rotated.in delete mode 100644 test/130_appendsolution/10_rotated.out delete mode 100644 test/130_appendsolution/appendsolution_tests.c create mode 100644 test/130_gendata_eo/00_all.in create mode 100644 test/130_gendata_eo/00_all.out create mode 100644 test/130_gendata_eo/gendata_eo_tests.c create mode 100644 test/131_coorddata_dr/00_all.in create mode 100644 test/131_coorddata_dr/00_all.out create mode 100644 test/131_coorddata_dr/coorddata_dr.c create mode 100644 test/132_coorddata_dreo/00_all.in create mode 100644 test/132_coorddata_dreo/00_all.out create mode 100644 test/132_coorddata_dreo/coorddata_dreo.c create mode 100644 test/140_appendsolution/00_empty.in create mode 100644 test/140_appendsolution/00_empty.out create mode 100644 test/140_appendsolution/01_simple_onlynormal_nounniss.in create mode 100644 test/140_appendsolution/01_simple_onlynormal_nounniss.out create mode 100644 test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.in create mode 100644 test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.out create mode 100644 test/140_appendsolution/03_simple_unniss.in create mode 100644 test/140_appendsolution/03_simple_unniss.out create mode 100644 test/140_appendsolution/04_niss_nounniss.in create mode 100644 test/140_appendsolution/04_niss_nounniss.out create mode 100644 test/140_appendsolution/05_sort_parallel.in create mode 100644 test/140_appendsolution/05_sort_parallel.out create mode 100644 test/140_appendsolution/06_unniss_trans_sort.in create mode 100644 test/140_appendsolution/06_unniss_trans_sort.out create mode 100644 test/140_appendsolution/07_unniss_cancel_nosol.in create mode 100644 test/140_appendsolution/07_unniss_cancel_nosol.out create mode 100644 test/140_appendsolution/08_unniss_cancel_nosol_v2.in create mode 100644 test/140_appendsolution/08_unniss_cancel_nosol_v2.out create mode 100644 test/140_appendsolution/09_fullinverse_niss.in create mode 100644 test/140_appendsolution/09_fullinverse_niss.out create mode 100644 test/140_appendsolution/10_rotated.in create mode 100644 test/140_appendsolution/10_rotated.out create mode 100644 test/140_appendsolution/appendsolution_tests.c diff --git a/test/080_allowedmoves/00_empty.in b/test/080_allowedmoves/00_empty.in deleted file mode 100644 index 573541a..0000000 --- a/test/080_allowedmoves/00_empty.in +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/test/080_allowedmoves/00_empty.out b/test/080_allowedmoves/00_empty.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowedmoves/00_empty.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/test/080_allowedmoves/01_onemove.in b/test/080_allowedmoves/01_onemove.in deleted file mode 100644 index aac8dac..0000000 --- a/test/080_allowedmoves/01_onemove.in +++ /dev/null @@ -1,2 +0,0 @@ -1 -B' diff --git a/test/080_allowedmoves/01_onemove.out b/test/080_allowedmoves/01_onemove.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowedmoves/01_onemove.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/test/080_allowedmoves/02_F_F2.in b/test/080_allowedmoves/02_F_F2.in deleted file mode 100644 index 93f0a9c..0000000 --- a/test/080_allowedmoves/02_F_F2.in +++ /dev/null @@ -1,3 +0,0 @@ -2 -F -F2 diff --git a/test/080_allowedmoves/02_F_F2.out b/test/080_allowedmoves/02_F_F2.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowedmoves/02_F_F2.out +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/080_allowedmoves/03_U_F.in b/test/080_allowedmoves/03_U_F.in deleted file mode 100644 index ad3607e..0000000 --- a/test/080_allowedmoves/03_U_F.in +++ /dev/null @@ -1,3 +0,0 @@ -2 -U -F diff --git a/test/080_allowedmoves/03_U_F.out b/test/080_allowedmoves/03_U_F.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowedmoves/03_U_F.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/test/080_allowedmoves/04_R_L_R.in b/test/080_allowedmoves/04_R_L_R.in deleted file mode 100644 index ffd9542..0000000 --- a/test/080_allowedmoves/04_R_L_R.in +++ /dev/null @@ -1,4 +0,0 @@ -3 -R -L' -R2 diff --git a/test/080_allowedmoves/04_R_L_R.out b/test/080_allowedmoves/04_R_L_R.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowedmoves/04_R_L_R.out +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/080_allowedmoves/05_longer_true.in b/test/080_allowedmoves/05_longer_true.in deleted file mode 100644 index 1d9999c..0000000 --- a/test/080_allowedmoves/05_longer_true.in +++ /dev/null @@ -1,12 +0,0 @@ -11 -F2 -B -U -D' -R -L2 -F -U' -D -F -L diff --git a/test/080_allowedmoves/05_longer_true.out b/test/080_allowedmoves/05_longer_true.out deleted file mode 100644 index 27ba77d..0000000 --- a/test/080_allowedmoves/05_longer_true.out +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/test/080_allowedmoves/06_longer_false.in b/test/080_allowedmoves/06_longer_false.in deleted file mode 100644 index 00fe94f..0000000 --- a/test/080_allowedmoves/06_longer_false.in +++ /dev/null @@ -1,12 +0,0 @@ -8 -D -F' -B2 -L' -F' -R' -L2 -R -B -U2 -D diff --git a/test/080_allowedmoves/06_longer_false.out b/test/080_allowedmoves/06_longer_false.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowedmoves/06_longer_false.out +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/080_allowedmoves/07_D_U_false_order.in b/test/080_allowedmoves/07_D_U_false_order.in deleted file mode 100644 index 680d1a1..0000000 --- a/test/080_allowedmoves/07_D_U_false_order.in +++ /dev/null @@ -1,3 +0,0 @@ -2 -D -U diff --git a/test/080_allowedmoves/07_D_U_false_order.out b/test/080_allowedmoves/07_D_U_false_order.out deleted file mode 100644 index c508d53..0000000 --- a/test/080_allowedmoves/07_D_U_false_order.out +++ /dev/null @@ -1 +0,0 @@ -false diff --git a/test/080_allowedmoves/allowedmoves_tests.c b/test/080_allowedmoves/allowedmoves_tests.c deleted file mode 100644 index aa6bda7..0000000 --- a/test/080_allowedmoves/allowedmoves_tests.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "../test.h" - -bool allowedmoves(size_t n, const uint8_t [n]); - -static char *moves[] = { - "U", "U2", "U'", - "D", "D2", "D'", - "R", "R2", "R'", - "L", "L2", "L'", - "F", "F2", "F'", - "B", "B2", "B'", -}; - -void run(void) { - char movestr[STRLENMAX]; - uint8_t m[100]; - int n, i, j; - - fgets(movestr, STRLENMAX, stdin); - n = atoi(movestr); - - for (i = 0; i < n; i++) { - fgets(movestr, STRLENMAX, stdin); - movestr[strcspn(movestr, "\n")] = 0; - for (j = 0; j < 18; j++) - if (!strcmp(movestr, moves[j])) - m[i] = j; - } - - printf("%s\n", allowedmoves(n, m) ? "true" : "false"); -} diff --git a/test/081_getcube/00_solved_0.in b/test/081_getcube/00_solved_0.in deleted file mode 100644 index 44e0be8..0000000 --- a/test/081_getcube/00_solved_0.in +++ /dev/null @@ -1,4 +0,0 @@ -0 -0 -0 -0 diff --git a/test/081_getcube/00_solved_0.out b/test/081_getcube/00_solved_0.out deleted file mode 100644 index 5aa6ba7..0000000 --- a/test/081_getcube/00_solved_0.out +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/081_getcube/02_scrambled.in b/test/081_getcube/02_scrambled.in deleted file mode 100644 index b24bfbf..0000000 --- a/test/081_getcube/02_scrambled.in +++ /dev/null @@ -1,4 +0,0 @@ -367124500 -450 -30807 -562 diff --git a/test/081_getcube/02_scrambled.out b/test/081_getcube/02_scrambled.out deleted file mode 100644 index 4dfa7b7..0000000 --- a/test/081_getcube/02_scrambled.out +++ /dev/null @@ -1 +0,0 @@ -OINUTCXB=JCRIEDAbVaGH=A diff --git a/test/081_getcube/getcube_tests.c b/test/081_getcube/getcube_tests.c deleted file mode 100644 index 07e621e..0000000 --- a/test/081_getcube/getcube_tests.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "../test.h" - -cube_t getcube(int64_t, int64_t, int64_t, int64_t); - -void run(void) { - char str[STRLENMAX]; - oriented_cube_t cube; - int64_t ep, eo, cp, co; - - fgets(str, STRLENMAX, stdin); - ep = atoll(str); - fgets(str, STRLENMAX, stdin); - eo = atoll(str); - fgets(str, STRLENMAX, stdin); - cp = atoll(str); - fgets(str, STRLENMAX, stdin); - co = atoll(str); - - cube = (oriented_cube_t) { - .cube = getcube(ep, eo, cp, co), - .orientation = 0 - }; - - if (iserror(cube)) { - printf("Error cube\n"); - } else if (!isconsistent(cube)) { - printf("Inconsistent cube\n"); - } else { - writecube(cube, NISSY_SIZE_CUBE, str); - printf("%s\n", str); - } -} diff --git a/test/090_allowedmoves/00_empty.in b/test/090_allowedmoves/00_empty.in new file mode 100644 index 0000000..573541a --- /dev/null +++ b/test/090_allowedmoves/00_empty.in @@ -0,0 +1 @@ +0 diff --git a/test/090_allowedmoves/00_empty.out b/test/090_allowedmoves/00_empty.out new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/test/090_allowedmoves/00_empty.out @@ -0,0 +1 @@ +true diff --git a/test/090_allowedmoves/01_onemove.in b/test/090_allowedmoves/01_onemove.in new file mode 100644 index 0000000..aac8dac --- /dev/null +++ b/test/090_allowedmoves/01_onemove.in @@ -0,0 +1,2 @@ +1 +B' diff --git a/test/090_allowedmoves/01_onemove.out b/test/090_allowedmoves/01_onemove.out new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/test/090_allowedmoves/01_onemove.out @@ -0,0 +1 @@ +true diff --git a/test/090_allowedmoves/02_F_F2.in b/test/090_allowedmoves/02_F_F2.in new file mode 100644 index 0000000..93f0a9c --- /dev/null +++ b/test/090_allowedmoves/02_F_F2.in @@ -0,0 +1,3 @@ +2 +F +F2 diff --git a/test/090_allowedmoves/02_F_F2.out b/test/090_allowedmoves/02_F_F2.out new file mode 100644 index 0000000..c508d53 --- /dev/null +++ b/test/090_allowedmoves/02_F_F2.out @@ -0,0 +1 @@ +false diff --git a/test/090_allowedmoves/03_U_F.in b/test/090_allowedmoves/03_U_F.in new file mode 100644 index 0000000..ad3607e --- /dev/null +++ b/test/090_allowedmoves/03_U_F.in @@ -0,0 +1,3 @@ +2 +U +F diff --git a/test/090_allowedmoves/03_U_F.out b/test/090_allowedmoves/03_U_F.out new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/test/090_allowedmoves/03_U_F.out @@ -0,0 +1 @@ +true diff --git a/test/090_allowedmoves/04_R_L_R.in b/test/090_allowedmoves/04_R_L_R.in new file mode 100644 index 0000000..ffd9542 --- /dev/null +++ b/test/090_allowedmoves/04_R_L_R.in @@ -0,0 +1,4 @@ +3 +R +L' +R2 diff --git a/test/090_allowedmoves/04_R_L_R.out b/test/090_allowedmoves/04_R_L_R.out new file mode 100644 index 0000000..c508d53 --- /dev/null +++ b/test/090_allowedmoves/04_R_L_R.out @@ -0,0 +1 @@ +false diff --git a/test/090_allowedmoves/05_longer_true.in b/test/090_allowedmoves/05_longer_true.in new file mode 100644 index 0000000..1d9999c --- /dev/null +++ b/test/090_allowedmoves/05_longer_true.in @@ -0,0 +1,12 @@ +11 +F2 +B +U +D' +R +L2 +F +U' +D +F +L diff --git a/test/090_allowedmoves/05_longer_true.out b/test/090_allowedmoves/05_longer_true.out new file mode 100644 index 0000000..27ba77d --- /dev/null +++ b/test/090_allowedmoves/05_longer_true.out @@ -0,0 +1 @@ +true diff --git a/test/090_allowedmoves/06_longer_false.in b/test/090_allowedmoves/06_longer_false.in new file mode 100644 index 0000000..00fe94f --- /dev/null +++ b/test/090_allowedmoves/06_longer_false.in @@ -0,0 +1,12 @@ +8 +D +F' +B2 +L' +F' +R' +L2 +R +B +U2 +D diff --git a/test/090_allowedmoves/06_longer_false.out b/test/090_allowedmoves/06_longer_false.out new file mode 100644 index 0000000..c508d53 --- /dev/null +++ b/test/090_allowedmoves/06_longer_false.out @@ -0,0 +1 @@ +false diff --git a/test/090_allowedmoves/07_D_U_false_order.in b/test/090_allowedmoves/07_D_U_false_order.in new file mode 100644 index 0000000..680d1a1 --- /dev/null +++ b/test/090_allowedmoves/07_D_U_false_order.in @@ -0,0 +1,3 @@ +2 +D +U diff --git a/test/090_allowedmoves/07_D_U_false_order.out b/test/090_allowedmoves/07_D_U_false_order.out new file mode 100644 index 0000000..c508d53 --- /dev/null +++ b/test/090_allowedmoves/07_D_U_false_order.out @@ -0,0 +1 @@ +false diff --git a/test/090_allowedmoves/allowedmoves_tests.c b/test/090_allowedmoves/allowedmoves_tests.c new file mode 100644 index 0000000..aa6bda7 --- /dev/null +++ b/test/090_allowedmoves/allowedmoves_tests.c @@ -0,0 +1,31 @@ +#include "../test.h" + +bool allowedmoves(size_t n, const uint8_t [n]); + +static char *moves[] = { + "U", "U2", "U'", + "D", "D2", "D'", + "R", "R2", "R'", + "L", "L2", "L'", + "F", "F2", "F'", + "B", "B2", "B'", +}; + +void run(void) { + char movestr[STRLENMAX]; + uint8_t m[100]; + int n, i, j; + + fgets(movestr, STRLENMAX, stdin); + n = atoi(movestr); + + for (i = 0; i < n; i++) { + fgets(movestr, STRLENMAX, stdin); + movestr[strcspn(movestr, "\n")] = 0; + for (j = 0; j < 18; j++) + if (!strcmp(movestr, moves[j])) + m[i] = j; + } + + printf("%s\n", allowedmoves(n, m) ? "true" : "false"); +} diff --git a/test/090_tables_readwrite/00_table.in b/test/090_tables_readwrite/00_table.in deleted file mode 100644 index 3c2da46..0000000 --- a/test/090_tables_readwrite/00_table.in +++ /dev/null @@ -1,35 +0,0 @@ -Test solver - -0 -512 -512 -12345678912345 -399999999998 -3393 -11 -2 -0 -20 -100000000512 - -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 diff --git a/test/090_tables_readwrite/00_table.out b/test/090_tables_readwrite/00_table.out deleted file mode 100644 index 3c2da46..0000000 --- a/test/090_tables_readwrite/00_table.out +++ /dev/null @@ -1,35 +0,0 @@ -Test solver - -0 -512 -512 -12345678912345 -399999999998 -3393 -11 -2 -0 -20 -100000000512 - -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 diff --git a/test/090_tables_readwrite/tables_readwrite_tests.c b/test/090_tables_readwrite/tables_readwrite_tests.c deleted file mode 100644 index 96a60bb..0000000 --- a/test/090_tables_readwrite/tables_readwrite_tests.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "../test.h" - -int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); -int64_t writetableinfo(const tableinfo_t *, size_t, unsigned char *); - -uint64_t readn(void) { - char str[STRLENMAX]; - - fgets(str, STRLENMAX, stdin); - return atoll(str); -} - -tableinfo_t test_readinfo(void) { - int i; - tableinfo_t ret; - char emptyline[2]; - - fgets(ret.solver, INFO_SOLVER_STRLEN, stdin); - for (i = 0; i < INFO_SOLVER_STRLEN; i++) - if (ret.solver[i] == '\n') - ret.solver[i] = 0; - - fgets(emptyline, 2, stdin); - - ret.type = readn(); - ret.infosize = readn(); - ret.fullsize = readn(); - ret.hash = readn(); - ret.entries = readn(); - ret.classes = readn(); - ret.h48h = (uint8_t)readn(); - ret.bits = (uint8_t)readn(); - ret.base = (uint8_t)readn(); - ret.maxvalue = (uint8_t)readn(); - ret.next = readn(); - - fgets(emptyline, 2, stdin); - - for (i = 0; i < INFO_DISTRIBUTION_LEN; i++) - ret.distribution[i] = readn(); - - return ret; -} - -void test_writeinfo(tableinfo_t info) { - int i; - - printf("%s\n", info.solver); - printf("\n"); - - printf("%" PRIu64 "\n", info.type); - printf("%" PRIu64 "\n", info.infosize); - printf("%" PRIu64 "\n", info.fullsize); - printf("%" PRIu64 "\n", info.hash); - printf("%" PRIu64 "\n", info.entries); - printf("%" PRIu64 "\n", info.classes); - printf("%" PRIu8 "\n", info.h48h); - printf("%" PRIu8 "\n", info.bits); - printf("%" PRIu8 "\n", info.base); - printf("%" PRIu8 "\n", info.maxvalue); - printf("%" PRIu64 "\n", info.next); - printf("\n"); - - for (i = 0; i < INFO_DISTRIBUTION_LEN; i++) - printf("%" PRIu64 "\n", info.distribution[i]); -} - -void run(void) { - unsigned char buf[INFOSIZE]; - tableinfo_t expected, actual; - - expected = test_readinfo(); - writetableinfo(&expected, INFOSIZE, buf); - readtableinfo(INFOSIZE, buf, &actual); - test_writeinfo(actual); -} diff --git a/test/091_getcube/00_solved_0.in b/test/091_getcube/00_solved_0.in new file mode 100644 index 0000000..44e0be8 --- /dev/null +++ b/test/091_getcube/00_solved_0.in @@ -0,0 +1,4 @@ +0 +0 +0 +0 diff --git a/test/091_getcube/00_solved_0.out b/test/091_getcube/00_solved_0.out new file mode 100644 index 0000000..5aa6ba7 --- /dev/null +++ b/test/091_getcube/00_solved_0.out @@ -0,0 +1 @@ +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/091_getcube/02_scrambled.in b/test/091_getcube/02_scrambled.in new file mode 100644 index 0000000..b24bfbf --- /dev/null +++ b/test/091_getcube/02_scrambled.in @@ -0,0 +1,4 @@ +367124500 +450 +30807 +562 diff --git a/test/091_getcube/02_scrambled.out b/test/091_getcube/02_scrambled.out new file mode 100644 index 0000000..4dfa7b7 --- /dev/null +++ b/test/091_getcube/02_scrambled.out @@ -0,0 +1 @@ +OINUTCXB=JCRIEDAbVaGH=A diff --git a/test/091_getcube/getcube_tests.c b/test/091_getcube/getcube_tests.c new file mode 100644 index 0000000..07e621e --- /dev/null +++ b/test/091_getcube/getcube_tests.c @@ -0,0 +1,32 @@ +#include "../test.h" + +cube_t getcube(int64_t, int64_t, int64_t, int64_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t cube; + int64_t ep, eo, cp, co; + + fgets(str, STRLENMAX, stdin); + ep = atoll(str); + fgets(str, STRLENMAX, stdin); + eo = atoll(str); + fgets(str, STRLENMAX, stdin); + cp = atoll(str); + fgets(str, STRLENMAX, stdin); + co = atoll(str); + + cube = (oriented_cube_t) { + .cube = getcube(ep, eo, cp, co), + .orientation = 0 + }; + + if (iserror(cube)) { + printf("Error cube\n"); + } else if (!isconsistent(cube)) { + printf("Inconsistent cube\n"); + } else { + writecube(cube, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} diff --git a/test/100_gendata_cocsep/00_all.in b/test/100_gendata_cocsep/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/100_gendata_cocsep/00_all.out b/test/100_gendata_cocsep/00_all.out deleted file mode 100644 index 82eb6c2..0000000 --- a/test/100_gendata_cocsep/00_all.out +++ /dev/null @@ -1,13 +0,0 @@ -1120256 -Classes: 3393 -Max value: 9 -0: 1 -1: 6 -2: 63 -3: 468 -4: 3068 -5: 15438 -6: 53814 -7: 71352 -8: 8784 -9: 96 diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c deleted file mode 100644 index c1eef77..0000000 --- a/test/100_gendata_cocsep/gendata_cocsep_tests.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "../test.h" - -#define BUF_SIZE 2000000 - -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); - -void run(void) { - unsigned char buf[BUF_SIZE]; - uint32_t i; - uint64_t selfsim[COCSEP_CLASSES]; - cube_t rep[COCSEP_CLASSES]; - size_t result; - tableinfo_t info; - - result = gendata_cocsep(buf, selfsim, rep); - if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) { - printf("Error reading info from table\n"); - return; - } - - printf("%zu\n", result); - printf("Classes: %" PRIu64 "\n", info.classes); - printf("Max value: %" PRIu8 "\n", info.maxvalue); - for (i = 0; i < 10; i++) - printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); -} diff --git a/test/100_tables_readwrite/00_table.in b/test/100_tables_readwrite/00_table.in new file mode 100644 index 0000000..3c2da46 --- /dev/null +++ b/test/100_tables_readwrite/00_table.in @@ -0,0 +1,35 @@ +Test solver + +0 +512 +512 +12345678912345 +399999999998 +3393 +11 +2 +0 +20 +100000000512 + +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 diff --git a/test/100_tables_readwrite/00_table.out b/test/100_tables_readwrite/00_table.out new file mode 100644 index 0000000..3c2da46 --- /dev/null +++ b/test/100_tables_readwrite/00_table.out @@ -0,0 +1,35 @@ +Test solver + +0 +512 +512 +12345678912345 +399999999998 +3393 +11 +2 +0 +20 +100000000512 + +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 diff --git a/test/100_tables_readwrite/tables_readwrite_tests.c b/test/100_tables_readwrite/tables_readwrite_tests.c new file mode 100644 index 0000000..96a60bb --- /dev/null +++ b/test/100_tables_readwrite/tables_readwrite_tests.c @@ -0,0 +1,76 @@ +#include "../test.h" + +int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); +int64_t writetableinfo(const tableinfo_t *, size_t, unsigned char *); + +uint64_t readn(void) { + char str[STRLENMAX]; + + fgets(str, STRLENMAX, stdin); + return atoll(str); +} + +tableinfo_t test_readinfo(void) { + int i; + tableinfo_t ret; + char emptyline[2]; + + fgets(ret.solver, INFO_SOLVER_STRLEN, stdin); + for (i = 0; i < INFO_SOLVER_STRLEN; i++) + if (ret.solver[i] == '\n') + ret.solver[i] = 0; + + fgets(emptyline, 2, stdin); + + ret.type = readn(); + ret.infosize = readn(); + ret.fullsize = readn(); + ret.hash = readn(); + ret.entries = readn(); + ret.classes = readn(); + ret.h48h = (uint8_t)readn(); + ret.bits = (uint8_t)readn(); + ret.base = (uint8_t)readn(); + ret.maxvalue = (uint8_t)readn(); + ret.next = readn(); + + fgets(emptyline, 2, stdin); + + for (i = 0; i < INFO_DISTRIBUTION_LEN; i++) + ret.distribution[i] = readn(); + + return ret; +} + +void test_writeinfo(tableinfo_t info) { + int i; + + printf("%s\n", info.solver); + printf("\n"); + + printf("%" PRIu64 "\n", info.type); + printf("%" PRIu64 "\n", info.infosize); + printf("%" PRIu64 "\n", info.fullsize); + printf("%" PRIu64 "\n", info.hash); + printf("%" PRIu64 "\n", info.entries); + printf("%" PRIu64 "\n", info.classes); + printf("%" PRIu8 "\n", info.h48h); + printf("%" PRIu8 "\n", info.bits); + printf("%" PRIu8 "\n", info.base); + printf("%" PRIu8 "\n", info.maxvalue); + printf("%" PRIu64 "\n", info.next); + printf("\n"); + + for (i = 0; i < INFO_DISTRIBUTION_LEN; i++) + printf("%" PRIu64 "\n", info.distribution[i]); +} + +void run(void) { + unsigned char buf[INFOSIZE]; + tableinfo_t expected, actual; + + expected = test_readinfo(); + writetableinfo(&expected, INFOSIZE, buf); + readtableinfo(INFOSIZE, buf, &actual); + test_writeinfo(actual); +} diff --git a/test/101_cocsep_transform_invariant/00_solved.in b/test/101_cocsep_transform_invariant/00_solved.in deleted file mode 100644 index 5aa6ba7..0000000 --- a/test/101_cocsep_transform_invariant/00_solved.in +++ /dev/null @@ -1 +0,0 @@ -ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/101_cocsep_transform_invariant/00_solved.out b/test/101_cocsep_transform_invariant/00_solved.out deleted file mode 100644 index e69de29..0000000 diff --git a/test/101_cocsep_transform_invariant/01_U.in b/test/101_cocsep_transform_invariant/01_U.in deleted file mode 100644 index 250d3a1..0000000 --- a/test/101_cocsep_transform_invariant/01_U.in +++ /dev/null @@ -1 +0,0 @@ -FECDABGH=EFCDBAGHIJKL=A diff --git a/test/101_cocsep_transform_invariant/01_U.out b/test/101_cocsep_transform_invariant/01_U.out deleted file mode 100644 index e69de29..0000000 diff --git a/test/101_cocsep_transform_invariant/02_scrambled.in b/test/101_cocsep_transform_invariant/02_scrambled.in deleted file mode 100644 index 6bb8d86..0000000 --- a/test/101_cocsep_transform_invariant/02_scrambled.in +++ /dev/null @@ -1 +0,0 @@ -APDMOKRF=WLHUDZKFIASB=A diff --git a/test/101_cocsep_transform_invariant/02_scrambled.out b/test/101_cocsep_transform_invariant/02_scrambled.out deleted file mode 100644 index e69de29..0000000 diff --git a/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c b/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c deleted file mode 100644 index 5553fd1..0000000 --- a/test/101_cocsep_transform_invariant/cocsep_transform_invariant.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "../test.h" - -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -cube_t transform(cube_t, uint8_t); -int64_t coord_cocsep(cube_t); - -void run(void) { - uint8_t t; - unsigned char buf[2000000]; - uint32_t *cocsepdata; - uint64_t selfsim[COCSEP_CLASSES]; - int64_t coord, tcoord; - char str[STRLENMAX]; - oriented_cube_t cube; - cube_t rep[COCSEP_CLASSES], transd; - - fgets(str, STRLENMAX, stdin); - cube = readcube(str); - - gendata_cocsep(buf, selfsim, rep); - cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); - - coord = (int64_t)COCLASS(cocsepdata[coord_cocsep(cube.cube)]); - for (t = 0; t < 48; t++) { - transd = transform(cube.cube, t); - tcoord = (int64_t)COCLASS(cocsepdata[coord_cocsep(transd)]); - if (coord != tcoord) - printf("Error: expected %" PRId64 - " but got %" PRId64 "\n", coord, tcoord); - } -} diff --git a/test/102_cocsep_selfsim/00_all.in b/test/102_cocsep_selfsim/00_all.in deleted file mode 100644 index 5d0021c..0000000 --- a/test/102_cocsep_selfsim/00_all.in +++ /dev/null @@ -1,2 +0,0 @@ -ABCDEFGH=ABCDEFGHIJKL=A -WBCVEILH=ABCDIFGLHJKE=A diff --git a/test/102_cocsep_selfsim/00_all.out b/test/102_cocsep_selfsim/00_all.out deleted file mode 100644 index cc96363..0000000 --- a/test/102_cocsep_selfsim/00_all.out +++ /dev/null @@ -1,2 +0,0 @@ -0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 -0 1 2 3 24 25 26 27 diff --git a/test/102_cocsep_selfsim/cocsep_selfsim_tests.c b/test/102_cocsep_selfsim/cocsep_selfsim_tests.c deleted file mode 100644 index 1a1c6f2..0000000 --- a/test/102_cocsep_selfsim/cocsep_selfsim_tests.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This test is tricky, we only have two cases for now: the solved cube - * and the cube that is one quarter-turn-move off (all such cases are - * equivalent due to symmetry). Adding more tests requires figuring out - * by hand which one is the first position in its class to be reached. - * Note that the .out files need a space before each newline. - */ -#include "../test.h" - -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -int64_t coord_cocsep(cube_t); - -void run(void) { - char str[STRLENMAX]; - unsigned char buf[2000000]; - uint32_t *cocsepdata, data; - int64_t coord, coclass; - uint64_t selfsim[COCSEP_CLASSES], sim, t; - oriented_cube_t cube; - cube_t rep[COCSEP_CLASSES]; - - gendata_cocsep(buf, selfsim, rep); - cocsepdata = (uint32_t *)(buf + INFOSIZE); - - /* All cases in the same test so we do not generate data many times */ - - while (fgets(str, STRLENMAX, stdin) != NULL) { - cube = readcube(str); - coord = coord_cocsep(cube.cube); - data = cocsepdata[coord]; - coclass = (data & (0xFFFU << 16)) >> 16; - sim = selfsim[coclass]; - for (t = 0; t < 48 && sim; t++, sim >>= 1) { - if (sim & 1) - printf("%" PRId64 " ", t); - } - printf("\n"); - } -} diff --git a/test/103_cocsep_selfsim_distribution/00_all.in b/test/103_cocsep_selfsim_distribution/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/103_cocsep_selfsim_distribution/00_all.out b/test/103_cocsep_selfsim_distribution/00_all.out deleted file mode 100644 index e58bfe1..0000000 --- a/test/103_cocsep_selfsim_distribution/00_all.out +++ /dev/null @@ -1,12 +0,0 @@ -373 self-similar positions out of 3393 -Size number of groups -1 3020 -2 311 -3 8 -4 35 -6 9 -8 6 -12 1 -16 1 -24 1 -48 1 diff --git a/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c b/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c deleted file mode 100644 index 90208eb..0000000 --- a/test/103_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "../test.h" - -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -int64_t coord_cocsep(cube_t); - -int bcount(uint64_t x) { - int ret; - uint64_t i; - - for (i = 0, ret = 0; i < 64; i++) - if (x & (UINT64_C(1) << i)) - ret++; - - return ret; -} - -void run(void) { - unsigned char buf[2000000]; - int size[65], tot, j; - uint64_t i, selfsim[COCSEP_CLASSES], sim; - cube_t rep[COCSEP_CLASSES]; - - memset(size, 0, 65 * sizeof(int)); - gendata_cocsep(buf, selfsim, rep); - - for (i = 0, tot = 0; i < COCSEP_CLASSES; i++) { - sim = selfsim[i]; - if (sim >> 1) - tot++; - size[bcount(sim)]++; - } - - printf("%d self-similar positions out of 3393\n", tot); - printf("Size\tnumber of groups\n"); - for (j = 0; j <= 48; j++) - if (size[j] != 0) - printf("%d\t%d\n", j, size[j]); -} diff --git a/test/104_cocsep_ttrep/00_all.in b/test/104_cocsep_ttrep/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/104_cocsep_ttrep/00_all.out b/test/104_cocsep_ttrep/00_all.out deleted file mode 100644 index e69de29..0000000 diff --git a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c deleted file mode 100644 index 87975a4..0000000 --- a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "../test.h" - -uint8_t inverse_trans(uint8_t); -cube_t transform_corners(cube_t, uint8_t); -int64_t coord_cocsep(cube_t); -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); - -void run(void) { - uint8_t t; - unsigned char buf[2000000]; - uint32_t *cocsepdata, tt; - uint64_t i, selfsim[COCSEP_CLASSES]; - int64_t j, k, l; - cube_t rep[COCSEP_CLASSES], c, d; - - gendata_cocsep(buf, selfsim, rep); - cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); - - for (i = 0; i < COCSEP_CLASSES; i++) { - c = rep[i]; - for (t = 0; t < 48; t++) { - d = transform_corners(c, t); - j = coord_cocsep(d); - tt = TTREP(cocsepdata[j]); - d = transform_corners(d, tt); - k = coord_cocsep(d); - l = coord_cocsep(c); - if (k != l) - printf("cocsep %" PRId64 " (%" PRId64 "): " - "%" PRId64 " ttrep %" PRIu32 - " -> %" PRId64 "\n", i, l, j, tt, k); - } - } -} diff --git a/test/105_gendata_eoesep/00_all.in b/test/105_gendata_eoesep/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/105_gendata_eoesep/00_all.out b/test/105_gendata_eoesep/00_all.out deleted file mode 100644 index df5195d..0000000 --- a/test/105_gendata_eoesep/00_all.out +++ /dev/null @@ -1,9 +0,0 @@ -939880 -Classes (ESEP only): 782 -0: 1 -1: 1 -2: 3 -3: 23 -4: 235 -5: 2281 -6: 22069 diff --git a/test/105_gendata_eoesep/gendata_eoesep_tests.c b/test/105_gendata_eoesep/gendata_eoesep_tests.c deleted file mode 100644 index 7ed9778..0000000 --- a/test/105_gendata_eoesep/gendata_eoesep_tests.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -The test does not generate the full table. For reference, these are the values: - -0: 1 -1: 1 -2: 3 -3: 23 -4: 235 -5: 2281 -6: 22069 -7: 182776 -8: 767847 -9: 617858 -10: 8439 -11: 3 -*/ - -#include "../test.h" - -#define DEPTH 6 -#define EMAX (495*70) -#define CL 782 -#define ISIZE 512 -#define FULLSIZE (ISIZE + (CL*1024) + (4*EMAX)) - -unsigned char buf[FULLSIZE]; - -size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t); -int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); - -void run(void) { - uint32_t i; - size_t result; - tableinfo_t info; - - result = gendata_eoesep(buf, DEPTH); - if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) { - printf("Error reading info from table\n"); - return; - } - - printf("%zu\n", result); - printf("Classes (ESEP only): %" PRIu64 "\n", info.classes); - for (i = 0; i <= DEPTH; i++) - printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); -} diff --git a/test/110_coord_invcoord_h48/00_all.in b/test/110_coord_invcoord_h48/00_all.in deleted file mode 100644 index 0480485..0000000 --- a/test/110_coord_invcoord_h48/00_all.in +++ /dev/null @@ -1,8 +0,0 @@ -ABCDEFGH=BDCAEFGHIJKL=A -ABCDEFGH=ABCDEFGHIJKL=A -BACDFEGH=BACDFEGHIJKL=A -CILVXGMR=FKbGIDSXBJAU=A -WBCVEILH=ABCDIFGLHJKE=A -MBODSFQH=ZBCYEFGHQTKL=A -ABCDEFGH=ILKJEFGHDABC=A -ABCDEFGH=EFGHBADCIJKL=A diff --git a/test/110_coord_invcoord_h48/00_all.out b/test/110_coord_invcoord_h48/00_all.out deleted file mode 100644 index e84be4b..0000000 --- a/test/110_coord_invcoord_h48/00_all.out +++ /dev/null @@ -1,8 +0,0 @@ -1 ok -2 ok -3 ok -4 ok -5 ok -6 ok -7 ok -8 ok diff --git a/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c b/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c deleted file mode 100644 index 0333f27..0000000 --- a/test/110_coord_invcoord_h48/coord_invcoord_h48_tests.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "../test.h" - -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -int64_t coord_h48(cube_t, const uint32_t *, uint8_t); -cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); -cube_t transform(cube_t, uint8_t); - -void run(void) { - char str[STRLENMAX]; - int i; - bool found; - uint8_t h, t; - unsigned char buf[2000000]; - uint32_t *cocsepdata; - uint64_t selfsim[COCSEP_CLASSES]; - int64_t c, cc; - oriented_cube_t cube; - cube_t invc, rep[COCSEP_CLASSES]; - - gendata_cocsep(buf, selfsim, rep); - cocsepdata = (uint32_t *)(buf + INFOSIZE); - - i = 1; - h = 11; - while (fgets(str, STRLENMAX, stdin) != NULL) { - cube = readcube(str); - c = coord_h48(cube.cube, cocsepdata, h); - invc = invcoord_h48(c, rep, h); - for (t = 0, found = false; t < 48; t++) { - cube.cube = transform(invc, t); - cc = coord_h48(cube.cube, cocsepdata, h); - found = found || cc == c; - } - printf("%d %s\n", i, found ? "ok" : "ERROR"); - i++; - } -} diff --git a/test/110_gendata_cocsep/00_all.in b/test/110_gendata_cocsep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/110_gendata_cocsep/00_all.out b/test/110_gendata_cocsep/00_all.out new file mode 100644 index 0000000..82eb6c2 --- /dev/null +++ b/test/110_gendata_cocsep/00_all.out @@ -0,0 +1,13 @@ +1120256 +Classes: 3393 +Max value: 9 +0: 1 +1: 6 +2: 63 +3: 468 +4: 3068 +5: 15438 +6: 53814 +7: 71352 +8: 8784 +9: 96 diff --git a/test/110_gendata_cocsep/gendata_cocsep_tests.c b/test/110_gendata_cocsep/gendata_cocsep_tests.c new file mode 100644 index 0000000..c1eef77 --- /dev/null +++ b/test/110_gendata_cocsep/gendata_cocsep_tests.c @@ -0,0 +1,27 @@ +#include "../test.h" + +#define BUF_SIZE 2000000 + +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); + +void run(void) { + unsigned char buf[BUF_SIZE]; + uint32_t i; + uint64_t selfsim[COCSEP_CLASSES]; + cube_t rep[COCSEP_CLASSES]; + size_t result; + tableinfo_t info; + + result = gendata_cocsep(buf, selfsim, rep); + if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) { + printf("Error reading info from table\n"); + return; + } + + printf("%zu\n", result); + printf("Classes: %" PRIu64 "\n", info.classes); + printf("Max value: %" PRIu8 "\n", info.maxvalue); + for (i = 0; i < 10; i++) + printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); +} diff --git a/test/111_cocsep_transform_invariant/00_solved.in b/test/111_cocsep_transform_invariant/00_solved.in new file mode 100644 index 0000000..5aa6ba7 --- /dev/null +++ b/test/111_cocsep_transform_invariant/00_solved.in @@ -0,0 +1 @@ +ABCDEFGH=ABCDEFGHIJKL=A diff --git a/test/111_cocsep_transform_invariant/00_solved.out b/test/111_cocsep_transform_invariant/00_solved.out new file mode 100644 index 0000000..e69de29 diff --git a/test/111_cocsep_transform_invariant/01_U.in b/test/111_cocsep_transform_invariant/01_U.in new file mode 100644 index 0000000..250d3a1 --- /dev/null +++ b/test/111_cocsep_transform_invariant/01_U.in @@ -0,0 +1 @@ +FECDABGH=EFCDBAGHIJKL=A diff --git a/test/111_cocsep_transform_invariant/01_U.out b/test/111_cocsep_transform_invariant/01_U.out new file mode 100644 index 0000000..e69de29 diff --git a/test/111_cocsep_transform_invariant/02_scrambled.in b/test/111_cocsep_transform_invariant/02_scrambled.in new file mode 100644 index 0000000..6bb8d86 --- /dev/null +++ b/test/111_cocsep_transform_invariant/02_scrambled.in @@ -0,0 +1 @@ +APDMOKRF=WLHUDZKFIASB=A diff --git a/test/111_cocsep_transform_invariant/02_scrambled.out b/test/111_cocsep_transform_invariant/02_scrambled.out new file mode 100644 index 0000000..e69de29 diff --git a/test/111_cocsep_transform_invariant/cocsep_transform_invariant.c b/test/111_cocsep_transform_invariant/cocsep_transform_invariant.c new file mode 100644 index 0000000..5553fd1 --- /dev/null +++ b/test/111_cocsep_transform_invariant/cocsep_transform_invariant.c @@ -0,0 +1,31 @@ +#include "../test.h" + +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +cube_t transform(cube_t, uint8_t); +int64_t coord_cocsep(cube_t); + +void run(void) { + uint8_t t; + unsigned char buf[2000000]; + uint32_t *cocsepdata; + uint64_t selfsim[COCSEP_CLASSES]; + int64_t coord, tcoord; + char str[STRLENMAX]; + oriented_cube_t cube; + cube_t rep[COCSEP_CLASSES], transd; + + fgets(str, STRLENMAX, stdin); + cube = readcube(str); + + gendata_cocsep(buf, selfsim, rep); + cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); + + coord = (int64_t)COCLASS(cocsepdata[coord_cocsep(cube.cube)]); + for (t = 0; t < 48; t++) { + transd = transform(cube.cube, t); + tcoord = (int64_t)COCLASS(cocsepdata[coord_cocsep(transd)]); + if (coord != tcoord) + printf("Error: expected %" PRId64 + " but got %" PRId64 "\n", coord, tcoord); + } +} diff --git a/test/111_h48map/00_small.in b/test/111_h48map/00_small.in deleted file mode 100644 index ee8e591..0000000 --- a/test/111_h48map/00_small.in +++ /dev/null @@ -1,11 +0,0 @@ -11 -7 -4 -34 -12 -45 -7 -34 -13 -45 -5 diff --git a/test/111_h48map/00_small.out b/test/111_h48map/00_small.out deleted file mode 100644 index 260e804..0000000 --- a/test/111_h48map/00_small.out +++ /dev/null @@ -1,3 +0,0 @@ -2 -34 12 -45 5 diff --git a/test/111_h48map/01_large.in b/test/111_h48map/01_large.in deleted file mode 100644 index 1812b40..0000000 --- a/test/111_h48map/01_large.in +++ /dev/null @@ -1,303 +0,0 @@ -307 -293 -150 -100053 -417 -100045 -164 -100007 -235 -100007 -207 -100011 -406 -100072 -29 -100033 -188 -100015 -358 -100013 -248 -100068 -218 -100047 -398 -100046 -263 -100000 -471 -100076 -219 -100021 -115 -100019 -329 -100015 -178 -100049 -59 -100052 -319 -100071 -232 -100058 -174 -100009 -46 -100060 -349 -100030 -287 -100051 -203 -100069 -359 -100011 -296 -100051 -223 -100014 -233 -100031 -264 -100017 -180 -100076 -22 -100016 -213 -100030 -55 -100037 -3 -100011 -467 -100002 -165 -100029 -161 -100022 -67 -100038 -374 -100075 -4 -100066 -156 -100051 -144 -100020 -480 -100039 -265 -100029 -195 -100087 -245 -100099 -287 -100041 -308 -100042 -32 -100026 -312 -100060 -434 -100006 -392 -100010 -269 -100079 -414 -100046 -161 -100086 -139 -100010 -88 -100036 -117 -100047 -376 -100069 -17 -100041 -314 -100074 -320 -100090 -225 -100092 -424 -100020 -325 -100096 -318 -100046 -238 -100028 -13 -100072 -73 -100096 -262 -100025 -82 -100001 -107 -100067 -410 -100044 -449 -100063 -276 -100026 -392 -100062 -407 -100091 -411 -100012 -400 -100073 -331 -100051 -83 -100010 -385 -100096 -484 -100043 -352 -100025 -207 -100077 -272 -100089 -192 -100005 -291 -100024 -243 -100091 -445 -100046 -162 -100053 -380 -100058 -157 -100065 -464 -100051 -306 -100056 -236 -100025 -198 -100093 -230 -100088 -494 -100033 -70 -100073 -218 -100048 -486 -100059 -77 -100027 -142 -100045 -418 -100012 -68 -100059 -448 -100084 -339 -100017 -39 -100048 -83 -100004 -321 -100051 -441 -100016 -308 -100088 -334 -100033 -476 -100064 -51 -100060 -324 -100043 -149 -100084 -116 -100026 -351 -100051 -396 -100060 -377 -100069 -301 -100015 -319 -100014 -466 -100038 -194 -100068 -41 -100038 -295 -100097 -394 -100017 -34 -100013 -223 -100053 -339 -100019 -67 -100018 -24 -100081 -205 -100071 -440 -100025 -228 -100014 -169 -100016 -121 -100011 -444 -100069 -460 -100079 -139 -100063 -169 -100070 -132 -100072 -119 -100095 -126 -100042 -217 -100008 -272 -100022 -121 diff --git a/test/111_h48map/01_large.out b/test/111_h48map/01_large.out deleted file mode 100644 index f5e00d8..0000000 --- a/test/111_h48map/01_large.out +++ /dev/null @@ -1,83 +0,0 @@ -82 -100000 471 -100001 107 -100002 165 -100004 321 -100005 291 -100006 392 -100007 207 -100008 272 -100009 46 -100010 88 -100011 296 -100012 68 -100013 223 -100014 169 -100015 178 -100016 121 -100017 34 -100018 24 -100019 67 -100020 325 -100021 115 -100022 67 -100024 243 -100025 82 -100026 312 -100027 142 -100028 13 -100029 161 -100030 55 -100031 264 -100033 70 -100036 117 -100037 3 -100038 194 -100039 265 -100041 308 -100042 32 -100043 149 -100044 449 -100045 164 -100046 161 -100047 376 -100048 83 -100049 59 -100051 83 -100052 319 -100053 339 -100056 236 -100058 157 -100059 77 -100060 324 -100062 407 -100063 169 -100064 51 -100065 464 -100066 156 -100067 410 -100068 41 -100069 17 -100070 132 -100071 232 -100072 29 -100073 218 -100074 320 -100075 4 -100076 22 -100077 272 -100079 139 -100081 205 -100084 116 -100086 139 -100087 245 -100088 334 -100089 192 -100090 225 -100091 411 -100092 424 -100093 230 -100095 126 -100096 262 -100097 394 -100099 287 diff --git a/test/111_h48map/h48map_tests.c b/test/111_h48map/h48map_tests.c deleted file mode 100644 index 927b157..0000000 --- a/test/111_h48map/h48map_tests.c +++ /dev/null @@ -1,70 +0,0 @@ -#include "../test.h" - -#define MAXPOS 1000 - -void h48map_create(h48map_t [static 1], uint64_t, uint64_t); -void h48map_destroy(h48map_t [static 1]); -void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); -uint64_t h48map_value(h48map_t [static 1], uint64_t); -kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); - -char str[STRLENMAX]; - -int compare(const void *x, const void *y) { - uint64_t a = ((kvpair_t *)x)->key; - uint64_t b = ((kvpair_t *)y)->key; - - if (a > b) return 1; - if (a == b) return 0; - return -1; -} - -uint64_t readl(void) { - fgets(str, STRLENMAX, stdin); - return atoll(str); -} - -void run(void) { - h48map_t map; - uint64_t n, i, j, capacity, randomizer, x, y, v; - kvpair_t kv, a[MAXPOS], b[MAXPOS]; - - capacity = readl(); - randomizer = readl(); - n = readl(); - - for (i = 0; i < n; i++) { - x = readl(); - y = readl(); - a[i] = (kvpair_t) { .key = x, .val = y }; - } - - h48map_create(&map, capacity, randomizer); - for (i = 0; i < n; i++) - h48map_insertmin(&map, a[i].key, a[i].val); - - i = 0; - for (kv = h48map_nextkvpair(&map, &i), j = 0; - i != map.capacity && j < MAXPOS; - kv = h48map_nextkvpair(&map, &i) - ) { - b[j++] = kv; - } - qsort(b, j, sizeof(kvpair_t), compare); - - printf("%" PRIu64 "\n", map.n); - for (i = 0; i < j; i++) - printf("%" PRIu64 " %" PRIu64 "\n", b[i].key, b[i].val); - if (map.n != j) - printf("Wrong number of elements: map->n = %" PRIu64 ", " - "but scan returns %" PRIu64 "\n", map.n, j); - for (i = 0; i < n; i++) { - v = h48map_value(&map, a[i].key); - if (v > a[i].val) - printf("Value for key %" PRId64 " is larger than " - "expected (%" PRIu64 " > %" PRIu64 ")\n", - a[i].key, v, a[i].val); - } - - h48map_destroy(&map); -} diff --git a/test/112_cocsep_selfsim/00_all.in b/test/112_cocsep_selfsim/00_all.in new file mode 100644 index 0000000..5d0021c --- /dev/null +++ b/test/112_cocsep_selfsim/00_all.in @@ -0,0 +1,2 @@ +ABCDEFGH=ABCDEFGHIJKL=A +WBCVEILH=ABCDIFGLHJKE=A diff --git a/test/112_cocsep_selfsim/00_all.out b/test/112_cocsep_selfsim/00_all.out new file mode 100644 index 0000000..cc96363 --- /dev/null +++ b/test/112_cocsep_selfsim/00_all.out @@ -0,0 +1,2 @@ +0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 +0 1 2 3 24 25 26 27 diff --git a/test/112_cocsep_selfsim/cocsep_selfsim_tests.c b/test/112_cocsep_selfsim/cocsep_selfsim_tests.c new file mode 100644 index 0000000..1a1c6f2 --- /dev/null +++ b/test/112_cocsep_selfsim/cocsep_selfsim_tests.c @@ -0,0 +1,39 @@ +/* + * This test is tricky, we only have two cases for now: the solved cube + * and the cube that is one quarter-turn-move off (all such cases are + * equivalent due to symmetry). Adding more tests requires figuring out + * by hand which one is the first position in its class to be reached. + * Note that the .out files need a space before each newline. + */ +#include "../test.h" + +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +int64_t coord_cocsep(cube_t); + +void run(void) { + char str[STRLENMAX]; + unsigned char buf[2000000]; + uint32_t *cocsepdata, data; + int64_t coord, coclass; + uint64_t selfsim[COCSEP_CLASSES], sim, t; + oriented_cube_t cube; + cube_t rep[COCSEP_CLASSES]; + + gendata_cocsep(buf, selfsim, rep); + cocsepdata = (uint32_t *)(buf + INFOSIZE); + + /* All cases in the same test so we do not generate data many times */ + + while (fgets(str, STRLENMAX, stdin) != NULL) { + cube = readcube(str); + coord = coord_cocsep(cube.cube); + data = cocsepdata[coord]; + coclass = (data & (0xFFFU << 16)) >> 16; + sim = selfsim[coclass]; + for (t = 0; t < 48 && sim; t++, sim >>= 1) { + if (sim & 1) + printf("%" PRId64 " ", t); + } + printf("\n"); + } +} diff --git a/test/112_gendata_h48short/00_depth_1.in b/test/112_gendata_h48short/00_depth_1.in deleted file mode 100644 index c86f15b..0000000 --- a/test/112_gendata_h48short/00_depth_1.in +++ /dev/null @@ -1,28 +0,0 @@ -73 -157 -1 - -For longer test: - -20000003 -20000023 -8 - -Short h48: generating depth 0 -found 1 -Short h48: generating depth 1 -found 1 -Short h48: generating depth 2 -found 4 -Short h48: generating depth 3 -found 34 -Short h48: generating depth 4 -found 333 -Short h48: generating depth 5 -found 3815 -Short h48: generating depth 6 -found 45382 -Short h48: generating depth 7 -found 548562 -Short h48: generating depth 8 -found 6839723 diff --git a/test/112_gendata_h48short/00_depth_1.out b/test/112_gendata_h48short/00_depth_1.out deleted file mode 100644 index b0dba31..0000000 --- a/test/112_gendata_h48short/00_depth_1.out +++ /dev/null @@ -1,3 +0,0 @@ -2 -0 0 -71075840 1 diff --git a/test/112_gendata_h48short/01_depth_3.in b/test/112_gendata_h48short/01_depth_3.in deleted file mode 100644 index 920e70a..0000000 --- a/test/112_gendata_h48short/01_depth_3.in +++ /dev/null @@ -1,3 +0,0 @@ -73 -157 -3 diff --git a/test/112_gendata_h48short/01_depth_3.out b/test/112_gendata_h48short/01_depth_3.out deleted file mode 100644 index dbce376..0000000 --- a/test/112_gendata_h48short/01_depth_3.out +++ /dev/null @@ -1,40 +0,0 @@ -40 -0 0 -70981632 3 -71075840 1 -71086080 3 -142067712 2 -218789888 3 -218884096 2 -283879424 2 -283899904 3 -283953152 3 -283973632 2 -360548808 3 -360835072 3 -473668032 3 -473956352 3 -499869696 3 -500011008 3 -598679552 3 -599109185 3 -662171648 3 -662601226 3 -724818316 3 -725106688 3 -790513664 3 -790607872 3 -904991108 3 -926726144 3 -928729088 3 -1009662340 3 -1088755203 3 -1171758595 3 -1206452224 3 -1206480896 3 -1277360128 3 -1277454336 3 -1403695492 3 -1403697540 3 -1403736452 3 -1403738500 3 diff --git a/test/112_gendata_h48short/gendata_h48short_tests.c b/test/112_gendata_h48short/gendata_h48short_tests.c deleted file mode 100644 index 0de9408..0000000 --- a/test/112_gendata_h48short/gendata_h48short_tests.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "../test.h" - -#define MAXPOS 200 - -void h48map_create(h48map_t [static 1], uint64_t, uint64_t); -void h48map_destroy(h48map_t [static 1]); -kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); -size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); -uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]); - -char str[STRLENMAX]; - -int compare(const void *x, const void *y) { - uint64_t a = ((kvpair_t *)x)->key; - uint64_t b = ((kvpair_t *)y)->key; - - if (a > b) return 1; - if (a == b) return 0; - return -1; -} - -uint64_t readl(void) { - fgets(str, STRLENMAX, stdin); - return atoll(str); -} - -void run(void) { - unsigned char buf[2000000]; - h48map_t map; - uint64_t i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; - kvpair_t kv, b[MAXPOS]; - gendata_h48short_arg_t arg; - cube_t crep[COCSEP_CLASSES]; - - capacity = readl(); - randomizer = readl(); - arg.maxdepth = readl(); - arg.crep = crep; - arg.selfsim = selfsim; - arg.map = ↦ - - h48map_create(&map, capacity, randomizer); - gendata_cocsep(buf, selfsim, crep); - arg.cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); - gendata_h48short(&arg); - - i = 0; - for (kv = h48map_nextkvpair(&map, &i), j = 0; - i != map.capacity && j < MAXPOS; - kv = h48map_nextkvpair(&map, &i) - ) { - b[j++] = kv; - } - qsort(b, j, sizeof(kvpair_t), compare); - - printf("%" PRIu64 "\n", map.n); - for (i = 0; i < j; i++) - printf("%" PRIu64 " %" PRIu64 "\n", b[i].key, b[i].val); - - h48map_destroy(&map); -} diff --git a/test/113_cocsep_selfsim_distribution/00_all.in b/test/113_cocsep_selfsim_distribution/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/113_cocsep_selfsim_distribution/00_all.out b/test/113_cocsep_selfsim_distribution/00_all.out new file mode 100644 index 0000000..e58bfe1 --- /dev/null +++ b/test/113_cocsep_selfsim_distribution/00_all.out @@ -0,0 +1,12 @@ +373 self-similar positions out of 3393 +Size number of groups +1 3020 +2 311 +3 8 +4 35 +6 9 +8 6 +12 1 +16 1 +24 1 +48 1 diff --git a/test/113_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c b/test/113_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c new file mode 100644 index 0000000..90208eb --- /dev/null +++ b/test/113_cocsep_selfsim_distribution/cocsep_selfsim_distribution_tests.c @@ -0,0 +1,38 @@ +#include "../test.h" + +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +int64_t coord_cocsep(cube_t); + +int bcount(uint64_t x) { + int ret; + uint64_t i; + + for (i = 0, ret = 0; i < 64; i++) + if (x & (UINT64_C(1) << i)) + ret++; + + return ret; +} + +void run(void) { + unsigned char buf[2000000]; + int size[65], tot, j; + uint64_t i, selfsim[COCSEP_CLASSES], sim; + cube_t rep[COCSEP_CLASSES]; + + memset(size, 0, 65 * sizeof(int)); + gendata_cocsep(buf, selfsim, rep); + + for (i = 0, tot = 0; i < COCSEP_CLASSES; i++) { + sim = selfsim[i]; + if (sim >> 1) + tot++; + size[bcount(sim)]++; + } + + printf("%d self-similar positions out of 3393\n", tot); + printf("Size\tnumber of groups\n"); + for (j = 0; j <= 48; j++) + if (size[j] != 0) + printf("%d\t%d\n", j, size[j]); +} diff --git a/test/114_cocsep_ttrep/00_all.in b/test/114_cocsep_ttrep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/114_cocsep_ttrep/00_all.out b/test/114_cocsep_ttrep/00_all.out new file mode 100644 index 0000000..e69de29 diff --git a/test/114_cocsep_ttrep/cocsep_ttrep_tests.c b/test/114_cocsep_ttrep/cocsep_ttrep_tests.c new file mode 100644 index 0000000..87975a4 --- /dev/null +++ b/test/114_cocsep_ttrep/cocsep_ttrep_tests.c @@ -0,0 +1,34 @@ +#include "../test.h" + +uint8_t inverse_trans(uint8_t); +cube_t transform_corners(cube_t, uint8_t); +int64_t coord_cocsep(cube_t); +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); + +void run(void) { + uint8_t t; + unsigned char buf[2000000]; + uint32_t *cocsepdata, tt; + uint64_t i, selfsim[COCSEP_CLASSES]; + int64_t j, k, l; + cube_t rep[COCSEP_CLASSES], c, d; + + gendata_cocsep(buf, selfsim, rep); + cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); + + for (i = 0; i < COCSEP_CLASSES; i++) { + c = rep[i]; + for (t = 0; t < 48; t++) { + d = transform_corners(c, t); + j = coord_cocsep(d); + tt = TTREP(cocsepdata[j]); + d = transform_corners(d, tt); + k = coord_cocsep(d); + l = coord_cocsep(c); + if (k != l) + printf("cocsep %" PRId64 " (%" PRId64 "): " + "%" PRId64 " ttrep %" PRIu32 + " -> %" PRId64 "\n", i, l, j, tt, k); + } + } +} diff --git a/test/115_gendata_eoesep/00_all.in b/test/115_gendata_eoesep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/115_gendata_eoesep/00_all.out b/test/115_gendata_eoesep/00_all.out new file mode 100644 index 0000000..df5195d --- /dev/null +++ b/test/115_gendata_eoesep/00_all.out @@ -0,0 +1,9 @@ +939880 +Classes (ESEP only): 782 +0: 1 +1: 1 +2: 3 +3: 23 +4: 235 +5: 2281 +6: 22069 diff --git a/test/115_gendata_eoesep/gendata_eoesep_tests.c b/test/115_gendata_eoesep/gendata_eoesep_tests.c new file mode 100644 index 0000000..7ed9778 --- /dev/null +++ b/test/115_gendata_eoesep/gendata_eoesep_tests.c @@ -0,0 +1,46 @@ +/* +The test does not generate the full table. For reference, these are the values: + +0: 1 +1: 1 +2: 3 +3: 23 +4: 235 +5: 2281 +6: 22069 +7: 182776 +8: 767847 +9: 617858 +10: 8439 +11: 3 +*/ + +#include "../test.h" + +#define DEPTH 6 +#define EMAX (495*70) +#define CL 782 +#define ISIZE 512 +#define FULLSIZE (ISIZE + (CL*1024) + (4*EMAX)) + +unsigned char buf[FULLSIZE]; + +size_t gendata_eoesep(unsigned char [static FULLSIZE], uint8_t); +int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); + +void run(void) { + uint32_t i; + size_t result; + tableinfo_t info; + + result = gendata_eoesep(buf, DEPTH); + if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) { + printf("Error reading info from table\n"); + return; + } + + printf("%zu\n", result); + printf("Classes (ESEP only): %" PRIu64 "\n", info.classes); + for (i = 0; i <= DEPTH; i++) + printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); +} diff --git a/test/120_coord_invcoord_h48/00_all.in b/test/120_coord_invcoord_h48/00_all.in new file mode 100644 index 0000000..0480485 --- /dev/null +++ b/test/120_coord_invcoord_h48/00_all.in @@ -0,0 +1,8 @@ +ABCDEFGH=BDCAEFGHIJKL=A +ABCDEFGH=ABCDEFGHIJKL=A +BACDFEGH=BACDFEGHIJKL=A +CILVXGMR=FKbGIDSXBJAU=A +WBCVEILH=ABCDIFGLHJKE=A +MBODSFQH=ZBCYEFGHQTKL=A +ABCDEFGH=ILKJEFGHDABC=A +ABCDEFGH=EFGHBADCIJKL=A diff --git a/test/120_coord_invcoord_h48/00_all.out b/test/120_coord_invcoord_h48/00_all.out new file mode 100644 index 0000000..e84be4b --- /dev/null +++ b/test/120_coord_invcoord_h48/00_all.out @@ -0,0 +1,8 @@ +1 ok +2 ok +3 ok +4 ok +5 ok +6 ok +7 ok +8 ok diff --git a/test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c b/test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c new file mode 100644 index 0000000..0333f27 --- /dev/null +++ b/test/120_coord_invcoord_h48/coord_invcoord_h48_tests.c @@ -0,0 +1,37 @@ +#include "../test.h" + +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +int64_t coord_h48(cube_t, const uint32_t *, uint8_t); +cube_t invcoord_h48(int64_t, const cube_t *, uint8_t); +cube_t transform(cube_t, uint8_t); + +void run(void) { + char str[STRLENMAX]; + int i; + bool found; + uint8_t h, t; + unsigned char buf[2000000]; + uint32_t *cocsepdata; + uint64_t selfsim[COCSEP_CLASSES]; + int64_t c, cc; + oriented_cube_t cube; + cube_t invc, rep[COCSEP_CLASSES]; + + gendata_cocsep(buf, selfsim, rep); + cocsepdata = (uint32_t *)(buf + INFOSIZE); + + i = 1; + h = 11; + while (fgets(str, STRLENMAX, stdin) != NULL) { + cube = readcube(str); + c = coord_h48(cube.cube, cocsepdata, h); + invc = invcoord_h48(c, rep, h); + for (t = 0, found = false; t < 48; t++) { + cube.cube = transform(invc, t); + cc = coord_h48(cube.cube, cocsepdata, h); + found = found || cc == c; + } + printf("%d %s\n", i, found ? "ok" : "ERROR"); + i++; + } +} diff --git a/test/120_gendata_eo/00_all.in b/test/120_gendata_eo/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/120_gendata_eo/00_all.out b/test/120_gendata_eo/00_all.out deleted file mode 100644 index 42e8c66..0000000 --- a/test/120_gendata_eo/00_all.out +++ /dev/null @@ -1,12 +0,0 @@ -1536 -0: 1 -1: 2 -2: 25 -3: 202 -4: 620 -5: 900 -6: 285 -7: 13 -8: 0 -9: 0 -10: 0 diff --git a/test/120_gendata_eo/gendata_eo_tests.c b/test/120_gendata_eo/gendata_eo_tests.c deleted file mode 100644 index 1b985c3..0000000 --- a/test/120_gendata_eo/gendata_eo_tests.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -Pruning table values (from nissy): -0: 1 -1: 2 -2: 25 -3: 202 -4: 620 -5: 900 -6: 285 -7: 13 -*/ - -#include "../test.h" - -#define ISIZE 512 -#define FULLSIZE (ISIZE + 1024) - -unsigned char buf[FULLSIZE]; - -long long gendata_coord_dispatch( - const char *, unsigned long long, unsigned char *); -int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); - -void run(void) { - uint32_t i; - size_t result; - tableinfo_t info; - - result = gendata_coord_dispatch("coord_EO_FB", FULLSIZE, buf); - if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) { - printf("Error reading info from table\n"); - return; - } - - printf("%zu\n", result); - for (i = 0; i <= 10; i++) - printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); -} diff --git a/test/121_coorddata_dr/00_all.in b/test/121_coorddata_dr/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/121_coorddata_dr/00_all.out b/test/121_coorddata_dr/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/121_coorddata_dr/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/121_coorddata_dr/coorddata_dr.c b/test/121_coorddata_dr/coorddata_dr.c deleted file mode 100644 index d8ac94a..0000000 --- a/test/121_coorddata_dr/coorddata_dr.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "../test.h" - -#define POW_3_7 2187 -#define BOUND (64430 * POW_3_7 / 100) -#define TGROUP UINT64_C(4278190335) - -cube_t transform(cube_t, uint8_t); -uint64_t coordinate_dr_coord(cube_t, const unsigned char *); -cube_t coordinate_dr_cube(uint64_t, const unsigned char *); -size_t coordinate_dr_gendata(unsigned char *); - -void run(void) { - bool found; - uint64_t t; - char str[STRLENMAX]; - unsigned char *data; - size_t size; - cube_t cube; - oriented_cube_t oc; - uint64_t coord, coord2; - - size = coordinate_dr_gendata(NULL); - data = malloc(size); - coordinate_dr_gendata(data); - - for (coord = 0; coord < BOUND; coord++) { - cube = coordinate_dr_cube(coord, data); - - oc = (oriented_cube_t) { .cube = cube, .orientation = 0 }; - if (!isconsistent(oc)) { - printf("Error: invcoord of %" PRId64 - " is not consistent\n", coord); - goto cleanup; - } - - for (t = 0, found = false; t < 48; t++) { - if (!((UINT64_C(1) << t) & TGROUP)) - continue; - - coord2 = coordinate_dr_coord(transform(cube, t), data); - if (coord == coord2) { - found = true; - break; - } - } - - if (!found) { - oc = (oriented_cube_t){.cube = cube, .orientation = 0}; - printf("Error: invcoord of %" PRId64 " returns %" - PRId64 " with cube:\n", coord, coord2); - writecube(oc, STRLENMAX, str); - printf("%s\n", str); - goto cleanup; - } - } - - printf("All good\n"); - -cleanup: - free(data); -} diff --git a/test/121_h48map/00_small.in b/test/121_h48map/00_small.in new file mode 100644 index 0000000..ee8e591 --- /dev/null +++ b/test/121_h48map/00_small.in @@ -0,0 +1,11 @@ +11 +7 +4 +34 +12 +45 +7 +34 +13 +45 +5 diff --git a/test/121_h48map/00_small.out b/test/121_h48map/00_small.out new file mode 100644 index 0000000..260e804 --- /dev/null +++ b/test/121_h48map/00_small.out @@ -0,0 +1,3 @@ +2 +34 12 +45 5 diff --git a/test/121_h48map/01_large.in b/test/121_h48map/01_large.in new file mode 100644 index 0000000..1812b40 --- /dev/null +++ b/test/121_h48map/01_large.in @@ -0,0 +1,303 @@ +307 +293 +150 +100053 +417 +100045 +164 +100007 +235 +100007 +207 +100011 +406 +100072 +29 +100033 +188 +100015 +358 +100013 +248 +100068 +218 +100047 +398 +100046 +263 +100000 +471 +100076 +219 +100021 +115 +100019 +329 +100015 +178 +100049 +59 +100052 +319 +100071 +232 +100058 +174 +100009 +46 +100060 +349 +100030 +287 +100051 +203 +100069 +359 +100011 +296 +100051 +223 +100014 +233 +100031 +264 +100017 +180 +100076 +22 +100016 +213 +100030 +55 +100037 +3 +100011 +467 +100002 +165 +100029 +161 +100022 +67 +100038 +374 +100075 +4 +100066 +156 +100051 +144 +100020 +480 +100039 +265 +100029 +195 +100087 +245 +100099 +287 +100041 +308 +100042 +32 +100026 +312 +100060 +434 +100006 +392 +100010 +269 +100079 +414 +100046 +161 +100086 +139 +100010 +88 +100036 +117 +100047 +376 +100069 +17 +100041 +314 +100074 +320 +100090 +225 +100092 +424 +100020 +325 +100096 +318 +100046 +238 +100028 +13 +100072 +73 +100096 +262 +100025 +82 +100001 +107 +100067 +410 +100044 +449 +100063 +276 +100026 +392 +100062 +407 +100091 +411 +100012 +400 +100073 +331 +100051 +83 +100010 +385 +100096 +484 +100043 +352 +100025 +207 +100077 +272 +100089 +192 +100005 +291 +100024 +243 +100091 +445 +100046 +162 +100053 +380 +100058 +157 +100065 +464 +100051 +306 +100056 +236 +100025 +198 +100093 +230 +100088 +494 +100033 +70 +100073 +218 +100048 +486 +100059 +77 +100027 +142 +100045 +418 +100012 +68 +100059 +448 +100084 +339 +100017 +39 +100048 +83 +100004 +321 +100051 +441 +100016 +308 +100088 +334 +100033 +476 +100064 +51 +100060 +324 +100043 +149 +100084 +116 +100026 +351 +100051 +396 +100060 +377 +100069 +301 +100015 +319 +100014 +466 +100038 +194 +100068 +41 +100038 +295 +100097 +394 +100017 +34 +100013 +223 +100053 +339 +100019 +67 +100018 +24 +100081 +205 +100071 +440 +100025 +228 +100014 +169 +100016 +121 +100011 +444 +100069 +460 +100079 +139 +100063 +169 +100070 +132 +100072 +119 +100095 +126 +100042 +217 +100008 +272 +100022 +121 diff --git a/test/121_h48map/01_large.out b/test/121_h48map/01_large.out new file mode 100644 index 0000000..f5e00d8 --- /dev/null +++ b/test/121_h48map/01_large.out @@ -0,0 +1,83 @@ +82 +100000 471 +100001 107 +100002 165 +100004 321 +100005 291 +100006 392 +100007 207 +100008 272 +100009 46 +100010 88 +100011 296 +100012 68 +100013 223 +100014 169 +100015 178 +100016 121 +100017 34 +100018 24 +100019 67 +100020 325 +100021 115 +100022 67 +100024 243 +100025 82 +100026 312 +100027 142 +100028 13 +100029 161 +100030 55 +100031 264 +100033 70 +100036 117 +100037 3 +100038 194 +100039 265 +100041 308 +100042 32 +100043 149 +100044 449 +100045 164 +100046 161 +100047 376 +100048 83 +100049 59 +100051 83 +100052 319 +100053 339 +100056 236 +100058 157 +100059 77 +100060 324 +100062 407 +100063 169 +100064 51 +100065 464 +100066 156 +100067 410 +100068 41 +100069 17 +100070 132 +100071 232 +100072 29 +100073 218 +100074 320 +100075 4 +100076 22 +100077 272 +100079 139 +100081 205 +100084 116 +100086 139 +100087 245 +100088 334 +100089 192 +100090 225 +100091 411 +100092 424 +100093 230 +100095 126 +100096 262 +100097 394 +100099 287 diff --git a/test/121_h48map/h48map_tests.c b/test/121_h48map/h48map_tests.c new file mode 100644 index 0000000..927b157 --- /dev/null +++ b/test/121_h48map/h48map_tests.c @@ -0,0 +1,70 @@ +#include "../test.h" + +#define MAXPOS 1000 + +void h48map_create(h48map_t [static 1], uint64_t, uint64_t); +void h48map_destroy(h48map_t [static 1]); +void h48map_insertmin(h48map_t [static 1], uint64_t, uint64_t); +uint64_t h48map_value(h48map_t [static 1], uint64_t); +kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); + +char str[STRLENMAX]; + +int compare(const void *x, const void *y) { + uint64_t a = ((kvpair_t *)x)->key; + uint64_t b = ((kvpair_t *)y)->key; + + if (a > b) return 1; + if (a == b) return 0; + return -1; +} + +uint64_t readl(void) { + fgets(str, STRLENMAX, stdin); + return atoll(str); +} + +void run(void) { + h48map_t map; + uint64_t n, i, j, capacity, randomizer, x, y, v; + kvpair_t kv, a[MAXPOS], b[MAXPOS]; + + capacity = readl(); + randomizer = readl(); + n = readl(); + + for (i = 0; i < n; i++) { + x = readl(); + y = readl(); + a[i] = (kvpair_t) { .key = x, .val = y }; + } + + h48map_create(&map, capacity, randomizer); + for (i = 0; i < n; i++) + h48map_insertmin(&map, a[i].key, a[i].val); + + i = 0; + for (kv = h48map_nextkvpair(&map, &i), j = 0; + i != map.capacity && j < MAXPOS; + kv = h48map_nextkvpair(&map, &i) + ) { + b[j++] = kv; + } + qsort(b, j, sizeof(kvpair_t), compare); + + printf("%" PRIu64 "\n", map.n); + for (i = 0; i < j; i++) + printf("%" PRIu64 " %" PRIu64 "\n", b[i].key, b[i].val); + if (map.n != j) + printf("Wrong number of elements: map->n = %" PRIu64 ", " + "but scan returns %" PRIu64 "\n", map.n, j); + for (i = 0; i < n; i++) { + v = h48map_value(&map, a[i].key); + if (v > a[i].val) + printf("Value for key %" PRId64 " is larger than " + "expected (%" PRIu64 " > %" PRIu64 ")\n", + a[i].key, v, a[i].val); + } + + h48map_destroy(&map); +} diff --git a/test/122_coorddata_dreo/00_all.in b/test/122_coorddata_dreo/00_all.in deleted file mode 100644 index e69de29..0000000 diff --git a/test/122_coorddata_dreo/00_all.out b/test/122_coorddata_dreo/00_all.out deleted file mode 100644 index d6109db..0000000 --- a/test/122_coorddata_dreo/00_all.out +++ /dev/null @@ -1 +0,0 @@ -All good diff --git a/test/122_coorddata_dreo/coorddata_dreo.c b/test/122_coorddata_dreo/coorddata_dreo.c deleted file mode 100644 index 2b99b7f..0000000 --- a/test/122_coorddata_dreo/coorddata_dreo.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "../test.h" - -#define POW_3_7 2187 -#define BOUND 45 * POW_3_7 -#define TGROUP UINT64_C(4278190335) - -cube_t transform(cube_t, uint8_t); -uint64_t coordinate_dreo_coord(cube_t, const unsigned char *); -cube_t coordinate_dreo_cube(uint64_t, const unsigned char *); -size_t coordinate_dreo_gendata(unsigned char *); - -void run(void) { - bool found; - uint64_t t; - char str[STRLENMAX]; - unsigned char *data; - size_t size; - cube_t cube; - oriented_cube_t oc; - uint64_t coord, coord2; - - size = coordinate_dreo_gendata(NULL); - data = malloc(size); - coordinate_dreo_gendata(data); - - for (coord = 0; coord < BOUND; coord++) { - cube = coordinate_dreo_cube(coord, data); - - oc = (oriented_cube_t) { .cube = cube, .orientation = 0 }; - if (!isconsistent(oc)) { - printf("Error: invcoord of %" PRId64 - " is not consistent\n", coord); - goto cleanup; - } - - for (t = 0, found = false; t < 48; t++) { - if (!((UINT64_C(1) << t) & TGROUP)) - continue; - - coord2 = coordinate_dreo_coord(transform(cube, t), data); - if (coord == coord2) { - found = true; - break; - } - } - - if (!found) { - oc = (oriented_cube_t){.cube = cube, .orientation = 0}; - printf("Error: invcoord of %" PRId64 " returns %" - PRId64 " with cube:\n", coord, coord2); - writecube(oc, STRLENMAX, str); - printf("%s\n", str); - goto cleanup; - } - } - - printf("All good\n"); - -cleanup: - free(data); -} diff --git a/test/122_gendata_h48short/00_depth_1.in b/test/122_gendata_h48short/00_depth_1.in new file mode 100644 index 0000000..c86f15b --- /dev/null +++ b/test/122_gendata_h48short/00_depth_1.in @@ -0,0 +1,28 @@ +73 +157 +1 + +For longer test: + +20000003 +20000023 +8 + +Short h48: generating depth 0 +found 1 +Short h48: generating depth 1 +found 1 +Short h48: generating depth 2 +found 4 +Short h48: generating depth 3 +found 34 +Short h48: generating depth 4 +found 333 +Short h48: generating depth 5 +found 3815 +Short h48: generating depth 6 +found 45382 +Short h48: generating depth 7 +found 548562 +Short h48: generating depth 8 +found 6839723 diff --git a/test/122_gendata_h48short/00_depth_1.out b/test/122_gendata_h48short/00_depth_1.out new file mode 100644 index 0000000..b0dba31 --- /dev/null +++ b/test/122_gendata_h48short/00_depth_1.out @@ -0,0 +1,3 @@ +2 +0 0 +71075840 1 diff --git a/test/122_gendata_h48short/01_depth_3.in b/test/122_gendata_h48short/01_depth_3.in new file mode 100644 index 0000000..920e70a --- /dev/null +++ b/test/122_gendata_h48short/01_depth_3.in @@ -0,0 +1,3 @@ +73 +157 +3 diff --git a/test/122_gendata_h48short/01_depth_3.out b/test/122_gendata_h48short/01_depth_3.out new file mode 100644 index 0000000..dbce376 --- /dev/null +++ b/test/122_gendata_h48short/01_depth_3.out @@ -0,0 +1,40 @@ +40 +0 0 +70981632 3 +71075840 1 +71086080 3 +142067712 2 +218789888 3 +218884096 2 +283879424 2 +283899904 3 +283953152 3 +283973632 2 +360548808 3 +360835072 3 +473668032 3 +473956352 3 +499869696 3 +500011008 3 +598679552 3 +599109185 3 +662171648 3 +662601226 3 +724818316 3 +725106688 3 +790513664 3 +790607872 3 +904991108 3 +926726144 3 +928729088 3 +1009662340 3 +1088755203 3 +1171758595 3 +1206452224 3 +1206480896 3 +1277360128 3 +1277454336 3 +1403695492 3 +1403697540 3 +1403736452 3 +1403738500 3 diff --git a/test/122_gendata_h48short/gendata_h48short_tests.c b/test/122_gendata_h48short/gendata_h48short_tests.c new file mode 100644 index 0000000..0de9408 --- /dev/null +++ b/test/122_gendata_h48short/gendata_h48short_tests.c @@ -0,0 +1,61 @@ +#include "../test.h" + +#define MAXPOS 200 + +void h48map_create(h48map_t [static 1], uint64_t, uint64_t); +void h48map_destroy(h48map_t [static 1]); +kvpair_t h48map_nextkvpair(h48map_t [static 1], uint64_t [static 1]); +size_t gendata_cocsep(unsigned char *, uint64_t *, cube_t *); +uint64_t gendata_h48short(gendata_h48short_arg_t [static 1]); + +char str[STRLENMAX]; + +int compare(const void *x, const void *y) { + uint64_t a = ((kvpair_t *)x)->key; + uint64_t b = ((kvpair_t *)y)->key; + + if (a > b) return 1; + if (a == b) return 0; + return -1; +} + +uint64_t readl(void) { + fgets(str, STRLENMAX, stdin); + return atoll(str); +} + +void run(void) { + unsigned char buf[2000000]; + h48map_t map; + uint64_t i, j, capacity, randomizer, selfsim[COCSEP_CLASSES]; + kvpair_t kv, b[MAXPOS]; + gendata_h48short_arg_t arg; + cube_t crep[COCSEP_CLASSES]; + + capacity = readl(); + randomizer = readl(); + arg.maxdepth = readl(); + arg.crep = crep; + arg.selfsim = selfsim; + arg.map = ↦ + + h48map_create(&map, capacity, randomizer); + gendata_cocsep(buf, selfsim, crep); + arg.cocsepdata = (uint32_t *)((char *)buf + INFOSIZE); + gendata_h48short(&arg); + + i = 0; + for (kv = h48map_nextkvpair(&map, &i), j = 0; + i != map.capacity && j < MAXPOS; + kv = h48map_nextkvpair(&map, &i) + ) { + b[j++] = kv; + } + qsort(b, j, sizeof(kvpair_t), compare); + + printf("%" PRIu64 "\n", map.n); + for (i = 0; i < j; i++) + printf("%" PRIu64 " %" PRIu64 "\n", b[i].key, b[i].val); + + h48map_destroy(&map); +} diff --git a/test/130_appendsolution/00_empty.in b/test/130_appendsolution/00_empty.in deleted file mode 100644 index 1100b95..0000000 --- a/test/130_appendsolution/00_empty.in +++ /dev/null @@ -1,5 +0,0 @@ - -0 -1 -rotation UF -0 diff --git a/test/130_appendsolution/00_empty.out b/test/130_appendsolution/00_empty.out deleted file mode 100644 index 8581416..0000000 --- a/test/130_appendsolution/00_empty.out +++ /dev/null @@ -1,4 +0,0 @@ - -Number of solutions: 1 -Shortest solution length: 0 -Used bytes: 1 diff --git a/test/130_appendsolution/01_simple_onlynormal_nounniss.in b/test/130_appendsolution/01_simple_onlynormal_nounniss.in deleted file mode 100644 index fb1eaed..0000000 --- a/test/130_appendsolution/01_simple_onlynormal_nounniss.in +++ /dev/null @@ -1,5 +0,0 @@ -U F R D2 B' -0 -1 -rotation UF -0 diff --git a/test/130_appendsolution/01_simple_onlynormal_nounniss.out b/test/130_appendsolution/01_simple_onlynormal_nounniss.out deleted file mode 100644 index b577962..0000000 --- a/test/130_appendsolution/01_simple_onlynormal_nounniss.out +++ /dev/null @@ -1,4 +0,0 @@ -U F R D2 B' -Number of solutions: 1 -Shortest solution length: 5 -Used bytes: 12 diff --git a/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in b/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in deleted file mode 100644 index db5f074..0000000 --- a/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in +++ /dev/null @@ -1,8 +0,0 @@ -U F R -0 -4 -rotation UF -mirrored UR -rotation BD -mirrored LB -0 diff --git a/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.out b/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.out deleted file mode 100644 index e1b5631..0000000 --- a/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.out +++ /dev/null @@ -1,7 +0,0 @@ -U F R -B D L -U' L' B' -R' B' D' -Number of solutions: 4 -Shortest solution length: 3 -Used bytes: 30 diff --git a/test/130_appendsolution/03_simple_unniss.in b/test/130_appendsolution/03_simple_unniss.in deleted file mode 100644 index 2c5a331..0000000 --- a/test/130_appendsolution/03_simple_unniss.in +++ /dev/null @@ -1,5 +0,0 @@ -U F B2 (R' F D) -1 -1 -rotation UF -0 diff --git a/test/130_appendsolution/03_simple_unniss.out b/test/130_appendsolution/03_simple_unniss.out deleted file mode 100644 index 3ca210e..0000000 --- a/test/130_appendsolution/03_simple_unniss.out +++ /dev/null @@ -1,4 +0,0 @@ -U F B2 D' F' R -Number of solutions: 1 -Shortest solution length: 6 -Used bytes: 15 diff --git a/test/130_appendsolution/04_niss_nounniss.in b/test/130_appendsolution/04_niss_nounniss.in deleted file mode 100644 index b07f970..0000000 --- a/test/130_appendsolution/04_niss_nounniss.in +++ /dev/null @@ -1,5 +0,0 @@ -U F B2 (R' F D) -0 -1 -rotation UF -0 diff --git a/test/130_appendsolution/04_niss_nounniss.out b/test/130_appendsolution/04_niss_nounniss.out deleted file mode 100644 index a616b4c..0000000 --- a/test/130_appendsolution/04_niss_nounniss.out +++ /dev/null @@ -1,4 +0,0 @@ -U F B2 (R' F D) -Number of solutions: 1 -Shortest solution length: 6 -Used bytes: 16 diff --git a/test/130_appendsolution/05_sort_parallel.in b/test/130_appendsolution/05_sort_parallel.in deleted file mode 100644 index bc1cf0f..0000000 --- a/test/130_appendsolution/05_sort_parallel.in +++ /dev/null @@ -1,5 +0,0 @@ -L R' B2 F -0 -1 -rotation UF -0 diff --git a/test/130_appendsolution/05_sort_parallel.out b/test/130_appendsolution/05_sort_parallel.out deleted file mode 100644 index fc09830..0000000 --- a/test/130_appendsolution/05_sort_parallel.out +++ /dev/null @@ -1,4 +0,0 @@ -R' L F B2 -Number of solutions: 1 -Shortest solution length: 4 -Used bytes: 10 diff --git a/test/130_appendsolution/06_unniss_trans_sort.in b/test/130_appendsolution/06_unniss_trans_sort.in deleted file mode 100644 index 2ffab93..0000000 --- a/test/130_appendsolution/06_unniss_trans_sort.in +++ /dev/null @@ -1,5 +0,0 @@ -B (R2 F2) -1 -1 -rotation UR -0 diff --git a/test/130_appendsolution/06_unniss_trans_sort.out b/test/130_appendsolution/06_unniss_trans_sort.out deleted file mode 100644 index 28d7827..0000000 --- a/test/130_appendsolution/06_unniss_trans_sort.out +++ /dev/null @@ -1,4 +0,0 @@ -R2 L B2 -Number of solutions: 1 -Shortest solution length: 3 -Used bytes: 8 diff --git a/test/130_appendsolution/07_unniss_cancel_nosol.in b/test/130_appendsolution/07_unniss_cancel_nosol.in deleted file mode 100644 index 6883d05..0000000 --- a/test/130_appendsolution/07_unniss_cancel_nosol.in +++ /dev/null @@ -1,5 +0,0 @@ -B' F (R2 B2) -1 -1 -rotation UF -0 diff --git a/test/130_appendsolution/07_unniss_cancel_nosol.out b/test/130_appendsolution/07_unniss_cancel_nosol.out deleted file mode 100644 index ed5ea65..0000000 --- a/test/130_appendsolution/07_unniss_cancel_nosol.out +++ /dev/null @@ -1,3 +0,0 @@ -Number of solutions: 0 -Shortest solution length: 21 -Used bytes: 0 diff --git a/test/130_appendsolution/08_unniss_cancel_nosol_v2.in b/test/130_appendsolution/08_unniss_cancel_nosol_v2.in deleted file mode 100644 index 3d461f0..0000000 --- a/test/130_appendsolution/08_unniss_cancel_nosol_v2.in +++ /dev/null @@ -1,5 +0,0 @@ -F' B (R2 F2) -1 -1 -rotation UF -0 diff --git a/test/130_appendsolution/08_unniss_cancel_nosol_v2.out b/test/130_appendsolution/08_unniss_cancel_nosol_v2.out deleted file mode 100644 index ed5ea65..0000000 --- a/test/130_appendsolution/08_unniss_cancel_nosol_v2.out +++ /dev/null @@ -1,3 +0,0 @@ -Number of solutions: 0 -Shortest solution length: 21 -Used bytes: 0 diff --git a/test/130_appendsolution/09_fullinverse_niss.in b/test/130_appendsolution/09_fullinverse_niss.in deleted file mode 100644 index bb2b640..0000000 --- a/test/130_appendsolution/09_fullinverse_niss.in +++ /dev/null @@ -1,5 +0,0 @@ -(F) -0 -1 -rotation UF -0 diff --git a/test/130_appendsolution/09_fullinverse_niss.out b/test/130_appendsolution/09_fullinverse_niss.out deleted file mode 100644 index 9721085..0000000 --- a/test/130_appendsolution/09_fullinverse_niss.out +++ /dev/null @@ -1,4 +0,0 @@ -(F) -Number of solutions: 1 -Shortest solution length: 1 -Used bytes: 4 diff --git a/test/130_appendsolution/10_rotated.in b/test/130_appendsolution/10_rotated.in deleted file mode 100644 index 5210cd5..0000000 --- a/test/130_appendsolution/10_rotated.in +++ /dev/null @@ -1,5 +0,0 @@ -U2 F B L' -1 -1 -rotation UF -7 diff --git a/test/130_appendsolution/10_rotated.out b/test/130_appendsolution/10_rotated.out deleted file mode 100644 index e70b2fe..0000000 --- a/test/130_appendsolution/10_rotated.out +++ /dev/null @@ -1,4 +0,0 @@ -D2 R L F' -Number of solutions: 1 -Shortest solution length: 4 -Used bytes: 10 diff --git a/test/130_appendsolution/appendsolution_tests.c b/test/130_appendsolution/appendsolution_tests.c deleted file mode 100644 index e1b7e98..0000000 --- a/test/130_appendsolution/appendsolution_tests.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -Input format for appendsolution tests: - -moves on normal (with NISS notation) -unniss flag (0=false, 1=true) -number of transformations -transformations, one per line -the orientation of the cube, as a number from 0 to 23 - -See below for the output format. -*/ - -#include "../test.h" - -uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]); -int64_t readmoves(const char *, size_t n, size_t m, - uint64_t *, uint64_t *, uint8_t [n], uint8_t [m]); -void solution_moves_reset(solution_moves_t [static 1]); -bool solution_list_init(solution_list_t [static 1], size_t n, char [n]); -int64_t appendsolution(const solution_moves_t [static 1], - const solution_settings_t [static 1], solution_list_t [static 1], bool, - const char *); - -void run(void) { - int i, ntrans; - int64_t tot; - uint64_t nm, np; - char str[STRLENMAX], buf[STRLENMAX]; - solution_moves_t moves; - solution_settings_t settings; - solution_list_t list; - - solution_moves_reset(&moves); - solution_list_init(&list, STRLENMAX, buf); - settings = (solution_settings_t) { - .tmask = UINT64_C(0), - .unniss = false, - .maxmoves = 20, - .maxsolutions = 100, - .optimal = -1, - }; - - fgets(str, STRLENMAX, stdin); - tot = readmoves(str, 20, 20, &nm, &np, moves.moves, moves.premoves); - if (tot < 0) { - printf("Test error reading moves\n"); - return; - } - moves.nmoves = nm; - moves.npremoves = np; - fgets(str, STRLENMAX, stdin); - settings.unniss = (bool)atoi(str); - fgets(str, STRLENMAX, stdin); - ntrans = atoi(str); - for (i = 0; i < ntrans; i++) { - fgets(str, STRLENMAX, stdin); - settings.tmask |= UINT64_C(1) << (uint64_t)readtrans(str); - } - fgets(str, STRLENMAX, stdin); - settings.orientation = atoi(str); - - appendsolution(&moves, &settings, &list, false, "Test"); - - printf("%s", list.buf); - printf("Number of solutions: %" PRIu64 "\n", list.nsols); - printf("Shortest solution length: %" PRIu8 "\n", list.shortest_sol); - printf("Used bytes: %zu\n", list.used); -} diff --git a/test/130_gendata_eo/00_all.in b/test/130_gendata_eo/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/130_gendata_eo/00_all.out b/test/130_gendata_eo/00_all.out new file mode 100644 index 0000000..42e8c66 --- /dev/null +++ b/test/130_gendata_eo/00_all.out @@ -0,0 +1,12 @@ +1536 +0: 1 +1: 2 +2: 25 +3: 202 +4: 620 +5: 900 +6: 285 +7: 13 +8: 0 +9: 0 +10: 0 diff --git a/test/130_gendata_eo/gendata_eo_tests.c b/test/130_gendata_eo/gendata_eo_tests.c new file mode 100644 index 0000000..1b985c3 --- /dev/null +++ b/test/130_gendata_eo/gendata_eo_tests.c @@ -0,0 +1,38 @@ +/* +Pruning table values (from nissy): +0: 1 +1: 2 +2: 25 +3: 202 +4: 620 +5: 900 +6: 285 +7: 13 +*/ + +#include "../test.h" + +#define ISIZE 512 +#define FULLSIZE (ISIZE + 1024) + +unsigned char buf[FULLSIZE]; + +long long gendata_coord_dispatch( + const char *, unsigned long long, unsigned char *); +int64_t readtableinfo(size_t, const unsigned char *, tableinfo_t *); + +void run(void) { + uint32_t i; + size_t result; + tableinfo_t info; + + result = gendata_coord_dispatch("coord_EO_FB", FULLSIZE, buf); + if (readtableinfo(FULLSIZE, buf, &info) != NISSY_OK) { + printf("Error reading info from table\n"); + return; + } + + printf("%zu\n", result); + for (i = 0; i <= 10; i++) + printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]); +} diff --git a/test/131_coorddata_dr/00_all.in b/test/131_coorddata_dr/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/131_coorddata_dr/00_all.out b/test/131_coorddata_dr/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/131_coorddata_dr/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/131_coorddata_dr/coorddata_dr.c b/test/131_coorddata_dr/coorddata_dr.c new file mode 100644 index 0000000..d8ac94a --- /dev/null +++ b/test/131_coorddata_dr/coorddata_dr.c @@ -0,0 +1,61 @@ +#include "../test.h" + +#define POW_3_7 2187 +#define BOUND (64430 * POW_3_7 / 100) +#define TGROUP UINT64_C(4278190335) + +cube_t transform(cube_t, uint8_t); +uint64_t coordinate_dr_coord(cube_t, const unsigned char *); +cube_t coordinate_dr_cube(uint64_t, const unsigned char *); +size_t coordinate_dr_gendata(unsigned char *); + +void run(void) { + bool found; + uint64_t t; + char str[STRLENMAX]; + unsigned char *data; + size_t size; + cube_t cube; + oriented_cube_t oc; + uint64_t coord, coord2; + + size = coordinate_dr_gendata(NULL); + data = malloc(size); + coordinate_dr_gendata(data); + + for (coord = 0; coord < BOUND; coord++) { + cube = coordinate_dr_cube(coord, data); + + oc = (oriented_cube_t) { .cube = cube, .orientation = 0 }; + if (!isconsistent(oc)) { + printf("Error: invcoord of %" PRId64 + " is not consistent\n", coord); + goto cleanup; + } + + for (t = 0, found = false; t < 48; t++) { + if (!((UINT64_C(1) << t) & TGROUP)) + continue; + + coord2 = coordinate_dr_coord(transform(cube, t), data); + if (coord == coord2) { + found = true; + break; + } + } + + if (!found) { + oc = (oriented_cube_t){.cube = cube, .orientation = 0}; + printf("Error: invcoord of %" PRId64 " returns %" + PRId64 " with cube:\n", coord, coord2); + writecube(oc, STRLENMAX, str); + printf("%s\n", str); + goto cleanup; + } + } + + printf("All good\n"); + +cleanup: + free(data); +} diff --git a/test/132_coorddata_dreo/00_all.in b/test/132_coorddata_dreo/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/132_coorddata_dreo/00_all.out b/test/132_coorddata_dreo/00_all.out new file mode 100644 index 0000000..d6109db --- /dev/null +++ b/test/132_coorddata_dreo/00_all.out @@ -0,0 +1 @@ +All good diff --git a/test/132_coorddata_dreo/coorddata_dreo.c b/test/132_coorddata_dreo/coorddata_dreo.c new file mode 100644 index 0000000..2b99b7f --- /dev/null +++ b/test/132_coorddata_dreo/coorddata_dreo.c @@ -0,0 +1,61 @@ +#include "../test.h" + +#define POW_3_7 2187 +#define BOUND 45 * POW_3_7 +#define TGROUP UINT64_C(4278190335) + +cube_t transform(cube_t, uint8_t); +uint64_t coordinate_dreo_coord(cube_t, const unsigned char *); +cube_t coordinate_dreo_cube(uint64_t, const unsigned char *); +size_t coordinate_dreo_gendata(unsigned char *); + +void run(void) { + bool found; + uint64_t t; + char str[STRLENMAX]; + unsigned char *data; + size_t size; + cube_t cube; + oriented_cube_t oc; + uint64_t coord, coord2; + + size = coordinate_dreo_gendata(NULL); + data = malloc(size); + coordinate_dreo_gendata(data); + + for (coord = 0; coord < BOUND; coord++) { + cube = coordinate_dreo_cube(coord, data); + + oc = (oriented_cube_t) { .cube = cube, .orientation = 0 }; + if (!isconsistent(oc)) { + printf("Error: invcoord of %" PRId64 + " is not consistent\n", coord); + goto cleanup; + } + + for (t = 0, found = false; t < 48; t++) { + if (!((UINT64_C(1) << t) & TGROUP)) + continue; + + coord2 = coordinate_dreo_coord(transform(cube, t), data); + if (coord == coord2) { + found = true; + break; + } + } + + if (!found) { + oc = (oriented_cube_t){.cube = cube, .orientation = 0}; + printf("Error: invcoord of %" PRId64 " returns %" + PRId64 " with cube:\n", coord, coord2); + writecube(oc, STRLENMAX, str); + printf("%s\n", str); + goto cleanup; + } + } + + printf("All good\n"); + +cleanup: + free(data); +} diff --git a/test/140_appendsolution/00_empty.in b/test/140_appendsolution/00_empty.in new file mode 100644 index 0000000..1100b95 --- /dev/null +++ b/test/140_appendsolution/00_empty.in @@ -0,0 +1,5 @@ + +0 +1 +rotation UF +0 diff --git a/test/140_appendsolution/00_empty.out b/test/140_appendsolution/00_empty.out new file mode 100644 index 0000000..8581416 --- /dev/null +++ b/test/140_appendsolution/00_empty.out @@ -0,0 +1,4 @@ + +Number of solutions: 1 +Shortest solution length: 0 +Used bytes: 1 diff --git a/test/140_appendsolution/01_simple_onlynormal_nounniss.in b/test/140_appendsolution/01_simple_onlynormal_nounniss.in new file mode 100644 index 0000000..fb1eaed --- /dev/null +++ b/test/140_appendsolution/01_simple_onlynormal_nounniss.in @@ -0,0 +1,5 @@ +U F R D2 B' +0 +1 +rotation UF +0 diff --git a/test/140_appendsolution/01_simple_onlynormal_nounniss.out b/test/140_appendsolution/01_simple_onlynormal_nounniss.out new file mode 100644 index 0000000..b577962 --- /dev/null +++ b/test/140_appendsolution/01_simple_onlynormal_nounniss.out @@ -0,0 +1,4 @@ +U F R D2 B' +Number of solutions: 1 +Shortest solution length: 5 +Used bytes: 12 diff --git a/test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.in b/test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.in new file mode 100644 index 0000000..db5f074 --- /dev/null +++ b/test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.in @@ -0,0 +1,8 @@ +U F R +0 +4 +rotation UF +mirrored UR +rotation BD +mirrored LB +0 diff --git a/test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.out b/test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.out new file mode 100644 index 0000000..e1b5631 --- /dev/null +++ b/test/140_appendsolution/02_simple_onlynormal_nounnis_multitrans.out @@ -0,0 +1,7 @@ +U F R +B D L +U' L' B' +R' B' D' +Number of solutions: 4 +Shortest solution length: 3 +Used bytes: 30 diff --git a/test/140_appendsolution/03_simple_unniss.in b/test/140_appendsolution/03_simple_unniss.in new file mode 100644 index 0000000..2c5a331 --- /dev/null +++ b/test/140_appendsolution/03_simple_unniss.in @@ -0,0 +1,5 @@ +U F B2 (R' F D) +1 +1 +rotation UF +0 diff --git a/test/140_appendsolution/03_simple_unniss.out b/test/140_appendsolution/03_simple_unniss.out new file mode 100644 index 0000000..3ca210e --- /dev/null +++ b/test/140_appendsolution/03_simple_unniss.out @@ -0,0 +1,4 @@ +U F B2 D' F' R +Number of solutions: 1 +Shortest solution length: 6 +Used bytes: 15 diff --git a/test/140_appendsolution/04_niss_nounniss.in b/test/140_appendsolution/04_niss_nounniss.in new file mode 100644 index 0000000..b07f970 --- /dev/null +++ b/test/140_appendsolution/04_niss_nounniss.in @@ -0,0 +1,5 @@ +U F B2 (R' F D) +0 +1 +rotation UF +0 diff --git a/test/140_appendsolution/04_niss_nounniss.out b/test/140_appendsolution/04_niss_nounniss.out new file mode 100644 index 0000000..a616b4c --- /dev/null +++ b/test/140_appendsolution/04_niss_nounniss.out @@ -0,0 +1,4 @@ +U F B2 (R' F D) +Number of solutions: 1 +Shortest solution length: 6 +Used bytes: 16 diff --git a/test/140_appendsolution/05_sort_parallel.in b/test/140_appendsolution/05_sort_parallel.in new file mode 100644 index 0000000..bc1cf0f --- /dev/null +++ b/test/140_appendsolution/05_sort_parallel.in @@ -0,0 +1,5 @@ +L R' B2 F +0 +1 +rotation UF +0 diff --git a/test/140_appendsolution/05_sort_parallel.out b/test/140_appendsolution/05_sort_parallel.out new file mode 100644 index 0000000..fc09830 --- /dev/null +++ b/test/140_appendsolution/05_sort_parallel.out @@ -0,0 +1,4 @@ +R' L F B2 +Number of solutions: 1 +Shortest solution length: 4 +Used bytes: 10 diff --git a/test/140_appendsolution/06_unniss_trans_sort.in b/test/140_appendsolution/06_unniss_trans_sort.in new file mode 100644 index 0000000..2ffab93 --- /dev/null +++ b/test/140_appendsolution/06_unniss_trans_sort.in @@ -0,0 +1,5 @@ +B (R2 F2) +1 +1 +rotation UR +0 diff --git a/test/140_appendsolution/06_unniss_trans_sort.out b/test/140_appendsolution/06_unniss_trans_sort.out new file mode 100644 index 0000000..28d7827 --- /dev/null +++ b/test/140_appendsolution/06_unniss_trans_sort.out @@ -0,0 +1,4 @@ +R2 L B2 +Number of solutions: 1 +Shortest solution length: 3 +Used bytes: 8 diff --git a/test/140_appendsolution/07_unniss_cancel_nosol.in b/test/140_appendsolution/07_unniss_cancel_nosol.in new file mode 100644 index 0000000..6883d05 --- /dev/null +++ b/test/140_appendsolution/07_unniss_cancel_nosol.in @@ -0,0 +1,5 @@ +B' F (R2 B2) +1 +1 +rotation UF +0 diff --git a/test/140_appendsolution/07_unniss_cancel_nosol.out b/test/140_appendsolution/07_unniss_cancel_nosol.out new file mode 100644 index 0000000..ed5ea65 --- /dev/null +++ b/test/140_appendsolution/07_unniss_cancel_nosol.out @@ -0,0 +1,3 @@ +Number of solutions: 0 +Shortest solution length: 21 +Used bytes: 0 diff --git a/test/140_appendsolution/08_unniss_cancel_nosol_v2.in b/test/140_appendsolution/08_unniss_cancel_nosol_v2.in new file mode 100644 index 0000000..3d461f0 --- /dev/null +++ b/test/140_appendsolution/08_unniss_cancel_nosol_v2.in @@ -0,0 +1,5 @@ +F' B (R2 F2) +1 +1 +rotation UF +0 diff --git a/test/140_appendsolution/08_unniss_cancel_nosol_v2.out b/test/140_appendsolution/08_unniss_cancel_nosol_v2.out new file mode 100644 index 0000000..ed5ea65 --- /dev/null +++ b/test/140_appendsolution/08_unniss_cancel_nosol_v2.out @@ -0,0 +1,3 @@ +Number of solutions: 0 +Shortest solution length: 21 +Used bytes: 0 diff --git a/test/140_appendsolution/09_fullinverse_niss.in b/test/140_appendsolution/09_fullinverse_niss.in new file mode 100644 index 0000000..bb2b640 --- /dev/null +++ b/test/140_appendsolution/09_fullinverse_niss.in @@ -0,0 +1,5 @@ +(F) +0 +1 +rotation UF +0 diff --git a/test/140_appendsolution/09_fullinverse_niss.out b/test/140_appendsolution/09_fullinverse_niss.out new file mode 100644 index 0000000..9721085 --- /dev/null +++ b/test/140_appendsolution/09_fullinverse_niss.out @@ -0,0 +1,4 @@ +(F) +Number of solutions: 1 +Shortest solution length: 1 +Used bytes: 4 diff --git a/test/140_appendsolution/10_rotated.in b/test/140_appendsolution/10_rotated.in new file mode 100644 index 0000000..5210cd5 --- /dev/null +++ b/test/140_appendsolution/10_rotated.in @@ -0,0 +1,5 @@ +U2 F B L' +1 +1 +rotation UF +7 diff --git a/test/140_appendsolution/10_rotated.out b/test/140_appendsolution/10_rotated.out new file mode 100644 index 0000000..e70b2fe --- /dev/null +++ b/test/140_appendsolution/10_rotated.out @@ -0,0 +1,4 @@ +D2 R L F' +Number of solutions: 1 +Shortest solution length: 4 +Used bytes: 10 diff --git a/test/140_appendsolution/appendsolution_tests.c b/test/140_appendsolution/appendsolution_tests.c new file mode 100644 index 0000000..e1b7e98 --- /dev/null +++ b/test/140_appendsolution/appendsolution_tests.c @@ -0,0 +1,68 @@ +/* +Input format for appendsolution tests: + +moves on normal (with NISS notation) +unniss flag (0=false, 1=true) +number of transformations +transformations, one per line +the orientation of the cube, as a number from 0 to 23 + +See below for the output format. +*/ + +#include "../test.h" + +uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]); +int64_t readmoves(const char *, size_t n, size_t m, + uint64_t *, uint64_t *, uint8_t [n], uint8_t [m]); +void solution_moves_reset(solution_moves_t [static 1]); +bool solution_list_init(solution_list_t [static 1], size_t n, char [n]); +int64_t appendsolution(const solution_moves_t [static 1], + const solution_settings_t [static 1], solution_list_t [static 1], bool, + const char *); + +void run(void) { + int i, ntrans; + int64_t tot; + uint64_t nm, np; + char str[STRLENMAX], buf[STRLENMAX]; + solution_moves_t moves; + solution_settings_t settings; + solution_list_t list; + + solution_moves_reset(&moves); + solution_list_init(&list, STRLENMAX, buf); + settings = (solution_settings_t) { + .tmask = UINT64_C(0), + .unniss = false, + .maxmoves = 20, + .maxsolutions = 100, + .optimal = -1, + }; + + fgets(str, STRLENMAX, stdin); + tot = readmoves(str, 20, 20, &nm, &np, moves.moves, moves.premoves); + if (tot < 0) { + printf("Test error reading moves\n"); + return; + } + moves.nmoves = nm; + moves.npremoves = np; + fgets(str, STRLENMAX, stdin); + settings.unniss = (bool)atoi(str); + fgets(str, STRLENMAX, stdin); + ntrans = atoi(str); + for (i = 0; i < ntrans; i++) { + fgets(str, STRLENMAX, stdin); + settings.tmask |= UINT64_C(1) << (uint64_t)readtrans(str); + } + fgets(str, STRLENMAX, stdin); + settings.orientation = atoi(str); + + appendsolution(&moves, &settings, &list, false, "Test"); + + printf("%s", list.buf); + printf("Number of solutions: %" PRIu64 "\n", list.nsols); + printf("Shortest solution length: %" PRIu8 "\n", list.shortest_sol); + printf("Used bytes: %zu\n", list.used); +} -- cgit v1.3