From 2e8739ed2c166588bc14e7460660f1c940b9ff1e Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Wed, 24 Sep 2025 23:48:57 -0400 Subject: [PATCH 01/32] Move comments around --- src/clue-matches-tests.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index d1431aad..c657db3b 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -86,6 +86,11 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) return word_array; } + +/* Performance tests */ + +/* IPUZ tests */ + static void test_clue_matches (WordList *word_list, IpuzGrid *grid, @@ -104,9 +109,6 @@ test_clue_matches (WordList *word_list, g_assert_true (word_array_equals (clue_matches, expected_word_array)); } - -/* Tests */ - #define ASSERT_CLUE_MATCHES(DIRECTION, INDEX, ...) \ test_clue_matches (fixture->word_list, \ fixture->grid, \ @@ -186,6 +188,9 @@ test_duplicate_words_ipuz (Fixture *fixture, gconstpointer user_data) } */ + +/* Add tests*/ + #define ADD_IPUZ_TEST(test_name, file_name) \ g_test_add ("/clue_matches/" #test_name, \ Fixture, \ @@ -194,7 +199,6 @@ test_duplicate_words_ipuz (Fixture *fixture, gconstpointer user_data) test_name, \ fixture_tear_down) -/* FIXME(tests): Measure performance. */ int main (int argc, char **argv) { -- GitLab From 5e44d866c3ba0e2593a69aad1e768765fed8b101 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Wed, 24 Sep 2025 23:57:52 -0400 Subject: [PATCH 02/32] Add skeleton code --- src/clue-matches-tests.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index c657db3b..abd4cf83 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -89,6 +89,15 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) /* Performance tests */ +static void +test_performance (Fixture *fixture, gconstpointer user_data) +{ + const IpuzClue *clue = NULL; + + clue = get_clue (fixture->grid, IPUZ_CLUE_DIRECTION_ACROSS, 0); + word_array_print (word_list_find_clue_matches (fixture->word_list, clue, fixture->grid)); +} + /* IPUZ tests */ static void @@ -213,5 +222,12 @@ main (int argc, char **argv) ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); + g_test_add ("/clue_matches/test_performance", + Fixture, + "tests/clue-matches/simple-across.ipuz", + fixture_set_up, + test_performance, + fixture_tear_down); + return g_test_run (); } -- GitLab From af942b4470216f8a4a4ec9fdaae05a538dee9ef5 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 02:04:51 -0400 Subject: [PATCH 03/32] Add basic timer code --- src/clue-matches-tests.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index abd4cf83..a9d12005 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -93,9 +93,13 @@ static void test_performance (Fixture *fixture, gconstpointer user_data) { const IpuzClue *clue = NULL; + g_autoptr(GTimer) timer = g_timer_new(); clue = get_clue (fixture->grid, IPUZ_CLUE_DIRECTION_ACROSS, 0); - word_array_print (word_list_find_clue_matches (fixture->word_list, clue, fixture->grid)); + g_timer_start (timer); + word_list_find_clue_matches (fixture->word_list, clue, fixture->grid); + g_timer_stop (timer); + g_message ("%s: %f\n", G_STRFUNC, g_timer_elapsed (timer, NULL)); } /* IPUZ tests */ -- GitLab From 53ba6c841dbcbbac970e01c32e9a5c5491d2629b Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 02:37:25 -0400 Subject: [PATCH 04/32] Iterate through every clue --- src/clue-matches-tests.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index a9d12005..4f4503b7 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -89,19 +89,28 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) /* Performance tests */ +static void foreach_func (IpuzClues* clues, + IpuzClueDirection direction, + IpuzClue* clue, + IpuzClueId* clue_id, + gpointer user_data) +{ + WordList *word_list = WORD_LIST (user_data); + word_array_print (word_list_find_clue_matches (word_list, clue, IPUZ_GRID (clues))); +} + static void test_performance (Fixture *fixture, gconstpointer user_data) { - const IpuzClue *clue = NULL; g_autoptr(GTimer) timer = g_timer_new(); - clue = get_clue (fixture->grid, IPUZ_CLUE_DIRECTION_ACROSS, 0); g_timer_start (timer); - word_list_find_clue_matches (fixture->word_list, clue, fixture->grid); + ipuz_clues_foreach_clue (IPUZ_CLUES (fixture->grid), foreach_func, fixture->word_list); g_timer_stop (timer); g_message ("%s: %f\n", G_STRFUNC, g_timer_elapsed (timer, NULL)); } + /* IPUZ tests */ static void -- GitLab From 81e7bbf569ad96208ef3cbd9898ab57e2bd9bc95 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 03:19:02 -0400 Subject: [PATCH 05/32] Start and stop timer inside the foreach func --- src/clue-matches-tests.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 4f4503b7..af958d68 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -31,6 +31,7 @@ typedef struct { WordList *word_list; IpuzGrid *grid; + GTimer *timer; } Fixture; static IpuzGrid* @@ -51,6 +52,8 @@ static void fixture_set_up (Fixture *fixture, gconstpointer user_data) static void fixture_tear_down (Fixture *fixture, gconstpointer user_data) { g_object_unref (fixture->word_list); + if (fixture->timer != NULL) + g_timer_destroy (fixture->timer); /* If I try to free the grid: * g_object_unref (fixture->grid); @@ -89,25 +92,30 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) /* Performance tests */ +// TODO: Repeated average. static void foreach_func (IpuzClues* clues, IpuzClueDirection direction, IpuzClue* clue, IpuzClueId* clue_id, gpointer user_data) { - WordList *word_list = WORD_LIST (user_data); - word_array_print (word_list_find_clue_matches (word_list, clue, IPUZ_GRID (clues))); + Fixture *fixture = (Fixture *) user_data; + + if (fixture->timer == NULL) + fixture->timer = g_timer_new (); + else + g_timer_continue (fixture->timer); + + word_list_find_clue_matches (fixture->word_list, clue, IPUZ_GRID (clues)); + g_timer_stop (fixture->timer); } static void test_performance (Fixture *fixture, gconstpointer user_data) { - g_autoptr(GTimer) timer = g_timer_new(); - - g_timer_start (timer); - ipuz_clues_foreach_clue (IPUZ_CLUES (fixture->grid), foreach_func, fixture->word_list); - g_timer_stop (timer); - g_message ("%s: %f\n", G_STRFUNC, g_timer_elapsed (timer, NULL)); + g_assert_null (fixture->timer); + ipuz_clues_foreach_clue (IPUZ_CLUES (fixture->grid), foreach_func, fixture); + g_message ("%s: %f\n", G_STRFUNC, g_timer_elapsed (fixture->timer, NULL)); } -- GitLab From cf65c9fc60ce41c2a186a32426813d7dee862ae1 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 03:34:59 -0400 Subject: [PATCH 06/32] Clean up code --- src/clue-matches-tests.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index af958d68..c67dd382 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -52,6 +52,7 @@ static void fixture_set_up (Fixture *fixture, gconstpointer user_data) static void fixture_tear_down (Fixture *fixture, gconstpointer user_data) { g_object_unref (fixture->word_list); + if (fixture->timer != NULL) g_timer_destroy (fixture->timer); @@ -93,28 +94,30 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) /* Performance tests */ // TODO: Repeated average. -static void foreach_func (IpuzClues* clues, - IpuzClueDirection direction, - IpuzClue* clue, - IpuzClueId* clue_id, - gpointer user_data) +static void foreach_clue_func (IpuzClues* clues, + IpuzClueDirection direction, + IpuzClue* clue, + IpuzClueId* clue_id, + gpointer user_data) { Fixture *fixture = (Fixture *) user_data; + WordList *word_list = fixture->word_list; if (fixture->timer == NULL) fixture->timer = g_timer_new (); else g_timer_continue (fixture->timer); - word_list_find_clue_matches (fixture->word_list, clue, IPUZ_GRID (clues)); + word_list_find_clue_matches (word_list, clue, IPUZ_GRID (clues)); g_timer_stop (fixture->timer); } static void test_performance (Fixture *fixture, gconstpointer user_data) { + IpuzGrid *grid = fixture->grid; g_assert_null (fixture->timer); - ipuz_clues_foreach_clue (IPUZ_CLUES (fixture->grid), foreach_func, fixture); + ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); g_message ("%s: %f\n", G_STRFUNC, g_timer_elapsed (fixture->timer, NULL)); } -- GitLab From 758ca7f9557a98937363517be41133ae9713a0a5 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 03:45:15 -0400 Subject: [PATCH 07/32] Use multiple test runs to improve accuracy --- src/clue-matches-tests.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index c67dd382..dad84eaf 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -93,7 +93,6 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) /* Performance tests */ -// TODO: Repeated average. static void foreach_clue_func (IpuzClues* clues, IpuzClueDirection direction, IpuzClue* clue, @@ -112,13 +111,19 @@ static void foreach_clue_func (IpuzClues* clues, g_timer_stop (fixture->timer); } +#define NUM_RUNS 3 static void test_performance (Fixture *fixture, gconstpointer user_data) { IpuzGrid *grid = fixture->grid; + gfloat average_time; g_assert_null (fixture->timer); - ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); - g_message ("%s: %f\n", G_STRFUNC, g_timer_elapsed (fixture->timer, NULL)); + + for (guint i = 0; i < NUM_RUNS; i++) + ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); + average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; + + g_message ("%s: %f\n", G_STRFUNC, average_time); } -- GitLab From f411006911f61db2af3eeae9292a31711b1fe554 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 03:53:59 -0400 Subject: [PATCH 08/32] Use macro for test function definition --- src/clue-matches-tests.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index dad84eaf..39d0b9a3 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -113,7 +113,7 @@ static void foreach_clue_func (IpuzClues* clues, #define NUM_RUNS 3 static void -test_performance (Fixture *fixture, gconstpointer user_data) +test_performance (Fixture *fixture) { IpuzGrid *grid = fixture->grid; gfloat average_time; @@ -126,6 +126,15 @@ test_performance (Fixture *fixture, gconstpointer user_data) g_message ("%s: %f\n", G_STRFUNC, average_time); } +#define DEFINE_PERFORMANCE_TEST(NAME) \ + static void \ + NAME (Fixture *fixture, gconstpointer user_data) \ + { \ + test_performance (fixture); \ + } \ + +DEFINE_PERFORMANCE_TEST (test_performance_basic); + /* IPUZ tests */ @@ -251,11 +260,11 @@ main (int argc, char **argv) ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); - g_test_add ("/clue_matches/test_performance", + g_test_add ("/clue_matches/test_performance_basic", Fixture, "tests/clue-matches/simple-across.ipuz", fixture_set_up, - test_performance, + test_performance_basic, fixture_tear_down); return g_test_run (); -- GitLab From a37800bb8567af2bcca6b50fbac2941d79b63987 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 03:56:56 -0400 Subject: [PATCH 09/32] Move performance test code down --- src/clue-matches-tests.c | 90 ++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 39d0b9a3..82ea51e2 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -91,51 +91,6 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) } -/* Performance tests */ - -static void foreach_clue_func (IpuzClues* clues, - IpuzClueDirection direction, - IpuzClue* clue, - IpuzClueId* clue_id, - gpointer user_data) -{ - Fixture *fixture = (Fixture *) user_data; - WordList *word_list = fixture->word_list; - - if (fixture->timer == NULL) - fixture->timer = g_timer_new (); - else - g_timer_continue (fixture->timer); - - word_list_find_clue_matches (word_list, clue, IPUZ_GRID (clues)); - g_timer_stop (fixture->timer); -} - -#define NUM_RUNS 3 -static void -test_performance (Fixture *fixture) -{ - IpuzGrid *grid = fixture->grid; - gfloat average_time; - g_assert_null (fixture->timer); - - for (guint i = 0; i < NUM_RUNS; i++) - ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); - average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; - - g_message ("%s: %f\n", G_STRFUNC, average_time); -} - -#define DEFINE_PERFORMANCE_TEST(NAME) \ - static void \ - NAME (Fixture *fixture, gconstpointer user_data) \ - { \ - test_performance (fixture); \ - } \ - -DEFINE_PERFORMANCE_TEST (test_performance_basic); - - /* IPUZ tests */ static void @@ -236,6 +191,51 @@ test_duplicate_words_ipuz (Fixture *fixture, gconstpointer user_data) */ +/* Performance tests */ + +static void foreach_clue_func (IpuzClues* clues, + IpuzClueDirection direction, + IpuzClue* clue, + IpuzClueId* clue_id, + gpointer user_data) +{ + Fixture *fixture = (Fixture *) user_data; + WordList *word_list = fixture->word_list; + + if (fixture->timer == NULL) + fixture->timer = g_timer_new (); + else + g_timer_continue (fixture->timer); + + word_list_find_clue_matches (word_list, clue, IPUZ_GRID (clues)); + g_timer_stop (fixture->timer); +} + +#define NUM_RUNS 3 +static void +test_performance (Fixture *fixture) +{ + IpuzGrid *grid = fixture->grid; + gfloat average_time; + g_assert_null (fixture->timer); + + for (guint i = 0; i < NUM_RUNS; i++) + ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); + average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; + + g_message ("%s: %f\n", G_STRFUNC, average_time); +} + +#define DEFINE_PERFORMANCE_TEST(NAME) \ + static void \ + NAME (Fixture *fixture, gconstpointer user_data) \ + { \ + test_performance (fixture); \ + } \ + +DEFINE_PERFORMANCE_TEST (test_performance_basic); + + /* Add tests*/ #define ADD_IPUZ_TEST(test_name, file_name) \ -- GitLab From 4e2a4bff69cc9f2aa19d6425a279aa6196444e5e Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 04:01:53 -0400 Subject: [PATCH 10/32] Add macro to register performance tests --- src/clue-matches-tests.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 82ea51e2..879e9e7b 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -246,6 +246,14 @@ DEFINE_PERFORMANCE_TEST (test_performance_basic); test_name, \ fixture_tear_down) +#define ADD_PERFORMANCE_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + Fixture, \ + "tests/clue-matches/" file_name, \ + fixture_set_up, \ + test_name, \ + fixture_tear_down) + int main (int argc, char **argv) { @@ -260,12 +268,7 @@ main (int argc, char **argv) ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); - g_test_add ("/clue_matches/test_performance_basic", - Fixture, - "tests/clue-matches/simple-across.ipuz", - fixture_set_up, - test_performance_basic, - fixture_tear_down); + ADD_PERFORMANCE_TEST (test_performance_basic, "simple-across.ipuz"); return g_test_run (); } -- GitLab From acfcaa0446daf2a89f6605e8a9ce665ac5890f87 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 23:00:52 -0400 Subject: [PATCH 11/32] Add FIXME --- src/clue-matches-tests.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 879e9e7b..1637d52c 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -259,6 +259,7 @@ main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); + /* FIXME: Use separate subdirs. */ ADD_IPUZ_TEST (test_simple_across_ipuz, "simple-across.ipuz"); ADD_IPUZ_TEST (test_simple_down_ipuz, "simple-down.ipuz"); ADD_IPUZ_TEST (test_valid_intersection_ipuz, "valid-intersection.ipuz"); -- GitLab From a5ac43fc19a840e7b985bc9dfdea44d743d09030 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 23:08:52 -0400 Subject: [PATCH 12/32] Create subdir for performance test IPUZ files --- src/clue-matches-tests.c | 16 +-- .../clue-matches/performance-tests/empty.ipuz | 106 ++++++++++++++++++ 2 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 src/tests/clue-matches/performance-tests/empty.ipuz diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 1637d52c..eaffb552 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -233,7 +233,7 @@ test_performance (Fixture *fixture) test_performance (fixture); \ } \ -DEFINE_PERFORMANCE_TEST (test_performance_basic); +DEFINE_PERFORMANCE_TEST (test_performance_empty); /* Add tests*/ @@ -246,12 +246,12 @@ DEFINE_PERFORMANCE_TEST (test_performance_basic); test_name, \ fixture_tear_down) -#define ADD_PERFORMANCE_TEST(test_name, file_name) \ - g_test_add ("/clue_matches/" #test_name, \ - Fixture, \ - "tests/clue-matches/" file_name, \ - fixture_set_up, \ - test_name, \ +#define ADD_PERFORMANCE_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + Fixture, \ + "tests/clue-matches/performance-tests/" file_name, \ + fixture_set_up, \ + test_name, \ fixture_tear_down) int @@ -269,7 +269,7 @@ main (int argc, char **argv) ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); - ADD_PERFORMANCE_TEST (test_performance_basic, "simple-across.ipuz"); + ADD_PERFORMANCE_TEST (test_performance_empty, "empty.ipuz"); return g_test_run (); } diff --git a/src/tests/clue-matches/performance-tests/empty.ipuz b/src/tests/clue-matches/performance-tests/empty.ipuz new file mode 100644 index 00000000..4938879f --- /dev/null +++ b/src/tests/clue-matches/performance-tests/empty.ipuz @@ -0,0 +1,106 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword-1", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 4, + "height" : 4 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4 + ], + [ + 5, + 0, + 0, + 0 + ], + [ + 6, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null + ], + [ + null, + null, + null, + null + ], + [ + null, + null, + null, + null + ], + [ + null, + null, + null, + null + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ] + ] + } +} \ No newline at end of file -- GitLab From 719a173511415e48bd4b403a777b4f621763b4af Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Thu, 25 Sep 2025 23:29:09 -0400 Subject: [PATCH 13/32] Add MAX_TIME to performance test --- src/clue-matches-tests.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index eaffb552..4e8800a3 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -213,7 +213,7 @@ static void foreach_clue_func (IpuzClues* clues, #define NUM_RUNS 3 static void -test_performance (Fixture *fixture) +test_performance (Fixture *fixture, gfloat max_time) { IpuzGrid *grid = fixture->grid; gfloat average_time; @@ -224,16 +224,20 @@ test_performance (Fixture *fixture) average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; g_message ("%s: %f\n", G_STRFUNC, average_time); + g_assert_cmpfloat (average_time, <=, max_time); } -#define DEFINE_PERFORMANCE_TEST(NAME) \ +#define DEFINE_PERFORMANCE_TEST(NAME, MAX_TIME) \ static void \ NAME (Fixture *fixture, gconstpointer user_data) \ { \ - test_performance (fixture); \ - } \ + if (MAX_TIME == -1) \ + test_performance (fixture, FLT_MAX); \ + else \ + test_performance (fixture, MAX_TIME); \ + } -DEFINE_PERFORMANCE_TEST (test_performance_empty); +DEFINE_PERFORMANCE_TEST (test_performance_empty, -1); /* Add tests*/ -- GitLab From d1f627661d549f6acf64422a2a984a2d50e71dd0 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 26 Sep 2025 03:15:13 -0400 Subject: [PATCH 14/32] Add American test crosswords --- src/clue-matches-tests.c | 31 +- .../performance-tests/american-empty.ipuz | 856 ++++++++++++++++++ .../performance-tests/american-full.ipuz | 856 ++++++++++++++++++ .../performance-tests/american-half.ipuz | 856 ++++++++++++++++++ .../performance-tests/american-most.ipuz | 856 ++++++++++++++++++ .../performance-tests/american-sparse.ipuz | 856 ++++++++++++++++++ .../performance-tests/empty-grid.ipuz | 656 ++++++++++++++ .../clue-matches/performance-tests/empty.ipuz | 106 --- 8 files changed, 4956 insertions(+), 117 deletions(-) create mode 100644 src/tests/clue-matches/performance-tests/american-empty.ipuz create mode 100644 src/tests/clue-matches/performance-tests/american-full.ipuz create mode 100644 src/tests/clue-matches/performance-tests/american-half.ipuz create mode 100644 src/tests/clue-matches/performance-tests/american-most.ipuz create mode 100644 src/tests/clue-matches/performance-tests/american-sparse.ipuz create mode 100644 src/tests/clue-matches/performance-tests/empty-grid.ipuz delete mode 100644 src/tests/clue-matches/performance-tests/empty.ipuz diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 4e8800a3..18bdcd1b 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -238,7 +238,11 @@ test_performance (Fixture *fixture, gfloat max_time) } DEFINE_PERFORMANCE_TEST (test_performance_empty, -1); - +DEFINE_PERFORMANCE_TEST (test_american_empty, -1); +DEFINE_PERFORMANCE_TEST (test_american_sparse, -1); +DEFINE_PERFORMANCE_TEST (test_american_half, -1); +DEFINE_PERFORMANCE_TEST (test_american_most, -1); +DEFINE_PERFORMANCE_TEST (test_american_full, -1); /* Add tests*/ @@ -264,16 +268,21 @@ main (int argc, char **argv) g_test_init (&argc, &argv, NULL); /* FIXME: Use separate subdirs. */ - ADD_IPUZ_TEST (test_simple_across_ipuz, "simple-across.ipuz"); - ADD_IPUZ_TEST (test_simple_down_ipuz, "simple-down.ipuz"); - ADD_IPUZ_TEST (test_valid_intersection_ipuz, "valid-intersection.ipuz"); - ADD_IPUZ_TEST (test_invalid_intersection_ipuz, "invalid-intersection.ipuz"); - ADD_IPUZ_TEST (test_dense_ipuz, "dense.ipuz"); - ADD_IPUZ_TEST (test_block_cells_ipuz, "block-cells.ipuz"); - ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); - ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); - - ADD_PERFORMANCE_TEST (test_performance_empty, "empty.ipuz"); + ADD_IPUZ_TEST (test_simple_across_ipuz, "simple-across.ipuz"); + ADD_IPUZ_TEST (test_simple_down_ipuz, "simple-down.ipuz"); + ADD_IPUZ_TEST (test_valid_intersection_ipuz, "valid-intersection.ipuz"); + ADD_IPUZ_TEST (test_invalid_intersection_ipuz, "invalid-intersection.ipuz"); + ADD_IPUZ_TEST (test_dense_ipuz, "dense.ipuz"); + ADD_IPUZ_TEST (test_block_cells_ipuz, "block-cells.ipuz"); + ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); + ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); + + ADD_PERFORMANCE_TEST (test_performance_empty, "empty-grid.ipuz"); + ADD_PERFORMANCE_TEST (test_american_empty, "american-empty.ipuz"); + ADD_PERFORMANCE_TEST (test_american_sparse, "american-sparse.ipuz"); + ADD_PERFORMANCE_TEST (test_american_half, "american-half.ipuz"); + ADD_PERFORMANCE_TEST (test_american_most, "american-most.ipuz"); + ADD_PERFORMANCE_TEST (test_american_full, "american-full.ipuz"); return g_test_run (); } diff --git a/src/tests/clue-matches/performance-tests/american-empty.ipuz b/src/tests/clue-matches/performance-tests/american-empty.ipuz new file mode 100644 index 00000000..9cd1e90b --- /dev/null +++ b/src/tests/clue-matches/performance-tests/american-empty.ipuz @@ -0,0 +1,856 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : " 0 ", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + "#", + 5, + 6, + 7, + 8, + "#", + 9, + 10, + 11, + 12, + 13 + ], + [ + 14, + 0, + 0, + 0, + "#", + 15, + 0, + 0, + 0, + "#", + 16, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + "#", + 18, + 0, + 0, + 0, + "#", + 19, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 21, + "#", + 22, + 0, + 0, + "#", + 23, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 25, + "#", + "#", + 26, + 27, + 0, + 0, + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + "#", + 28, + 0, + 29, + 30, + "#", + 31, + 0, + 0, + 32, + 33, + 34 + ], + [ + 35, + 36, + 37, + 38, + "#", + 39, + 0, + 0, + 40, + 0, + "#", + 41, + 0, + 0, + 0 + ], + [ + 42, + 0, + 0, + 0, + "#", + 43, + 0, + 0, + 0, + 0, + "#", + 44, + 0, + 0, + 0 + ], + [ + 45, + 0, + 0, + 0, + "#", + 46, + 0, + 0, + 0, + 0, + "#", + 47, + 0, + 0, + 0 + ], + [ + 48, + 0, + 0, + 0, + 49, + 0, + "#", + 50, + 0, + 0, + 51, + "#", + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + 52, + 0, + 0, + 53, + "#", + "#", + 54, + 0, + 55, + 56, + 57, + 58 + ], + [ + 59, + 60, + 61, + 0, + 0, + "#", + 62, + 63, + 64, + "#", + 65, + 0, + 0, + 0, + 0 + ], + [ + 66, + 0, + 0, + 0, + 0, + "#", + 67, + 0, + 0, + 68, + "#", + 69, + 0, + 0, + 0 + ], + [ + 70, + 0, + 0, + 0, + 0, + "#", + 71, + 0, + 0, + 0, + "#", + 72, + 0, + 0, + 0 + ], + [ + 73, + 0, + 0, + 0, + 0, + "#", + 74, + 0, + 0, + 0, + "#", + 75, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 5, + null + ], + [ + 9, + null + ], + [ + 14, + null + ], + [ + 15, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 26, + null + ], + [ + 28, + null + ], + [ + 31, + null + ], + [ + 35, + null + ], + [ + 39, + null + ], + [ + 41, + null + ], + [ + 42, + null + ], + [ + 43, + null + ], + [ + 44, + null + ], + [ + 45, + null + ], + [ + 46, + null + ], + [ + 47, + null + ], + [ + 48, + null + ], + [ + 50, + null + ], + [ + 52, + null + ], + [ + 54, + null + ], + [ + 59, + null + ], + [ + 62, + null + ], + [ + 65, + null + ], + [ + 66, + null + ], + [ + 67, + null + ], + [ + 69, + null + ], + [ + 70, + null + ], + [ + 71, + null + ], + [ + 72, + null + ], + [ + 73, + null + ], + [ + 74, + null + ], + [ + 75, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 21, + null + ], + [ + 25, + null + ], + [ + 27, + null + ], + [ + 29, + null + ], + [ + 30, + null + ], + [ + 32, + null + ], + [ + 33, + null + ], + [ + 34, + null + ], + [ + 35, + null + ], + [ + 36, + null + ], + [ + 37, + null + ], + [ + 38, + null + ], + [ + 40, + null + ], + [ + 49, + null + ], + [ + 51, + null + ], + [ + 53, + null + ], + [ + 55, + null + ], + [ + 56, + null + ], + [ + 57, + null + ], + [ + 58, + null + ], + [ + 59, + null + ], + [ + 60, + null + ], + [ + 61, + null + ], + [ + 63, + null + ], + [ + 64, + null + ], + [ + 68, + null + ] + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/american-full.ipuz b/src/tests/clue-matches/performance-tests/american-full.ipuz new file mode 100644 index 00000000..0ea67ac6 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/american-full.ipuz @@ -0,0 +1,856 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : " 0 ", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + "#", + 5, + 6, + 7, + 8, + "#", + 9, + 10, + 11, + 12, + 13 + ], + [ + 14, + 0, + 0, + 0, + "#", + 15, + 0, + 0, + 0, + "#", + 16, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + "#", + 18, + 0, + 0, + 0, + "#", + 19, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 21, + "#", + 22, + 0, + 0, + "#", + 23, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 25, + "#", + "#", + 26, + 27, + 0, + 0, + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + "#", + 28, + 0, + 29, + 30, + "#", + 31, + 0, + 0, + 32, + 33, + 34 + ], + [ + 35, + 36, + 37, + 38, + "#", + 39, + 0, + 0, + 40, + 0, + "#", + 41, + 0, + 0, + 0 + ], + [ + 42, + 0, + 0, + 0, + "#", + 43, + 0, + 0, + 0, + 0, + "#", + 44, + 0, + 0, + 0 + ], + [ + 45, + 0, + 0, + 0, + "#", + 46, + 0, + 0, + 0, + 0, + "#", + 47, + 0, + 0, + 0 + ], + [ + 48, + 0, + 0, + 0, + 49, + 0, + "#", + 50, + 0, + 0, + 51, + "#", + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + 52, + 0, + 0, + 53, + "#", + "#", + 54, + 0, + 55, + 56, + 57, + 58 + ], + [ + 59, + 60, + 61, + 0, + 0, + "#", + 62, + 63, + 64, + "#", + 65, + 0, + 0, + 0, + 0 + ], + [ + 66, + 0, + 0, + 0, + 0, + "#", + 67, + 0, + 0, + 68, + "#", + 69, + 0, + 0, + 0 + ], + [ + 70, + 0, + 0, + 0, + 0, + "#", + 71, + 0, + 0, + 0, + "#", + 72, + 0, + 0, + 0 + ], + [ + 73, + 0, + 0, + 0, + 0, + "#", + 74, + 0, + 0, + 0, + "#", + 75, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + "S", + "O", + "A", + "S", + null, + "D", + "A", + "A", + "E", + null, + "S", + "N", + "A", + "P", + "S" + ], + [ + "T", + "O", + "N", + "E", + null, + "I", + "A", + "A", + "S", + null, + "A", + "O", + "R", + "T", + "A" + ], + [ + "I", + "O", + "A", + "N", + null, + "S", + "A", + "R", + "S", + null, + "T", + "O", + "N", + "E", + "R" + ], + [ + "E", + "L", + "I", + "E", + "S", + null, + "S", + "E", + "E", + null, + "A", + "N", + "E", + "R", + "A" + ], + [ + "S", + "A", + "S", + "S", + "E", + "S", + null, + null, + "S", + "A", + "N", + "E", + null, + null, + null + ], + [ + null, + null, + null, + null, + "S", + "E", + "S", + "S", + null, + "T", + "S", + "E", + "T", + "S", + "E" + ], + [ + "S", + "I", + "S", + "S", + null, + "S", + "E", + "R", + "T", + "A", + null, + "L", + "E", + "E", + "R" + ], + [ + "I", + "E", + "A", + "T", + null, + "A", + "E", + "T", + "A", + "T", + null, + "S", + "O", + "R", + "E" + ], + [ + "R", + "E", + "N", + "A", + null, + "M", + "A", + "A", + "E", + "R", + null, + "E", + "S", + "E", + "S" + ], + [ + "S", + "E", + "A", + "T", + "E", + "E", + null, + "S", + "L", + "O", + "T", + null, + null, + null, + null + ], + [ + null, + null, + null, + "E", + "A", + "S", + "E", + null, + null, + "T", + "A", + "S", + "S", + "E", + "S" + ], + [ + "C", + "O", + "S", + "T", + "S", + null, + "T", + "E", + "S", + null, + "S", + "O", + "L", + "E", + "A" + ], + [ + "O", + "R", + "A", + "R", + "E", + null, + "R", + "E", + "A", + "S", + null, + "C", + "A", + "R", + "S" + ], + [ + "R", + "A", + "R", + "E", + "R", + null, + "E", + "E", + "E", + "S", + null, + "A", + "R", + "I", + "E" + ], + [ + "T", + "E", + "T", + "E", + "S", + null, + "S", + "E", + "S", + "E", + null, + "N", + "A", + "E", + "S" + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 5, + null + ], + [ + 9, + null + ], + [ + 14, + null + ], + [ + 15, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 26, + null + ], + [ + 28, + null + ], + [ + 31, + null + ], + [ + 35, + null + ], + [ + 39, + null + ], + [ + 41, + null + ], + [ + 42, + null + ], + [ + 43, + null + ], + [ + 44, + null + ], + [ + 45, + null + ], + [ + 46, + null + ], + [ + 47, + null + ], + [ + 48, + null + ], + [ + 50, + null + ], + [ + 52, + null + ], + [ + 54, + null + ], + [ + 59, + null + ], + [ + 62, + null + ], + [ + 65, + null + ], + [ + 66, + null + ], + [ + 67, + null + ], + [ + 69, + null + ], + [ + 70, + null + ], + [ + 71, + null + ], + [ + 72, + null + ], + [ + 73, + null + ], + [ + 74, + null + ], + [ + 75, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 21, + null + ], + [ + 25, + null + ], + [ + 27, + null + ], + [ + 29, + null + ], + [ + 30, + null + ], + [ + 32, + null + ], + [ + 33, + null + ], + [ + 34, + null + ], + [ + 35, + null + ], + [ + 36, + null + ], + [ + 37, + null + ], + [ + 38, + null + ], + [ + 40, + null + ], + [ + 49, + null + ], + [ + 51, + null + ], + [ + 53, + null + ], + [ + 55, + null + ], + [ + 56, + null + ], + [ + 57, + null + ], + [ + 58, + null + ], + [ + 59, + null + ], + [ + 60, + null + ], + [ + 61, + null + ], + [ + 63, + null + ], + [ + 64, + null + ], + [ + 68, + null + ] + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/american-half.ipuz b/src/tests/clue-matches/performance-tests/american-half.ipuz new file mode 100644 index 00000000..808b9795 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/american-half.ipuz @@ -0,0 +1,856 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : " 0 ", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + "#", + 5, + 6, + 7, + 8, + "#", + 9, + 10, + 11, + 12, + 13 + ], + [ + 14, + 0, + 0, + 0, + "#", + 15, + 0, + 0, + 0, + "#", + 16, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + "#", + 18, + 0, + 0, + 0, + "#", + 19, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 21, + "#", + 22, + 0, + 0, + "#", + 23, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 25, + "#", + "#", + 26, + 27, + 0, + 0, + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + "#", + 28, + 0, + 29, + 30, + "#", + 31, + 0, + 0, + 32, + 33, + 34 + ], + [ + 35, + 36, + 37, + 38, + "#", + 39, + 0, + 0, + 40, + 0, + "#", + 41, + 0, + 0, + 0 + ], + [ + 42, + 0, + 0, + 0, + "#", + 43, + 0, + 0, + 0, + 0, + "#", + 44, + 0, + 0, + 0 + ], + [ + 45, + 0, + 0, + 0, + "#", + 46, + 0, + 0, + 0, + 0, + "#", + 47, + 0, + 0, + 0 + ], + [ + 48, + 0, + 0, + 0, + 49, + 0, + "#", + 50, + 0, + 0, + 51, + "#", + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + 52, + 0, + 0, + 53, + "#", + "#", + 54, + 0, + 55, + 56, + 57, + 58 + ], + [ + 59, + 60, + 61, + 0, + 0, + "#", + 62, + 63, + 64, + "#", + 65, + 0, + 0, + 0, + 0 + ], + [ + 66, + 0, + 0, + 0, + 0, + "#", + 67, + 0, + 0, + 68, + "#", + 69, + 0, + 0, + 0 + ], + [ + 70, + 0, + 0, + 0, + 0, + "#", + 71, + 0, + 0, + 0, + "#", + 72, + 0, + 0, + 0 + ], + [ + 73, + 0, + 0, + 0, + 0, + "#", + 74, + 0, + 0, + 0, + "#", + 75, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null, + null, + null, + "S", + "A", + "S", + null, + null, + "O", + null, + null, + "BA" + ], + [ + null, + null, + null, + null, + null, + null, + "A", + "R", + "A", + null, + null, + "R", + "A", + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + "E", + "E", + "A", + null, + null, + "A", + null, + null, + "AN" + ], + [ + null, + null, + null, + null, + null, + null, + "S", + "A", + "L", + null, + null, + "T", + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + "E", + null, + null, + "O", + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + "W", + null, + null, + "M", + "E", + "R", + "G", + "E", + "S" + ], + [ + "K", + "E", + "L", + "P", + null, + "C", + "O", + null, + "C", + "H", + null, + "I", + null, + null, + "E" + ], + [ + null, + "A", + "E", + null, + null, + "N", + null, + "B", + "L", + "E", + null, + "E", + "E", + null, + "E" + ], + [ + "C", + "R", + "A", + "P", + null, + "A", + "L", + "I", + "A", + null, + null, + "S", + "A", + "R", + "S" + ], + [ + null, + "S", + "P", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "A", + null, + null + ], + [ + "A", + "A", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "W", + null, + null + ], + [ + "C", + "D", + "D", + null, + "D", + null, + "Z", + null, + "R", + "O", + null, + "B", + "A", + "N", + "K" + ], + [ + "H", + "D", + null, + null, + null, + null, + null, + null, + "E", + null, + null, + null, + "K", + null, + "E" + ], + [ + "E", + "S", + null, + null, + "D", + null, + "E", + null, + "I", + "T", + null, + null, + "E", + null, + null + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 5, + null + ], + [ + 9, + null + ], + [ + 14, + null + ], + [ + 15, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 26, + null + ], + [ + 28, + null + ], + [ + 31, + null + ], + [ + 35, + null + ], + [ + 39, + null + ], + [ + 41, + null + ], + [ + 42, + null + ], + [ + 43, + null + ], + [ + 44, + null + ], + [ + 45, + null + ], + [ + 46, + null + ], + [ + 47, + null + ], + [ + 48, + null + ], + [ + 50, + null + ], + [ + 52, + null + ], + [ + 54, + null + ], + [ + 59, + null + ], + [ + 62, + null + ], + [ + 65, + null + ], + [ + 66, + null + ], + [ + 67, + null + ], + [ + 69, + null + ], + [ + 70, + null + ], + [ + 71, + null + ], + [ + 72, + null + ], + [ + 73, + null + ], + [ + 74, + null + ], + [ + 75, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 21, + null + ], + [ + 25, + null + ], + [ + 27, + null + ], + [ + 29, + null + ], + [ + 30, + null + ], + [ + 32, + null + ], + [ + 33, + null + ], + [ + 34, + null + ], + [ + 35, + null + ], + [ + 36, + null + ], + [ + 37, + null + ], + [ + 38, + null + ], + [ + 40, + null + ], + [ + 49, + null + ], + [ + 51, + null + ], + [ + 53, + null + ], + [ + 55, + null + ], + [ + 56, + null + ], + [ + 57, + null + ], + [ + 58, + null + ], + [ + 59, + null + ], + [ + 60, + null + ], + [ + 61, + null + ], + [ + 63, + null + ], + [ + 64, + null + ], + [ + 68, + null + ] + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/american-most.ipuz b/src/tests/clue-matches/performance-tests/american-most.ipuz new file mode 100644 index 00000000..debcebfa --- /dev/null +++ b/src/tests/clue-matches/performance-tests/american-most.ipuz @@ -0,0 +1,856 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : " 0 ", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + "#", + 5, + 6, + 7, + 8, + "#", + 9, + 10, + 11, + 12, + 13 + ], + [ + 14, + 0, + 0, + 0, + "#", + 15, + 0, + 0, + 0, + "#", + 16, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + "#", + 18, + 0, + 0, + 0, + "#", + 19, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 21, + "#", + 22, + 0, + 0, + "#", + 23, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 25, + "#", + "#", + 26, + 27, + 0, + 0, + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + "#", + 28, + 0, + 29, + 30, + "#", + 31, + 0, + 0, + 32, + 33, + 34 + ], + [ + 35, + 36, + 37, + 38, + "#", + 39, + 0, + 0, + 40, + 0, + "#", + 41, + 0, + 0, + 0 + ], + [ + 42, + 0, + 0, + 0, + "#", + 43, + 0, + 0, + 0, + 0, + "#", + 44, + 0, + 0, + 0 + ], + [ + 45, + 0, + 0, + 0, + "#", + 46, + 0, + 0, + 0, + 0, + "#", + 47, + 0, + 0, + 0 + ], + [ + 48, + 0, + 0, + 0, + 49, + 0, + "#", + 50, + 0, + 0, + 51, + "#", + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + 52, + 0, + 0, + 53, + "#", + "#", + 54, + 0, + 55, + 56, + 57, + 58 + ], + [ + 59, + 60, + 61, + 0, + 0, + "#", + 62, + 63, + 64, + "#", + 65, + 0, + 0, + 0, + 0 + ], + [ + 66, + 0, + 0, + 0, + 0, + "#", + 67, + 0, + 0, + 68, + "#", + 69, + 0, + 0, + 0 + ], + [ + 70, + 0, + 0, + 0, + 0, + "#", + 71, + 0, + 0, + 0, + "#", + 72, + 0, + 0, + 0 + ], + [ + 73, + 0, + 0, + 0, + 0, + "#", + 74, + 0, + 0, + 0, + "#", + 75, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + "O", + "W", + null, + null, + null, + null, + "S", + "A", + "S", + null, + null, + "O", + "R", + "U", + "BA" + ], + [ + null, + "A", + null, + "L", + null, + null, + "A", + "R", + "A", + null, + null, + "R", + "A", + "R", + null + ], + [ + null, + "R", + "R", + "O", + null, + null, + "E", + "E", + "A", + null, + "T", + "A", + "I", + "N", + "A" + ], + [ + null, + "I", + null, + null, + null, + null, + "S", + "A", + "L", + null, + "S", + "T", + "A", + "S", + "I" + ], + [ + null, + "O", + "K", + null, + null, + null, + null, + null, + "E", + null, + null, + "O", + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + "W", + null, + null, + "M", + "E", + "R", + "G", + "E", + "S" + ], + [ + "K", + "E", + "L", + "P", + null, + "C", + "O", + null, + "C", + "H", + null, + "I", + "A", + "R", + "E" + ], + [ + null, + "A", + "E", + null, + null, + "N", + null, + "B", + "L", + "E", + null, + "E", + "E", + "E", + "E" + ], + [ + "C", + "R", + "A", + "P", + null, + "A", + "L", + "I", + "A", + null, + null, + "S", + "A", + "R", + "S" + ], + [ + null, + "S", + "P", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + "T", + "O", + "G", + "A", + "E", + "D" + ], + [ + "A", + "A", + null, + null, + null, + null, + null, + null, + "D", + null, + "T", + "O", + "W", + "N", + "E" + ], + [ + "C", + "D", + "D", + null, + "D", + null, + "Z", + "E", + "R", + "O", + null, + "B", + "A", + "N", + "K" + ], + [ + "H", + "D", + "D", + "V", + "D", + null, + null, + null, + "E", + "U", + null, + "A", + "K", + "E", + "E" + ], + [ + "E", + "S", + null, + null, + "D", + null, + "E", + "X", + "I", + "T", + null, + "T", + "E", + "A", + "S" + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 5, + null + ], + [ + 9, + null + ], + [ + 14, + null + ], + [ + 15, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 26, + null + ], + [ + 28, + null + ], + [ + 31, + null + ], + [ + 35, + null + ], + [ + 39, + null + ], + [ + 41, + null + ], + [ + 42, + null + ], + [ + 43, + null + ], + [ + 44, + null + ], + [ + 45, + null + ], + [ + 46, + null + ], + [ + 47, + null + ], + [ + 48, + null + ], + [ + 50, + null + ], + [ + 52, + null + ], + [ + 54, + null + ], + [ + 59, + null + ], + [ + 62, + null + ], + [ + 65, + null + ], + [ + 66, + null + ], + [ + 67, + null + ], + [ + 69, + null + ], + [ + 70, + null + ], + [ + 71, + null + ], + [ + 72, + null + ], + [ + 73, + null + ], + [ + 74, + null + ], + [ + 75, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 21, + null + ], + [ + 25, + null + ], + [ + 27, + null + ], + [ + 29, + null + ], + [ + 30, + null + ], + [ + 32, + null + ], + [ + 33, + null + ], + [ + 34, + null + ], + [ + 35, + null + ], + [ + 36, + null + ], + [ + 37, + null + ], + [ + 38, + null + ], + [ + 40, + null + ], + [ + 49, + null + ], + [ + 51, + null + ], + [ + 53, + null + ], + [ + 55, + null + ], + [ + 56, + null + ], + [ + 57, + null + ], + [ + 58, + null + ], + [ + 59, + null + ], + [ + 60, + null + ], + [ + 61, + null + ], + [ + 63, + null + ], + [ + 64, + null + ], + [ + 68, + null + ] + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/american-sparse.ipuz b/src/tests/clue-matches/performance-tests/american-sparse.ipuz new file mode 100644 index 00000000..246e459d --- /dev/null +++ b/src/tests/clue-matches/performance-tests/american-sparse.ipuz @@ -0,0 +1,856 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : " 0 ", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + "#", + 5, + 6, + 7, + 8, + "#", + 9, + 10, + 11, + 12, + 13 + ], + [ + 14, + 0, + 0, + 0, + "#", + 15, + 0, + 0, + 0, + "#", + 16, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + "#", + 18, + 0, + 0, + 0, + "#", + 19, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 21, + "#", + 22, + 0, + 0, + "#", + 23, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 25, + "#", + "#", + 26, + 27, + 0, + 0, + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + "#", + 28, + 0, + 29, + 30, + "#", + 31, + 0, + 0, + 32, + 33, + 34 + ], + [ + 35, + 36, + 37, + 38, + "#", + 39, + 0, + 0, + 40, + 0, + "#", + 41, + 0, + 0, + 0 + ], + [ + 42, + 0, + 0, + 0, + "#", + 43, + 0, + 0, + 0, + 0, + "#", + 44, + 0, + 0, + 0 + ], + [ + 45, + 0, + 0, + 0, + "#", + 46, + 0, + 0, + 0, + 0, + "#", + 47, + 0, + 0, + 0 + ], + [ + 48, + 0, + 0, + 0, + 49, + 0, + "#", + 50, + 0, + 0, + 51, + "#", + "#", + "#", + "#" + ], + [ + "#", + "#", + "#", + 52, + 0, + 0, + 53, + "#", + "#", + 54, + 0, + 55, + 56, + 57, + 58 + ], + [ + 59, + 60, + 61, + 0, + 0, + "#", + 62, + 63, + 64, + "#", + 65, + 0, + 0, + 0, + 0 + ], + [ + 66, + 0, + 0, + 0, + 0, + "#", + 67, + 0, + 0, + 68, + "#", + 69, + 0, + 0, + 0 + ], + [ + 70, + 0, + 0, + 0, + 0, + "#", + 71, + 0, + 0, + 0, + "#", + 72, + 0, + 0, + 0 + ], + [ + 73, + 0, + 0, + 0, + 0, + "#", + 74, + 0, + 0, + 0, + "#", + 75, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null, + null, + null, + "S", + "A", + null, + null, + null, + null, + null, + null, + "BA" + ], + [ + null, + null, + null, + null, + null, + null, + "A", + "R", + null, + null, + null, + null, + null, + null, + "N" + ], + [ + null, + null, + null, + null, + null, + null, + "E", + "E", + null, + null, + null, + null, + null, + null, + "AN" + ], + [ + null, + null, + null, + null, + null, + null, + "S", + "A", + null, + null, + null, + null, + null, + null, + "A" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + "W", + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + "C", + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + "O", + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + "C", + "R", + "A", + "P", + null, + null, + null, + null, + "A", + null, + null, + "A", + "L", + "S", + "O" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "A", + null, + null + ], + [ + "A", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "W", + null, + null + ], + [ + "C", + null, + null, + null, + null, + null, + "Z", + null, + "R", + "O", + null, + "B", + "A", + "N", + "K" + ], + [ + "H", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "K", + null, + null + ], + [ + "E", + null, + null, + null, + null, + null, + "E", + null, + "I", + "T", + null, + null, + "E", + null, + null + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 5, + null + ], + [ + 9, + null + ], + [ + 14, + null + ], + [ + 15, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 26, + null + ], + [ + 28, + null + ], + [ + 31, + null + ], + [ + 35, + null + ], + [ + 39, + null + ], + [ + 41, + null + ], + [ + 42, + null + ], + [ + 43, + null + ], + [ + 44, + null + ], + [ + 45, + null + ], + [ + 46, + null + ], + [ + 47, + null + ], + [ + 48, + null + ], + [ + 50, + null + ], + [ + 52, + null + ], + [ + 54, + null + ], + [ + 59, + null + ], + [ + 62, + null + ], + [ + 65, + null + ], + [ + 66, + null + ], + [ + 67, + null + ], + [ + 69, + null + ], + [ + 70, + null + ], + [ + 71, + null + ], + [ + 72, + null + ], + [ + 73, + null + ], + [ + 74, + null + ], + [ + 75, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 21, + null + ], + [ + 25, + null + ], + [ + 27, + null + ], + [ + 29, + null + ], + [ + 30, + null + ], + [ + 32, + null + ], + [ + 33, + null + ], + [ + 34, + null + ], + [ + 35, + null + ], + [ + 36, + null + ], + [ + 37, + null + ], + [ + 38, + null + ], + [ + 40, + null + ], + [ + 49, + null + ], + [ + 51, + null + ], + [ + 53, + null + ], + [ + 55, + null + ], + [ + 56, + null + ], + [ + 57, + null + ], + [ + 58, + null + ], + [ + 59, + null + ], + [ + 60, + null + ], + [ + 61, + null + ], + [ + 63, + null + ], + [ + 64, + null + ], + [ + 68, + null + ] + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/empty-grid.ipuz b/src/tests/clue-matches/performance-tests/empty-grid.ipuz new file mode 100644 index 00000000..dee7d631 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/empty-grid.ipuz @@ -0,0 +1,656 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + [ + 16, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 18, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 19, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 21, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 22, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 23, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 25, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 26, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 27, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 28, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 29, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 21, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 25, + null + ], + [ + 26, + null + ], + [ + 27, + null + ], + [ + 28, + null + ], + [ + 29, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 14, + null + ], + [ + 15, + null + ] + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/empty.ipuz b/src/tests/clue-matches/performance-tests/empty.ipuz deleted file mode 100644 index 4938879f..00000000 --- a/src/tests/clue-matches/performance-tests/empty.ipuz +++ /dev/null @@ -1,106 +0,0 @@ -{ - "kind" : [ - "http://ipuz.org/crossword#1" - ], - "version" : "http://ipuz.org/v2", - "title" : "My Crossword-1", - "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "origin" : "GNOME Crosswords Editor (0.3.16)", - "block" : "#", - "empty" : "0", - "dimensions" : { - "width" : 4, - "height" : 4 - }, - "puzzle" : [ - [ - 1, - 2, - 3, - 4 - ], - [ - 5, - 0, - 0, - 0 - ], - [ - 6, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ] - ], - "solution" : [ - [ - null, - null, - null, - null - ], - [ - null, - null, - null, - null - ], - [ - null, - null, - null, - null - ], - [ - null, - null, - null, - null - ] - ], - "showenumerations" : false, - "clues" : { - "Across:Across" : [ - [ - 1, - null - ], - [ - 5, - null - ], - [ - 6, - null - ], - [ - 7, - null - ] - ], - "Down:Down" : [ - [ - 1, - null - ], - [ - 2, - null - ], - [ - 3, - null - ], - [ - 4, - null - ] - ] - } -} \ No newline at end of file -- GitLab From 606925f089a6d42103c03d8307162c0d4c05891c Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 26 Sep 2025 03:18:19 -0400 Subject: [PATCH 15/32] Add TODOs --- src/clue-matches-tests.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 18bdcd1b..468e94ca 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -277,6 +277,8 @@ main (int argc, char **argv) ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); + // TODO: Add macro guard. + // TODO: Improve print output. ADD_PERFORMANCE_TEST (test_performance_empty, "empty-grid.ipuz"); ADD_PERFORMANCE_TEST (test_american_empty, "american-empty.ipuz"); ADD_PERFORMANCE_TEST (test_american_sparse, "american-sparse.ipuz"); -- GitLab From 4827ecab765b7f64076deed8c2552bbe71562395 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 26 Sep 2025 03:27:11 -0400 Subject: [PATCH 16/32] Add cryptic test crosswords --- src/clue-matches-tests.c | 10 + .../performance-tests/cryptic-empty.ipuz | 1649 +++++++++++++++++ .../performance-tests/cryptic-full.ipuz | 1649 +++++++++++++++++ .../performance-tests/cryptic-half.ipuz | 1649 +++++++++++++++++ .../performance-tests/cryptic-most.ipuz | 1649 +++++++++++++++++ .../performance-tests/cryptic-sparse.ipuz | 1649 +++++++++++++++++ 6 files changed, 8255 insertions(+) create mode 100644 src/tests/clue-matches/performance-tests/cryptic-empty.ipuz create mode 100644 src/tests/clue-matches/performance-tests/cryptic-full.ipuz create mode 100644 src/tests/clue-matches/performance-tests/cryptic-half.ipuz create mode 100644 src/tests/clue-matches/performance-tests/cryptic-most.ipuz create mode 100644 src/tests/clue-matches/performance-tests/cryptic-sparse.ipuz diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 468e94ca..33154bab 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -243,6 +243,11 @@ DEFINE_PERFORMANCE_TEST (test_american_sparse, -1); DEFINE_PERFORMANCE_TEST (test_american_half, -1); DEFINE_PERFORMANCE_TEST (test_american_most, -1); DEFINE_PERFORMANCE_TEST (test_american_full, -1); +DEFINE_PERFORMANCE_TEST (test_cryptic_empty, -1); +DEFINE_PERFORMANCE_TEST (test_cryptic_sparse, -1); +DEFINE_PERFORMANCE_TEST (test_cryptic_half, -1); +DEFINE_PERFORMANCE_TEST (test_cryptic_most, -1); +DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); /* Add tests*/ @@ -285,6 +290,11 @@ main (int argc, char **argv) ADD_PERFORMANCE_TEST (test_american_half, "american-half.ipuz"); ADD_PERFORMANCE_TEST (test_american_most, "american-most.ipuz"); ADD_PERFORMANCE_TEST (test_american_full, "american-full.ipuz"); + ADD_PERFORMANCE_TEST (test_cryptic_empty, "cryptic-empty.ipuz"); + ADD_PERFORMANCE_TEST (test_cryptic_sparse, "cryptic-sparse.ipuz"); + ADD_PERFORMANCE_TEST (test_cryptic_half, "cryptic-half.ipuz"); + ADD_PERFORMANCE_TEST (test_cryptic_most, "cryptic-most.ipuz"); + ADD_PERFORMANCE_TEST (test_cryptic_full, "cryptic-full.ipuz"); return g_test_run (); } diff --git a/src/tests/clue-matches/performance-tests/cryptic-empty.ipuz b/src/tests/clue-matches/performance-tests/cryptic-empty.ipuz new file mode 100644 index 00000000..30f2abdc --- /dev/null +++ b/src/tests/clue-matches/performance-tests/cryptic-empty.ipuz @@ -0,0 +1,1649 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1", + "http://ipuz.org/crossword/crypticcrossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Cryptic Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 0, + 2, + 0, + 3, + 0, + "#", + 4, + 5, + 0, + 6, + 0, + 7, + 0, + 8 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 9, + 0, + 0, + 0, + 0, + 0, + "#", + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 11, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 12, + 0, + 0, + 0, + 0, + "#", + 13, + 0, + 0, + 14, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 15, + 0, + 0, + "#", + "#", + 0, + "#", + "#", + 0, + "#", + 0 + ], + [ + 16, + 0, + 0, + 0, + 0, + "#", + 17, + 0, + 18, + 0, + 19, + 0, + "#", + "#", + "#" + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 20, + "#", + 21 + ], + [ + "#", + "#", + "#", + 22, + 0, + 23, + 0, + 0, + 0, + "#", + 24, + 0, + 0, + 0, + 0 + ], + [ + 25, + "#", + 26, + "#", + "#", + 0, + "#", + "#", + 27, + 0, + 0, + "#", + 0, + "#", + 0 + ], + [ + 28, + 0, + 0, + 0, + 29, + 0, + 30, + 0, + 0, + "#", + 31, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 33, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 34, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 35, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + ], + "showenumerations" : true, + "clues" : { + "Across:Across" : [ + { + "number" : 1, + "enumeration" : "6", + "cells" : [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 3, + 0 + ], + [ + 4, + 0 + ], + [ + 5, + 0 + ] + ] + }, + { + "number" : 4, + "enumeration" : "8", + "cells" : [ + [ + 7, + 0 + ], + [ + 8, + 0 + ], + [ + 9, + 0 + ], + [ + 10, + 0 + ], + [ + 11, + 0 + ], + [ + 12, + 0 + ], + [ + 13, + 0 + ], + [ + 14, + 0 + ] + ] + }, + { + "number" : 9, + "enumeration" : "6", + "cells" : [ + [ + 0, + 2 + ], + [ + 1, + 2 + ], + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 4, + 2 + ], + [ + 5, + 2 + ] + ] + }, + { + "number" : 10, + "enumeration" : "8", + "cells" : [ + [ + 7, + 2 + ], + [ + 8, + 2 + ], + [ + 9, + 2 + ], + [ + 10, + 2 + ], + [ + 11, + 2 + ], + [ + 12, + 2 + ], + [ + 13, + 2 + ], + [ + 14, + 2 + ] + ] + }, + { + "number" : 12, + "enumeration" : "5", + "cells" : [ + [ + 0, + 4 + ], + [ + 1, + 4 + ], + [ + 2, + 4 + ], + [ + 3, + 4 + ], + [ + 4, + 4 + ] + ] + }, + { + "number" : 13, + "enumeration" : "9", + "cells" : [ + [ + 6, + 4 + ], + [ + 7, + 4 + ], + [ + 8, + 4 + ], + [ + 9, + 4 + ], + [ + 10, + 4 + ], + [ + 11, + 4 + ], + [ + 12, + 4 + ], + [ + 13, + 4 + ], + [ + 14, + 4 + ] + ] + }, + { + "number" : 15, + "enumeration" : "3", + "cells" : [ + [ + 4, + 5 + ], + [ + 5, + 5 + ], + [ + 6, + 5 + ] + ] + }, + { + "number" : 16, + "enumeration" : "5", + "cells" : [ + [ + 0, + 6 + ], + [ + 1, + 6 + ], + [ + 2, + 6 + ], + [ + 3, + 6 + ], + [ + 4, + 6 + ] + ] + }, + { + "number" : 17, + "enumeration" : "6", + "cells" : [ + [ + 6, + 6 + ], + [ + 7, + 6 + ], + [ + 8, + 6 + ], + [ + 9, + 6 + ], + [ + 10, + 6 + ], + [ + 11, + 6 + ] + ] + }, + { + "number" : 22, + "enumeration" : "6", + "cells" : [ + [ + 3, + 8 + ], + [ + 4, + 8 + ], + [ + 5, + 8 + ], + [ + 6, + 8 + ], + [ + 7, + 8 + ], + [ + 8, + 8 + ] + ] + }, + { + "number" : 24, + "enumeration" : "5", + "cells" : [ + [ + 10, + 8 + ], + [ + 11, + 8 + ], + [ + 12, + 8 + ], + [ + 13, + 8 + ], + [ + 14, + 8 + ] + ] + }, + { + "number" : 27, + "enumeration" : "3", + "cells" : [ + [ + 8, + 9 + ], + [ + 9, + 9 + ], + [ + 10, + 9 + ] + ] + }, + { + "number" : 28, + "enumeration" : "9", + "cells" : [ + [ + 0, + 10 + ], + [ + 1, + 10 + ], + [ + 2, + 10 + ], + [ + 3, + 10 + ], + [ + 4, + 10 + ], + [ + 5, + 10 + ], + [ + 6, + 10 + ], + [ + 7, + 10 + ], + [ + 8, + 10 + ] + ] + }, + { + "number" : 31, + "enumeration" : "5", + "cells" : [ + [ + 10, + 10 + ], + [ + 11, + 10 + ], + [ + 12, + 10 + ], + [ + 13, + 10 + ], + [ + 14, + 10 + ] + ] + }, + { + "number" : 32, + "enumeration" : "8", + "cells" : [ + [ + 0, + 12 + ], + [ + 1, + 12 + ], + [ + 2, + 12 + ], + [ + 3, + 12 + ], + [ + 4, + 12 + ], + [ + 5, + 12 + ], + [ + 6, + 12 + ], + [ + 7, + 12 + ] + ] + }, + { + "number" : 33, + "enumeration" : "6", + "cells" : [ + [ + 9, + 12 + ], + [ + 10, + 12 + ], + [ + 11, + 12 + ], + [ + 12, + 12 + ], + [ + 13, + 12 + ], + [ + 14, + 12 + ] + ] + }, + { + "number" : 34, + "enumeration" : "8", + "cells" : [ + [ + 0, + 14 + ], + [ + 1, + 14 + ], + [ + 2, + 14 + ], + [ + 3, + 14 + ], + [ + 4, + 14 + ], + [ + 5, + 14 + ], + [ + 6, + 14 + ], + [ + 7, + 14 + ] + ] + }, + { + "number" : 35, + "enumeration" : "6", + "cells" : [ + [ + 9, + 14 + ], + [ + 10, + 14 + ], + [ + 11, + 14 + ], + [ + 12, + 14 + ], + [ + 13, + 14 + ], + [ + 14, + 14 + ] + ] + } + ], + "Down:Down" : [ + { + "number" : 1, + "enumeration" : "8", + "cells" : [ + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 0, + 3 + ], + [ + 0, + 4 + ], + [ + 0, + 5 + ], + [ + 0, + 6 + ], + [ + 0, + 7 + ] + ] + }, + { + "number" : 2, + "enumeration" : "8", + "cells" : [ + [ + 2, + 0 + ], + [ + 2, + 1 + ], + [ + 2, + 2 + ], + [ + 2, + 3 + ], + [ + 2, + 4 + ], + [ + 2, + 5 + ], + [ + 2, + 6 + ], + [ + 2, + 7 + ] + ] + }, + { + "number" : 3, + "enumeration" : "9", + "cells" : [ + [ + 4, + 0 + ], + [ + 4, + 1 + ], + [ + 4, + 2 + ], + [ + 4, + 3 + ], + [ + 4, + 4 + ], + [ + 4, + 5 + ], + [ + 4, + 6 + ], + [ + 4, + 7 + ], + [ + 4, + 8 + ] + ] + }, + { + "number" : 5, + "enumeration" : "5", + "cells" : [ + [ + 8, + 0 + ], + [ + 8, + 1 + ], + [ + 8, + 2 + ], + [ + 8, + 3 + ], + [ + 8, + 4 + ] + ] + }, + { + "number" : 6, + "enumeration" : "5", + "cells" : [ + [ + 10, + 0 + ], + [ + 10, + 1 + ], + [ + 10, + 2 + ], + [ + 10, + 3 + ], + [ + 10, + 4 + ] + ] + }, + { + "number" : 7, + "enumeration" : "6", + "cells" : [ + [ + 12, + 0 + ], + [ + 12, + 1 + ], + [ + 12, + 2 + ], + [ + 12, + 3 + ], + [ + 12, + 4 + ], + [ + 12, + 5 + ] + ] + }, + { + "number" : 8, + "enumeration" : "6", + "cells" : [ + [ + 14, + 0 + ], + [ + 14, + 1 + ], + [ + 14, + 2 + ], + [ + 14, + 3 + ], + [ + 14, + 4 + ], + [ + 14, + 5 + ] + ] + }, + { + "number" : 11, + "enumeration" : "6", + "cells" : [ + [ + 6, + 3 + ], + [ + 6, + 4 + ], + [ + 6, + 5 + ], + [ + 6, + 6 + ], + [ + 6, + 7 + ], + [ + 6, + 8 + ] + ] + }, + { + "number" : 14, + "enumeration" : "3", + "cells" : [ + [ + 9, + 4 + ], + [ + 9, + 5 + ], + [ + 9, + 6 + ] + ] + }, + { + "number" : 18, + "enumeration" : "6", + "cells" : [ + [ + 8, + 6 + ], + [ + 8, + 7 + ], + [ + 8, + 8 + ], + [ + 8, + 9 + ], + [ + 8, + 10 + ], + [ + 8, + 11 + ] + ] + }, + { + "number" : 19, + "enumeration" : "9", + "cells" : [ + [ + 10, + 6 + ], + [ + 10, + 7 + ], + [ + 10, + 8 + ], + [ + 10, + 9 + ], + [ + 10, + 10 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 10, + 14 + ] + ] + }, + { + "number" : 20, + "enumeration" : "8", + "cells" : [ + [ + 12, + 7 + ], + [ + 12, + 8 + ], + [ + 12, + 9 + ], + [ + 12, + 10 + ], + [ + 12, + 11 + ], + [ + 12, + 12 + ], + [ + 12, + 13 + ], + [ + 12, + 14 + ] + ] + }, + { + "number" : 21, + "enumeration" : "8", + "cells" : [ + [ + 14, + 7 + ], + [ + 14, + 8 + ], + [ + 14, + 9 + ], + [ + 14, + 10 + ], + [ + 14, + 11 + ], + [ + 14, + 12 + ], + [ + 14, + 13 + ], + [ + 14, + 14 + ] + ] + }, + { + "number" : 23, + "enumeration" : "3", + "cells" : [ + [ + 5, + 8 + ], + [ + 5, + 9 + ], + [ + 5, + 10 + ] + ] + }, + { + "number" : 25, + "enumeration" : "6", + "cells" : [ + [ + 0, + 9 + ], + [ + 0, + 10 + ], + [ + 0, + 11 + ], + [ + 0, + 12 + ], + [ + 0, + 13 + ], + [ + 0, + 14 + ] + ] + }, + { + "number" : 26, + "enumeration" : "6", + "cells" : [ + [ + 2, + 9 + ], + [ + 2, + 10 + ], + [ + 2, + 11 + ], + [ + 2, + 12 + ], + [ + 2, + 13 + ], + [ + 2, + 14 + ] + ] + }, + { + "number" : 29, + "enumeration" : "5", + "cells" : [ + [ + 4, + 10 + ], + [ + 4, + 11 + ], + [ + 4, + 12 + ], + [ + 4, + 13 + ], + [ + 4, + 14 + ] + ] + }, + { + "number" : 30, + "enumeration" : "5", + "cells" : [ + [ + 6, + 10 + ], + [ + 6, + 11 + ], + [ + 6, + 12 + ], + [ + 6, + 13 + ], + [ + 6, + 14 + ] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/cryptic-full.ipuz b/src/tests/clue-matches/performance-tests/cryptic-full.ipuz new file mode 100644 index 00000000..1fb8ec36 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/cryptic-full.ipuz @@ -0,0 +1,1649 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1", + "http://ipuz.org/crossword/crypticcrossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Cryptic Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 0, + 2, + 0, + 3, + 0, + "#", + 4, + 5, + 0, + 6, + 0, + 7, + 0, + 8 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 9, + 0, + 0, + 0, + 0, + 0, + "#", + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 11, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 12, + 0, + 0, + 0, + 0, + "#", + 13, + 0, + 0, + 14, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 15, + 0, + 0, + "#", + "#", + 0, + "#", + "#", + 0, + "#", + 0 + ], + [ + 16, + 0, + 0, + 0, + 0, + "#", + 17, + 0, + 18, + 0, + 19, + 0, + "#", + "#", + "#" + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 20, + "#", + 21 + ], + [ + "#", + "#", + "#", + 22, + 0, + 23, + 0, + 0, + 0, + "#", + 24, + 0, + 0, + 0, + 0 + ], + [ + 25, + "#", + 26, + "#", + "#", + 0, + "#", + "#", + 27, + 0, + 0, + "#", + 0, + "#", + 0 + ], + [ + 28, + 0, + 0, + 0, + 29, + 0, + 30, + 0, + 0, + "#", + 31, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 33, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 34, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 35, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + "S", + "E", + "A", + "V", + "E", + "R", + null, + "R", + "A", + "M", + "E", + "S", + "S", + "E", + "S" + ], + [ + "P", + null, + "W", + null, + "P", + null, + null, + null, + "R", + null, + "Y", + null, + "L", + null, + "E" + ], + [ + "A", + "M", + "A", + "Z", + "I", + "N", + null, + "W", + "A", + "T", + "E", + "R", + "I", + "E", + "R" + ], + [ + "R", + null, + "K", + null, + "S", + null, + "A", + null, + "B", + null, + "U", + null, + "M", + null, + "G" + ], + [ + "E", + "G", + "E", + "S", + "T", + null, + "S", + "I", + "S", + "E", + "P", + "U", + "E", + "D", + "E" + ], + [ + "K", + null, + "N", + null, + "A", + "B", + "S", + null, + null, + "V", + null, + null, + "R", + null, + "I" + ], + [ + "E", + "X", + "E", + "C", + "S", + null, + "A", + "S", + "S", + "E", + "S", + "S", + null, + null, + null + ], + [ + "Y", + null, + "D", + null, + "I", + null, + "I", + null, + "T", + null, + "A", + null, + "C", + null, + "C" + ], + [ + null, + null, + null, + "O", + "S", + "T", + "L", + "E", + "R", + null, + "F", + "I", + "O", + "N", + "A" + ], + [ + "G", + null, + "D", + null, + null, + "E", + null, + null, + "A", + "B", + "E", + null, + "M", + null, + "R" + ], + [ + "A", + "C", + "A", + "R", + "I", + "A", + "S", + "I", + "S", + null, + "S", + "W", + "E", + "D", + "E" + ], + [ + "M", + null, + "T", + null, + "L", + null, + "C", + null, + "S", + null, + "T", + null, + "H", + null, + "S" + ], + [ + "E", + "T", + "A", + "G", + "E", + "R", + "E", + "S", + null, + "H", + "A", + "Y", + "E", + "R", + "S" + ], + [ + "R", + null, + "S", + null, + "D", + null, + "N", + null, + null, + null, + "T", + null, + "R", + null, + "E" + ], + [ + "S", + "I", + "S", + "T", + "E", + "R", + "E", + "D", + null, + "R", + "E", + "W", + "E", + "D", + "S" + ] + ], + "showenumerations" : true, + "clues" : { + "Across:Across" : [ + { + "number" : 1, + "enumeration" : "6", + "cells" : [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 3, + 0 + ], + [ + 4, + 0 + ], + [ + 5, + 0 + ] + ] + }, + { + "number" : 4, + "enumeration" : "8", + "cells" : [ + [ + 7, + 0 + ], + [ + 8, + 0 + ], + [ + 9, + 0 + ], + [ + 10, + 0 + ], + [ + 11, + 0 + ], + [ + 12, + 0 + ], + [ + 13, + 0 + ], + [ + 14, + 0 + ] + ] + }, + { + "number" : 9, + "enumeration" : "6", + "cells" : [ + [ + 0, + 2 + ], + [ + 1, + 2 + ], + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 4, + 2 + ], + [ + 5, + 2 + ] + ] + }, + { + "number" : 10, + "enumeration" : "8", + "cells" : [ + [ + 7, + 2 + ], + [ + 8, + 2 + ], + [ + 9, + 2 + ], + [ + 10, + 2 + ], + [ + 11, + 2 + ], + [ + 12, + 2 + ], + [ + 13, + 2 + ], + [ + 14, + 2 + ] + ] + }, + { + "number" : 12, + "enumeration" : "5", + "cells" : [ + [ + 0, + 4 + ], + [ + 1, + 4 + ], + [ + 2, + 4 + ], + [ + 3, + 4 + ], + [ + 4, + 4 + ] + ] + }, + { + "number" : 13, + "enumeration" : "9", + "cells" : [ + [ + 6, + 4 + ], + [ + 7, + 4 + ], + [ + 8, + 4 + ], + [ + 9, + 4 + ], + [ + 10, + 4 + ], + [ + 11, + 4 + ], + [ + 12, + 4 + ], + [ + 13, + 4 + ], + [ + 14, + 4 + ] + ] + }, + { + "number" : 15, + "enumeration" : "3", + "cells" : [ + [ + 4, + 5 + ], + [ + 5, + 5 + ], + [ + 6, + 5 + ] + ] + }, + { + "number" : 16, + "enumeration" : "5", + "cells" : [ + [ + 0, + 6 + ], + [ + 1, + 6 + ], + [ + 2, + 6 + ], + [ + 3, + 6 + ], + [ + 4, + 6 + ] + ] + }, + { + "number" : 17, + "enumeration" : "6", + "cells" : [ + [ + 6, + 6 + ], + [ + 7, + 6 + ], + [ + 8, + 6 + ], + [ + 9, + 6 + ], + [ + 10, + 6 + ], + [ + 11, + 6 + ] + ] + }, + { + "number" : 22, + "enumeration" : "6", + "cells" : [ + [ + 3, + 8 + ], + [ + 4, + 8 + ], + [ + 5, + 8 + ], + [ + 6, + 8 + ], + [ + 7, + 8 + ], + [ + 8, + 8 + ] + ] + }, + { + "number" : 24, + "enumeration" : "5", + "cells" : [ + [ + 10, + 8 + ], + [ + 11, + 8 + ], + [ + 12, + 8 + ], + [ + 13, + 8 + ], + [ + 14, + 8 + ] + ] + }, + { + "number" : 27, + "enumeration" : "3", + "cells" : [ + [ + 8, + 9 + ], + [ + 9, + 9 + ], + [ + 10, + 9 + ] + ] + }, + { + "number" : 28, + "enumeration" : "9", + "cells" : [ + [ + 0, + 10 + ], + [ + 1, + 10 + ], + [ + 2, + 10 + ], + [ + 3, + 10 + ], + [ + 4, + 10 + ], + [ + 5, + 10 + ], + [ + 6, + 10 + ], + [ + 7, + 10 + ], + [ + 8, + 10 + ] + ] + }, + { + "number" : 31, + "enumeration" : "5", + "cells" : [ + [ + 10, + 10 + ], + [ + 11, + 10 + ], + [ + 12, + 10 + ], + [ + 13, + 10 + ], + [ + 14, + 10 + ] + ] + }, + { + "number" : 32, + "enumeration" : "8", + "cells" : [ + [ + 0, + 12 + ], + [ + 1, + 12 + ], + [ + 2, + 12 + ], + [ + 3, + 12 + ], + [ + 4, + 12 + ], + [ + 5, + 12 + ], + [ + 6, + 12 + ], + [ + 7, + 12 + ] + ] + }, + { + "number" : 33, + "enumeration" : "6", + "cells" : [ + [ + 9, + 12 + ], + [ + 10, + 12 + ], + [ + 11, + 12 + ], + [ + 12, + 12 + ], + [ + 13, + 12 + ], + [ + 14, + 12 + ] + ] + }, + { + "number" : 34, + "enumeration" : "8", + "cells" : [ + [ + 0, + 14 + ], + [ + 1, + 14 + ], + [ + 2, + 14 + ], + [ + 3, + 14 + ], + [ + 4, + 14 + ], + [ + 5, + 14 + ], + [ + 6, + 14 + ], + [ + 7, + 14 + ] + ] + }, + { + "number" : 35, + "enumeration" : "6", + "cells" : [ + [ + 9, + 14 + ], + [ + 10, + 14 + ], + [ + 11, + 14 + ], + [ + 12, + 14 + ], + [ + 13, + 14 + ], + [ + 14, + 14 + ] + ] + } + ], + "Down:Down" : [ + { + "number" : 1, + "enumeration" : "8", + "cells" : [ + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 0, + 3 + ], + [ + 0, + 4 + ], + [ + 0, + 5 + ], + [ + 0, + 6 + ], + [ + 0, + 7 + ] + ] + }, + { + "number" : 2, + "enumeration" : "8", + "cells" : [ + [ + 2, + 0 + ], + [ + 2, + 1 + ], + [ + 2, + 2 + ], + [ + 2, + 3 + ], + [ + 2, + 4 + ], + [ + 2, + 5 + ], + [ + 2, + 6 + ], + [ + 2, + 7 + ] + ] + }, + { + "number" : 3, + "enumeration" : "9", + "cells" : [ + [ + 4, + 0 + ], + [ + 4, + 1 + ], + [ + 4, + 2 + ], + [ + 4, + 3 + ], + [ + 4, + 4 + ], + [ + 4, + 5 + ], + [ + 4, + 6 + ], + [ + 4, + 7 + ], + [ + 4, + 8 + ] + ] + }, + { + "number" : 5, + "enumeration" : "5", + "cells" : [ + [ + 8, + 0 + ], + [ + 8, + 1 + ], + [ + 8, + 2 + ], + [ + 8, + 3 + ], + [ + 8, + 4 + ] + ] + }, + { + "number" : 6, + "enumeration" : "5", + "cells" : [ + [ + 10, + 0 + ], + [ + 10, + 1 + ], + [ + 10, + 2 + ], + [ + 10, + 3 + ], + [ + 10, + 4 + ] + ] + }, + { + "number" : 7, + "enumeration" : "6", + "cells" : [ + [ + 12, + 0 + ], + [ + 12, + 1 + ], + [ + 12, + 2 + ], + [ + 12, + 3 + ], + [ + 12, + 4 + ], + [ + 12, + 5 + ] + ] + }, + { + "number" : 8, + "enumeration" : "6", + "cells" : [ + [ + 14, + 0 + ], + [ + 14, + 1 + ], + [ + 14, + 2 + ], + [ + 14, + 3 + ], + [ + 14, + 4 + ], + [ + 14, + 5 + ] + ] + }, + { + "number" : 11, + "enumeration" : "6", + "cells" : [ + [ + 6, + 3 + ], + [ + 6, + 4 + ], + [ + 6, + 5 + ], + [ + 6, + 6 + ], + [ + 6, + 7 + ], + [ + 6, + 8 + ] + ] + }, + { + "number" : 14, + "enumeration" : "3", + "cells" : [ + [ + 9, + 4 + ], + [ + 9, + 5 + ], + [ + 9, + 6 + ] + ] + }, + { + "number" : 18, + "enumeration" : "6", + "cells" : [ + [ + 8, + 6 + ], + [ + 8, + 7 + ], + [ + 8, + 8 + ], + [ + 8, + 9 + ], + [ + 8, + 10 + ], + [ + 8, + 11 + ] + ] + }, + { + "number" : 19, + "enumeration" : "9", + "cells" : [ + [ + 10, + 6 + ], + [ + 10, + 7 + ], + [ + 10, + 8 + ], + [ + 10, + 9 + ], + [ + 10, + 10 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 10, + 14 + ] + ] + }, + { + "number" : 20, + "enumeration" : "8", + "cells" : [ + [ + 12, + 7 + ], + [ + 12, + 8 + ], + [ + 12, + 9 + ], + [ + 12, + 10 + ], + [ + 12, + 11 + ], + [ + 12, + 12 + ], + [ + 12, + 13 + ], + [ + 12, + 14 + ] + ] + }, + { + "number" : 21, + "enumeration" : "8", + "cells" : [ + [ + 14, + 7 + ], + [ + 14, + 8 + ], + [ + 14, + 9 + ], + [ + 14, + 10 + ], + [ + 14, + 11 + ], + [ + 14, + 12 + ], + [ + 14, + 13 + ], + [ + 14, + 14 + ] + ] + }, + { + "number" : 23, + "enumeration" : "3", + "cells" : [ + [ + 5, + 8 + ], + [ + 5, + 9 + ], + [ + 5, + 10 + ] + ] + }, + { + "number" : 25, + "enumeration" : "6", + "cells" : [ + [ + 0, + 9 + ], + [ + 0, + 10 + ], + [ + 0, + 11 + ], + [ + 0, + 12 + ], + [ + 0, + 13 + ], + [ + 0, + 14 + ] + ] + }, + { + "number" : 26, + "enumeration" : "6", + "cells" : [ + [ + 2, + 9 + ], + [ + 2, + 10 + ], + [ + 2, + 11 + ], + [ + 2, + 12 + ], + [ + 2, + 13 + ], + [ + 2, + 14 + ] + ] + }, + { + "number" : 29, + "enumeration" : "5", + "cells" : [ + [ + 4, + 10 + ], + [ + 4, + 11 + ], + [ + 4, + 12 + ], + [ + 4, + 13 + ], + [ + 4, + 14 + ] + ] + }, + { + "number" : 30, + "enumeration" : "5", + "cells" : [ + [ + 6, + 10 + ], + [ + 6, + 11 + ], + [ + 6, + 12 + ], + [ + 6, + 13 + ], + [ + 6, + 14 + ] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/cryptic-half.ipuz b/src/tests/clue-matches/performance-tests/cryptic-half.ipuz new file mode 100644 index 00000000..3a0b0b36 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/cryptic-half.ipuz @@ -0,0 +1,1649 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1", + "http://ipuz.org/crossword/crypticcrossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Cryptic Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 0, + 2, + 0, + 3, + 0, + "#", + 4, + 5, + 0, + 6, + 0, + 7, + 0, + 8 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 9, + 0, + 0, + 0, + 0, + 0, + "#", + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 11, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 12, + 0, + 0, + 0, + 0, + "#", + 13, + 0, + 0, + 14, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 15, + 0, + 0, + "#", + "#", + 0, + "#", + "#", + 0, + "#", + 0 + ], + [ + 16, + 0, + 0, + 0, + 0, + "#", + 17, + 0, + 18, + 0, + 19, + 0, + "#", + "#", + "#" + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 20, + "#", + 21 + ], + [ + "#", + "#", + "#", + 22, + 0, + 23, + 0, + 0, + 0, + "#", + 24, + 0, + 0, + 0, + 0 + ], + [ + 25, + "#", + 26, + "#", + "#", + 0, + "#", + "#", + 27, + 0, + 0, + "#", + 0, + "#", + 0 + ], + [ + 28, + 0, + 0, + 0, + 29, + 0, + 30, + 0, + 0, + "#", + 31, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 33, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 34, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 35, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + "N", + "A", + "T", + null, + "R", + "E", + null, + null, + "A", + null, + "C", + null, + null, + null, + "E" + ], + [ + null, + null, + "H", + null, + null, + null, + null, + null, + null, + null, + "U", + null, + null, + null, + "N" + ], + [ + null, + null, + "E", + null, + null, + null, + null, + null, + null, + null, + "B", + null, + null, + null, + "S" + ], + [ + null, + null, + "A", + null, + null, + null, + "C", + null, + null, + null, + "E", + null, + null, + null, + null + ], + [ + "C", + "A", + "T", + "A", + "N", + null, + "C", + "A", + "N", + "A", + "D", + "I", + "A", + "N", + "A" + ], + [ + null, + null, + "E", + null, + null, + null, + "L", + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + "R", + null, + null, + null, + "A", + null, + "B", + null, + "S", + null, + null, + null, + null + ], + [ + null, + null, + "S", + null, + null, + null, + "M", + null, + null, + null, + "T", + null, + null, + null, + "T" + ], + [ + null, + null, + null, + null, + null, + null, + "P", + null, + null, + null, + "O", + "T", + "T", + "E", + "R" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "R", + null, + null, + null, + "O" + ], + [ + "V", + "I", + "L", + "L", + "A", + "G", + "E", + "R", + "S", + null, + "M", + null, + null, + null, + "L" + ], + [ + null, + null, + null, + null, + "R", + null, + null, + null, + null, + null, + "G", + null, + null, + null, + "L" + ], + [ + "D", + "O", + "G", + "T", + "R", + "E", + "A", + "T", + null, + null, + "O", + null, + null, + null, + "E" + ], + [ + null, + null, + null, + null, + "A", + null, + null, + null, + null, + null, + "D", + null, + null, + null, + "Y" + ], + [ + null, + null, + null, + null, + "Y", + null, + null, + null, + null, + null, + "S", + null, + "AT", + null, + "S" + ] + ], + "showenumerations" : true, + "clues" : { + "Across:Across" : [ + { + "number" : 1, + "enumeration" : "6", + "cells" : [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 3, + 0 + ], + [ + 4, + 0 + ], + [ + 5, + 0 + ] + ] + }, + { + "number" : 4, + "enumeration" : "8", + "cells" : [ + [ + 7, + 0 + ], + [ + 8, + 0 + ], + [ + 9, + 0 + ], + [ + 10, + 0 + ], + [ + 11, + 0 + ], + [ + 12, + 0 + ], + [ + 13, + 0 + ], + [ + 14, + 0 + ] + ] + }, + { + "number" : 9, + "enumeration" : "6", + "cells" : [ + [ + 0, + 2 + ], + [ + 1, + 2 + ], + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 4, + 2 + ], + [ + 5, + 2 + ] + ] + }, + { + "number" : 10, + "enumeration" : "8", + "cells" : [ + [ + 7, + 2 + ], + [ + 8, + 2 + ], + [ + 9, + 2 + ], + [ + 10, + 2 + ], + [ + 11, + 2 + ], + [ + 12, + 2 + ], + [ + 13, + 2 + ], + [ + 14, + 2 + ] + ] + }, + { + "number" : 12, + "enumeration" : "5", + "cells" : [ + [ + 0, + 4 + ], + [ + 1, + 4 + ], + [ + 2, + 4 + ], + [ + 3, + 4 + ], + [ + 4, + 4 + ] + ] + }, + { + "number" : 13, + "enumeration" : "9", + "cells" : [ + [ + 6, + 4 + ], + [ + 7, + 4 + ], + [ + 8, + 4 + ], + [ + 9, + 4 + ], + [ + 10, + 4 + ], + [ + 11, + 4 + ], + [ + 12, + 4 + ], + [ + 13, + 4 + ], + [ + 14, + 4 + ] + ] + }, + { + "number" : 15, + "enumeration" : "3", + "cells" : [ + [ + 4, + 5 + ], + [ + 5, + 5 + ], + [ + 6, + 5 + ] + ] + }, + { + "number" : 16, + "enumeration" : "5", + "cells" : [ + [ + 0, + 6 + ], + [ + 1, + 6 + ], + [ + 2, + 6 + ], + [ + 3, + 6 + ], + [ + 4, + 6 + ] + ] + }, + { + "number" : 17, + "enumeration" : "6", + "cells" : [ + [ + 6, + 6 + ], + [ + 7, + 6 + ], + [ + 8, + 6 + ], + [ + 9, + 6 + ], + [ + 10, + 6 + ], + [ + 11, + 6 + ] + ] + }, + { + "number" : 22, + "enumeration" : "6", + "cells" : [ + [ + 3, + 8 + ], + [ + 4, + 8 + ], + [ + 5, + 8 + ], + [ + 6, + 8 + ], + [ + 7, + 8 + ], + [ + 8, + 8 + ] + ] + }, + { + "number" : 24, + "enumeration" : "5", + "cells" : [ + [ + 10, + 8 + ], + [ + 11, + 8 + ], + [ + 12, + 8 + ], + [ + 13, + 8 + ], + [ + 14, + 8 + ] + ] + }, + { + "number" : 27, + "enumeration" : "3", + "cells" : [ + [ + 8, + 9 + ], + [ + 9, + 9 + ], + [ + 10, + 9 + ] + ] + }, + { + "number" : 28, + "enumeration" : "9", + "cells" : [ + [ + 0, + 10 + ], + [ + 1, + 10 + ], + [ + 2, + 10 + ], + [ + 3, + 10 + ], + [ + 4, + 10 + ], + [ + 5, + 10 + ], + [ + 6, + 10 + ], + [ + 7, + 10 + ], + [ + 8, + 10 + ] + ] + }, + { + "number" : 31, + "enumeration" : "5", + "cells" : [ + [ + 10, + 10 + ], + [ + 11, + 10 + ], + [ + 12, + 10 + ], + [ + 13, + 10 + ], + [ + 14, + 10 + ] + ] + }, + { + "number" : 32, + "enumeration" : "3 5", + "cells" : [ + [ + 0, + 12 + ], + [ + 1, + 12 + ], + [ + 2, + 12 + ], + [ + 3, + 12 + ], + [ + 4, + 12 + ], + [ + 5, + 12 + ], + [ + 6, + 12 + ], + [ + 7, + 12 + ] + ] + }, + { + "number" : 33, + "enumeration" : "6", + "cells" : [ + [ + 9, + 12 + ], + [ + 10, + 12 + ], + [ + 11, + 12 + ], + [ + 12, + 12 + ], + [ + 13, + 12 + ], + [ + 14, + 12 + ] + ] + }, + { + "number" : 34, + "enumeration" : "8", + "cells" : [ + [ + 0, + 14 + ], + [ + 1, + 14 + ], + [ + 2, + 14 + ], + [ + 3, + 14 + ], + [ + 4, + 14 + ], + [ + 5, + 14 + ], + [ + 6, + 14 + ], + [ + 7, + 14 + ] + ] + }, + { + "number" : 35, + "enumeration" : "6", + "cells" : [ + [ + 9, + 14 + ], + [ + 10, + 14 + ], + [ + 11, + 14 + ], + [ + 12, + 14 + ], + [ + 13, + 14 + ], + [ + 14, + 14 + ] + ] + } + ], + "Down:Down" : [ + { + "number" : 1, + "enumeration" : "8", + "cells" : [ + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 0, + 3 + ], + [ + 0, + 4 + ], + [ + 0, + 5 + ], + [ + 0, + 6 + ], + [ + 0, + 7 + ] + ] + }, + { + "number" : 2, + "enumeration" : "8", + "cells" : [ + [ + 2, + 0 + ], + [ + 2, + 1 + ], + [ + 2, + 2 + ], + [ + 2, + 3 + ], + [ + 2, + 4 + ], + [ + 2, + 5 + ], + [ + 2, + 6 + ], + [ + 2, + 7 + ] + ] + }, + { + "number" : 3, + "enumeration" : "9", + "cells" : [ + [ + 4, + 0 + ], + [ + 4, + 1 + ], + [ + 4, + 2 + ], + [ + 4, + 3 + ], + [ + 4, + 4 + ], + [ + 4, + 5 + ], + [ + 4, + 6 + ], + [ + 4, + 7 + ], + [ + 4, + 8 + ] + ] + }, + { + "number" : 5, + "enumeration" : "5", + "cells" : [ + [ + 8, + 0 + ], + [ + 8, + 1 + ], + [ + 8, + 2 + ], + [ + 8, + 3 + ], + [ + 8, + 4 + ] + ] + }, + { + "number" : 6, + "enumeration" : "5", + "cells" : [ + [ + 10, + 0 + ], + [ + 10, + 1 + ], + [ + 10, + 2 + ], + [ + 10, + 3 + ], + [ + 10, + 4 + ] + ] + }, + { + "number" : 7, + "enumeration" : "6", + "cells" : [ + [ + 12, + 0 + ], + [ + 12, + 1 + ], + [ + 12, + 2 + ], + [ + 12, + 3 + ], + [ + 12, + 4 + ], + [ + 12, + 5 + ] + ] + }, + { + "number" : 8, + "enumeration" : "6", + "cells" : [ + [ + 14, + 0 + ], + [ + 14, + 1 + ], + [ + 14, + 2 + ], + [ + 14, + 3 + ], + [ + 14, + 4 + ], + [ + 14, + 5 + ] + ] + }, + { + "number" : 11, + "enumeration" : "6", + "cells" : [ + [ + 6, + 3 + ], + [ + 6, + 4 + ], + [ + 6, + 5 + ], + [ + 6, + 6 + ], + [ + 6, + 7 + ], + [ + 6, + 8 + ] + ] + }, + { + "number" : 14, + "enumeration" : "3", + "cells" : [ + [ + 9, + 4 + ], + [ + 9, + 5 + ], + [ + 9, + 6 + ] + ] + }, + { + "number" : 18, + "enumeration" : "6", + "cells" : [ + [ + 8, + 6 + ], + [ + 8, + 7 + ], + [ + 8, + 8 + ], + [ + 8, + 9 + ], + [ + 8, + 10 + ], + [ + 8, + 11 + ] + ] + }, + { + "number" : 19, + "enumeration" : "5 4", + "cells" : [ + [ + 10, + 6 + ], + [ + 10, + 7 + ], + [ + 10, + 8 + ], + [ + 10, + 9 + ], + [ + 10, + 10 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 10, + 14 + ] + ] + }, + { + "number" : 20, + "enumeration" : "8", + "cells" : [ + [ + 12, + 7 + ], + [ + 12, + 8 + ], + [ + 12, + 9 + ], + [ + 12, + 10 + ], + [ + 12, + 11 + ], + [ + 12, + 12 + ], + [ + 12, + 13 + ], + [ + 12, + 14 + ] + ] + }, + { + "number" : 21, + "enumeration" : "8", + "cells" : [ + [ + 14, + 7 + ], + [ + 14, + 8 + ], + [ + 14, + 9 + ], + [ + 14, + 10 + ], + [ + 14, + 11 + ], + [ + 14, + 12 + ], + [ + 14, + 13 + ], + [ + 14, + 14 + ] + ] + }, + { + "number" : 23, + "enumeration" : "3", + "cells" : [ + [ + 5, + 8 + ], + [ + 5, + 9 + ], + [ + 5, + 10 + ] + ] + }, + { + "number" : 25, + "enumeration" : "6", + "cells" : [ + [ + 0, + 9 + ], + [ + 0, + 10 + ], + [ + 0, + 11 + ], + [ + 0, + 12 + ], + [ + 0, + 13 + ], + [ + 0, + 14 + ] + ] + }, + { + "number" : 26, + "enumeration" : "6", + "cells" : [ + [ + 2, + 9 + ], + [ + 2, + 10 + ], + [ + 2, + 11 + ], + [ + 2, + 12 + ], + [ + 2, + 13 + ], + [ + 2, + 14 + ] + ] + }, + { + "number" : 29, + "enumeration" : "5", + "cells" : [ + [ + 4, + 10 + ], + [ + 4, + 11 + ], + [ + 4, + 12 + ], + [ + 4, + 13 + ], + [ + 4, + 14 + ] + ] + }, + { + "number" : 30, + "enumeration" : "5", + "cells" : [ + [ + 6, + 10 + ], + [ + 6, + 11 + ], + [ + 6, + 12 + ], + [ + 6, + 13 + ], + [ + 6, + 14 + ] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/cryptic-most.ipuz b/src/tests/clue-matches/performance-tests/cryptic-most.ipuz new file mode 100644 index 00000000..1ca72e2e --- /dev/null +++ b/src/tests/clue-matches/performance-tests/cryptic-most.ipuz @@ -0,0 +1,1649 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1", + "http://ipuz.org/crossword/crypticcrossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Cryptic Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 0, + 2, + 0, + 3, + 0, + "#", + 4, + 5, + 0, + 6, + 0, + 7, + 0, + 8 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 9, + 0, + 0, + 0, + 0, + 0, + "#", + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 11, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 12, + 0, + 0, + 0, + 0, + "#", + 13, + 0, + 0, + 14, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 15, + 0, + 0, + "#", + "#", + 0, + "#", + "#", + 0, + "#", + 0 + ], + [ + 16, + 0, + 0, + 0, + 0, + "#", + 17, + 0, + 18, + 0, + 19, + 0, + "#", + "#", + "#" + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 20, + "#", + 21 + ], + [ + "#", + "#", + "#", + 22, + 0, + 23, + 0, + 0, + 0, + "#", + 24, + 0, + 0, + 0, + 0 + ], + [ + 25, + "#", + 26, + "#", + "#", + 0, + "#", + "#", + 27, + 0, + 0, + "#", + 0, + "#", + 0 + ], + [ + 28, + 0, + 0, + 0, + 29, + 0, + 30, + 0, + 0, + "#", + 31, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 33, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 34, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 35, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + "N", + "A", + "T", + "U", + "R", + "E", + null, + "C", + "A", + "R", + "C", + "H", + "A", + "S", + "E" + ], + [ + "O", + null, + "H", + null, + "O", + null, + null, + null, + "L", + null, + "U", + null, + null, + null, + "N" + ], + [ + "N", + null, + "E", + null, + "B", + null, + null, + null, + "I", + null, + "B", + null, + null, + null, + "S" + ], + [ + "A", + null, + "A", + null, + "I", + null, + "C", + null, + "E", + null, + "E", + null, + null, + null, + null + ], + [ + "C", + "A", + "T", + "A", + "N", + null, + "C", + "A", + "N", + "A", + "D", + "I", + "A", + "N", + "A" + ], + [ + "T", + null, + "E", + null, + "H", + null, + "L", + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + "O", + null, + "R", + null, + "O", + null, + "A", + null, + "B", + null, + "S", + null, + null, + null, + null + ], + [ + "R", + null, + "S", + null, + "O", + null, + "M", + null, + "E", + null, + "T", + null, + "S", + null, + "T" + ], + [ + null, + null, + null, + null, + "D", + null, + "P", + null, + "T", + null, + "O", + "T", + "T", + "E", + "R" + ], + [ + "N", + null, + "P", + null, + null, + null, + null, + null, + "O", + "A", + "R", + null, + "A", + null, + "O" + ], + [ + "V", + "I", + "L", + "L", + "A", + "G", + "E", + "R", + "S", + null, + "M", + null, + "R", + null, + "L" + ], + [ + "I", + null, + "A", + null, + "R", + null, + null, + null, + "S", + null, + "G", + null, + "T", + null, + "L" + ], + [ + "D", + "O", + "G", + "T", + "R", + "E", + "A", + "T", + null, + null, + "O", + null, + "E", + null, + "E" + ], + [ + "I", + null, + "U", + null, + "A", + null, + null, + null, + null, + null, + "D", + null, + "D", + null, + "Y" + ], + [ + "A", + null, + "E", + null, + "Y", + null, + null, + null, + null, + null, + "S", + null, + "A", + null, + "S" + ] + ], + "showenumerations" : true, + "clues" : { + "Across:Across" : [ + { + "number" : 1, + "enumeration" : "6", + "cells" : [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 3, + 0 + ], + [ + 4, + 0 + ], + [ + 5, + 0 + ] + ] + }, + { + "number" : 4, + "enumeration" : "3 5", + "cells" : [ + [ + 7, + 0 + ], + [ + 8, + 0 + ], + [ + 9, + 0 + ], + [ + 10, + 0 + ], + [ + 11, + 0 + ], + [ + 12, + 0 + ], + [ + 13, + 0 + ], + [ + 14, + 0 + ] + ] + }, + { + "number" : 9, + "enumeration" : "6", + "cells" : [ + [ + 0, + 2 + ], + [ + 1, + 2 + ], + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 4, + 2 + ], + [ + 5, + 2 + ] + ] + }, + { + "number" : 10, + "enumeration" : "8", + "cells" : [ + [ + 7, + 2 + ], + [ + 8, + 2 + ], + [ + 9, + 2 + ], + [ + 10, + 2 + ], + [ + 11, + 2 + ], + [ + 12, + 2 + ], + [ + 13, + 2 + ], + [ + 14, + 2 + ] + ] + }, + { + "number" : 12, + "enumeration" : "5", + "cells" : [ + [ + 0, + 4 + ], + [ + 1, + 4 + ], + [ + 2, + 4 + ], + [ + 3, + 4 + ], + [ + 4, + 4 + ] + ] + }, + { + "number" : 13, + "enumeration" : "9", + "cells" : [ + [ + 6, + 4 + ], + [ + 7, + 4 + ], + [ + 8, + 4 + ], + [ + 9, + 4 + ], + [ + 10, + 4 + ], + [ + 11, + 4 + ], + [ + 12, + 4 + ], + [ + 13, + 4 + ], + [ + 14, + 4 + ] + ] + }, + { + "number" : 15, + "enumeration" : "3", + "cells" : [ + [ + 4, + 5 + ], + [ + 5, + 5 + ], + [ + 6, + 5 + ] + ] + }, + { + "number" : 16, + "enumeration" : "5", + "cells" : [ + [ + 0, + 6 + ], + [ + 1, + 6 + ], + [ + 2, + 6 + ], + [ + 3, + 6 + ], + [ + 4, + 6 + ] + ] + }, + { + "number" : 17, + "enumeration" : "6", + "cells" : [ + [ + 6, + 6 + ], + [ + 7, + 6 + ], + [ + 8, + 6 + ], + [ + 9, + 6 + ], + [ + 10, + 6 + ], + [ + 11, + 6 + ] + ] + }, + { + "number" : 22, + "enumeration" : "6", + "cells" : [ + [ + 3, + 8 + ], + [ + 4, + 8 + ], + [ + 5, + 8 + ], + [ + 6, + 8 + ], + [ + 7, + 8 + ], + [ + 8, + 8 + ] + ] + }, + { + "number" : 24, + "enumeration" : "5", + "cells" : [ + [ + 10, + 8 + ], + [ + 11, + 8 + ], + [ + 12, + 8 + ], + [ + 13, + 8 + ], + [ + 14, + 8 + ] + ] + }, + { + "number" : 27, + "enumeration" : "3", + "cells" : [ + [ + 8, + 9 + ], + [ + 9, + 9 + ], + [ + 10, + 9 + ] + ] + }, + { + "number" : 28, + "enumeration" : "9", + "cells" : [ + [ + 0, + 10 + ], + [ + 1, + 10 + ], + [ + 2, + 10 + ], + [ + 3, + 10 + ], + [ + 4, + 10 + ], + [ + 5, + 10 + ], + [ + 6, + 10 + ], + [ + 7, + 10 + ], + [ + 8, + 10 + ] + ] + }, + { + "number" : 31, + "enumeration" : "5", + "cells" : [ + [ + 10, + 10 + ], + [ + 11, + 10 + ], + [ + 12, + 10 + ], + [ + 13, + 10 + ], + [ + 14, + 10 + ] + ] + }, + { + "number" : 32, + "enumeration" : "3 5", + "cells" : [ + [ + 0, + 12 + ], + [ + 1, + 12 + ], + [ + 2, + 12 + ], + [ + 3, + 12 + ], + [ + 4, + 12 + ], + [ + 5, + 12 + ], + [ + 6, + 12 + ], + [ + 7, + 12 + ] + ] + }, + { + "number" : 33, + "enumeration" : "6", + "cells" : [ + [ + 9, + 12 + ], + [ + 10, + 12 + ], + [ + 11, + 12 + ], + [ + 12, + 12 + ], + [ + 13, + 12 + ], + [ + 14, + 12 + ] + ] + }, + { + "number" : 34, + "enumeration" : "8", + "cells" : [ + [ + 0, + 14 + ], + [ + 1, + 14 + ], + [ + 2, + 14 + ], + [ + 3, + 14 + ], + [ + 4, + 14 + ], + [ + 5, + 14 + ], + [ + 6, + 14 + ], + [ + 7, + 14 + ] + ] + }, + { + "number" : 35, + "enumeration" : "6", + "cells" : [ + [ + 9, + 14 + ], + [ + 10, + 14 + ], + [ + 11, + 14 + ], + [ + 12, + 14 + ], + [ + 13, + 14 + ], + [ + 14, + 14 + ] + ] + } + ], + "Down:Down" : [ + { + "number" : 1, + "enumeration" : "3-5", + "cells" : [ + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 0, + 3 + ], + [ + 0, + 4 + ], + [ + 0, + 5 + ], + [ + 0, + 6 + ], + [ + 0, + 7 + ] + ] + }, + { + "number" : 2, + "enumeration" : "8", + "cells" : [ + [ + 2, + 0 + ], + [ + 2, + 1 + ], + [ + 2, + 2 + ], + [ + 2, + 3 + ], + [ + 2, + 4 + ], + [ + 2, + 5 + ], + [ + 2, + 6 + ], + [ + 2, + 7 + ] + ] + }, + { + "number" : 3, + "enumeration" : "5 4", + "cells" : [ + [ + 4, + 0 + ], + [ + 4, + 1 + ], + [ + 4, + 2 + ], + [ + 4, + 3 + ], + [ + 4, + 4 + ], + [ + 4, + 5 + ], + [ + 4, + 6 + ], + [ + 4, + 7 + ], + [ + 4, + 8 + ] + ] + }, + { + "number" : 5, + "enumeration" : "5", + "cells" : [ + [ + 8, + 0 + ], + [ + 8, + 1 + ], + [ + 8, + 2 + ], + [ + 8, + 3 + ], + [ + 8, + 4 + ] + ] + }, + { + "number" : 6, + "enumeration" : "5", + "cells" : [ + [ + 10, + 0 + ], + [ + 10, + 1 + ], + [ + 10, + 2 + ], + [ + 10, + 3 + ], + [ + 10, + 4 + ] + ] + }, + { + "number" : 7, + "enumeration" : "6", + "cells" : [ + [ + 12, + 0 + ], + [ + 12, + 1 + ], + [ + 12, + 2 + ], + [ + 12, + 3 + ], + [ + 12, + 4 + ], + [ + 12, + 5 + ] + ] + }, + { + "number" : 8, + "enumeration" : "6", + "cells" : [ + [ + 14, + 0 + ], + [ + 14, + 1 + ], + [ + 14, + 2 + ], + [ + 14, + 3 + ], + [ + 14, + 4 + ], + [ + 14, + 5 + ] + ] + }, + { + "number" : 11, + "enumeration" : "6", + "cells" : [ + [ + 6, + 3 + ], + [ + 6, + 4 + ], + [ + 6, + 5 + ], + [ + 6, + 6 + ], + [ + 6, + 7 + ], + [ + 6, + 8 + ] + ] + }, + { + "number" : 14, + "enumeration" : "3", + "cells" : [ + [ + 9, + 4 + ], + [ + 9, + 5 + ], + [ + 9, + 6 + ] + ] + }, + { + "number" : 18, + "enumeration" : "6", + "cells" : [ + [ + 8, + 6 + ], + [ + 8, + 7 + ], + [ + 8, + 8 + ], + [ + 8, + 9 + ], + [ + 8, + 10 + ], + [ + 8, + 11 + ] + ] + }, + { + "number" : 19, + "enumeration" : "5 4", + "cells" : [ + [ + 10, + 6 + ], + [ + 10, + 7 + ], + [ + 10, + 8 + ], + [ + 10, + 9 + ], + [ + 10, + 10 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 10, + 14 + ] + ] + }, + { + "number" : 20, + "enumeration" : "7 2", + "cells" : [ + [ + 12, + 7 + ], + [ + 12, + 8 + ], + [ + 12, + 9 + ], + [ + 12, + 10 + ], + [ + 12, + 11 + ], + [ + 12, + 12 + ], + [ + 12, + 13 + ], + [ + 12, + 14 + ] + ] + }, + { + "number" : 21, + "enumeration" : "8", + "cells" : [ + [ + 14, + 7 + ], + [ + 14, + 8 + ], + [ + 14, + 9 + ], + [ + 14, + 10 + ], + [ + 14, + 11 + ], + [ + 14, + 12 + ], + [ + 14, + 13 + ], + [ + 14, + 14 + ] + ] + }, + { + "number" : 23, + "enumeration" : "3", + "cells" : [ + [ + 5, + 8 + ], + [ + 5, + 9 + ], + [ + 5, + 10 + ] + ] + }, + { + "number" : 25, + "enumeration" : "6", + "cells" : [ + [ + 0, + 9 + ], + [ + 0, + 10 + ], + [ + 0, + 11 + ], + [ + 0, + 12 + ], + [ + 0, + 13 + ], + [ + 0, + 14 + ] + ] + }, + { + "number" : 26, + "enumeration" : "6", + "cells" : [ + [ + 2, + 9 + ], + [ + 2, + 10 + ], + [ + 2, + 11 + ], + [ + 2, + 12 + ], + [ + 2, + 13 + ], + [ + 2, + 14 + ] + ] + }, + { + "number" : 29, + "enumeration" : "5", + "cells" : [ + [ + 4, + 10 + ], + [ + 4, + 11 + ], + [ + 4, + 12 + ], + [ + 4, + 13 + ], + [ + 4, + 14 + ] + ] + }, + { + "number" : 30, + "enumeration" : "5", + "cells" : [ + [ + 6, + 10 + ], + [ + 6, + 11 + ], + [ + 6, + 12 + ], + [ + 6, + 13 + ], + [ + 6, + 14 + ] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/tests/clue-matches/performance-tests/cryptic-sparse.ipuz b/src/tests/clue-matches/performance-tests/cryptic-sparse.ipuz new file mode 100644 index 00000000..24ced9e7 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/cryptic-sparse.ipuz @@ -0,0 +1,1649 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1", + "http://ipuz.org/crossword/crypticcrossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Cryptic Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 0, + 2, + 0, + 3, + 0, + "#", + 4, + 5, + 0, + 6, + 0, + 7, + 0, + 8 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 9, + 0, + 0, + 0, + 0, + 0, + "#", + 10, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 11, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 12, + 0, + 0, + 0, + 0, + "#", + 13, + 0, + 0, + 14, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 15, + 0, + 0, + "#", + "#", + 0, + "#", + "#", + 0, + "#", + 0 + ], + [ + 16, + 0, + 0, + 0, + 0, + "#", + 17, + 0, + 18, + 0, + 19, + 0, + "#", + "#", + "#" + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 20, + "#", + 21 + ], + [ + "#", + "#", + "#", + 22, + 0, + 23, + 0, + 0, + 0, + "#", + 24, + 0, + 0, + 0, + 0 + ], + [ + 25, + "#", + 26, + "#", + "#", + 0, + "#", + "#", + 27, + 0, + 0, + "#", + 0, + "#", + 0 + ], + [ + 28, + 0, + 0, + 0, + 29, + 0, + 30, + 0, + 0, + "#", + 31, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 32, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 33, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + "#", + 0, + "#", + 0, + "#", + 0, + "#", + "#", + "#", + 0, + "#", + 0, + "#", + 0 + ], + [ + 34, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "#", + 35, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + "N", + "A", + null, + null, + "R", + "E", + null, + null, + null, + null, + null, + null, + null, + null, + "E" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "N" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "S" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + "T", + "A", + null, + null, + "C", + "A", + "N", + "A", + "D", + "I", + "A", + "N", + "A" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + "B", + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "T" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "O", + "T", + "T", + "E", + "R" + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + "O" + ], + [ + "V", + null, + null, + null, + "A", + null, + null, + null, + "S", + null, + null, + null, + null, + null, + "L" + ], + [ + null, + null, + null, + null, + "R", + null, + null, + null, + null, + null, + null, + null, + null, + null, + "L" + ], + [ + null, + null, + null, + null, + "R", + null, + null, + null, + null, + null, + null, + null, + null, + null, + "E" + ], + [ + null, + null, + null, + null, + "A", + null, + null, + null, + null, + null, + null, + null, + null, + null, + "Y" + ], + [ + null, + null, + null, + null, + "Y", + null, + null, + null, + null, + null, + null, + null, + null, + null, + "S" + ] + ], + "showenumerations" : true, + "clues" : { + "Across:Across" : [ + { + "number" : 1, + "enumeration" : "6", + "cells" : [ + [ + 0, + 0 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 3, + 0 + ], + [ + 4, + 0 + ], + [ + 5, + 0 + ] + ] + }, + { + "number" : 4, + "enumeration" : "8", + "cells" : [ + [ + 7, + 0 + ], + [ + 8, + 0 + ], + [ + 9, + 0 + ], + [ + 10, + 0 + ], + [ + 11, + 0 + ], + [ + 12, + 0 + ], + [ + 13, + 0 + ], + [ + 14, + 0 + ] + ] + }, + { + "number" : 9, + "enumeration" : "6", + "cells" : [ + [ + 0, + 2 + ], + [ + 1, + 2 + ], + [ + 2, + 2 + ], + [ + 3, + 2 + ], + [ + 4, + 2 + ], + [ + 5, + 2 + ] + ] + }, + { + "number" : 10, + "enumeration" : "8", + "cells" : [ + [ + 7, + 2 + ], + [ + 8, + 2 + ], + [ + 9, + 2 + ], + [ + 10, + 2 + ], + [ + 11, + 2 + ], + [ + 12, + 2 + ], + [ + 13, + 2 + ], + [ + 14, + 2 + ] + ] + }, + { + "number" : 12, + "enumeration" : "5", + "cells" : [ + [ + 0, + 4 + ], + [ + 1, + 4 + ], + [ + 2, + 4 + ], + [ + 3, + 4 + ], + [ + 4, + 4 + ] + ] + }, + { + "number" : 13, + "enumeration" : "9", + "cells" : [ + [ + 6, + 4 + ], + [ + 7, + 4 + ], + [ + 8, + 4 + ], + [ + 9, + 4 + ], + [ + 10, + 4 + ], + [ + 11, + 4 + ], + [ + 12, + 4 + ], + [ + 13, + 4 + ], + [ + 14, + 4 + ] + ] + }, + { + "number" : 15, + "enumeration" : "3", + "cells" : [ + [ + 4, + 5 + ], + [ + 5, + 5 + ], + [ + 6, + 5 + ] + ] + }, + { + "number" : 16, + "enumeration" : "5", + "cells" : [ + [ + 0, + 6 + ], + [ + 1, + 6 + ], + [ + 2, + 6 + ], + [ + 3, + 6 + ], + [ + 4, + 6 + ] + ] + }, + { + "number" : 17, + "enumeration" : "6", + "cells" : [ + [ + 6, + 6 + ], + [ + 7, + 6 + ], + [ + 8, + 6 + ], + [ + 9, + 6 + ], + [ + 10, + 6 + ], + [ + 11, + 6 + ] + ] + }, + { + "number" : 22, + "enumeration" : "6", + "cells" : [ + [ + 3, + 8 + ], + [ + 4, + 8 + ], + [ + 5, + 8 + ], + [ + 6, + 8 + ], + [ + 7, + 8 + ], + [ + 8, + 8 + ] + ] + }, + { + "number" : 24, + "enumeration" : "5", + "cells" : [ + [ + 10, + 8 + ], + [ + 11, + 8 + ], + [ + 12, + 8 + ], + [ + 13, + 8 + ], + [ + 14, + 8 + ] + ] + }, + { + "number" : 27, + "enumeration" : "3", + "cells" : [ + [ + 8, + 9 + ], + [ + 9, + 9 + ], + [ + 10, + 9 + ] + ] + }, + { + "number" : 28, + "enumeration" : "9", + "cells" : [ + [ + 0, + 10 + ], + [ + 1, + 10 + ], + [ + 2, + 10 + ], + [ + 3, + 10 + ], + [ + 4, + 10 + ], + [ + 5, + 10 + ], + [ + 6, + 10 + ], + [ + 7, + 10 + ], + [ + 8, + 10 + ] + ] + }, + { + "number" : 31, + "enumeration" : "5", + "cells" : [ + [ + 10, + 10 + ], + [ + 11, + 10 + ], + [ + 12, + 10 + ], + [ + 13, + 10 + ], + [ + 14, + 10 + ] + ] + }, + { + "number" : 32, + "enumeration" : "8", + "cells" : [ + [ + 0, + 12 + ], + [ + 1, + 12 + ], + [ + 2, + 12 + ], + [ + 3, + 12 + ], + [ + 4, + 12 + ], + [ + 5, + 12 + ], + [ + 6, + 12 + ], + [ + 7, + 12 + ] + ] + }, + { + "number" : 33, + "enumeration" : "6", + "cells" : [ + [ + 9, + 12 + ], + [ + 10, + 12 + ], + [ + 11, + 12 + ], + [ + 12, + 12 + ], + [ + 13, + 12 + ], + [ + 14, + 12 + ] + ] + }, + { + "number" : 34, + "enumeration" : "8", + "cells" : [ + [ + 0, + 14 + ], + [ + 1, + 14 + ], + [ + 2, + 14 + ], + [ + 3, + 14 + ], + [ + 4, + 14 + ], + [ + 5, + 14 + ], + [ + 6, + 14 + ], + [ + 7, + 14 + ] + ] + }, + { + "number" : 35, + "enumeration" : "6", + "cells" : [ + [ + 9, + 14 + ], + [ + 10, + 14 + ], + [ + 11, + 14 + ], + [ + 12, + 14 + ], + [ + 13, + 14 + ], + [ + 14, + 14 + ] + ] + } + ], + "Down:Down" : [ + { + "number" : 1, + "enumeration" : "8", + "cells" : [ + [ + 0, + 0 + ], + [ + 0, + 1 + ], + [ + 0, + 2 + ], + [ + 0, + 3 + ], + [ + 0, + 4 + ], + [ + 0, + 5 + ], + [ + 0, + 6 + ], + [ + 0, + 7 + ] + ] + }, + { + "number" : 2, + "enumeration" : "8", + "cells" : [ + [ + 2, + 0 + ], + [ + 2, + 1 + ], + [ + 2, + 2 + ], + [ + 2, + 3 + ], + [ + 2, + 4 + ], + [ + 2, + 5 + ], + [ + 2, + 6 + ], + [ + 2, + 7 + ] + ] + }, + { + "number" : 3, + "enumeration" : "9", + "cells" : [ + [ + 4, + 0 + ], + [ + 4, + 1 + ], + [ + 4, + 2 + ], + [ + 4, + 3 + ], + [ + 4, + 4 + ], + [ + 4, + 5 + ], + [ + 4, + 6 + ], + [ + 4, + 7 + ], + [ + 4, + 8 + ] + ] + }, + { + "number" : 5, + "enumeration" : "5", + "cells" : [ + [ + 8, + 0 + ], + [ + 8, + 1 + ], + [ + 8, + 2 + ], + [ + 8, + 3 + ], + [ + 8, + 4 + ] + ] + }, + { + "number" : 6, + "enumeration" : "5", + "cells" : [ + [ + 10, + 0 + ], + [ + 10, + 1 + ], + [ + 10, + 2 + ], + [ + 10, + 3 + ], + [ + 10, + 4 + ] + ] + }, + { + "number" : 7, + "enumeration" : "6", + "cells" : [ + [ + 12, + 0 + ], + [ + 12, + 1 + ], + [ + 12, + 2 + ], + [ + 12, + 3 + ], + [ + 12, + 4 + ], + [ + 12, + 5 + ] + ] + }, + { + "number" : 8, + "enumeration" : "6", + "cells" : [ + [ + 14, + 0 + ], + [ + 14, + 1 + ], + [ + 14, + 2 + ], + [ + 14, + 3 + ], + [ + 14, + 4 + ], + [ + 14, + 5 + ] + ] + }, + { + "number" : 11, + "enumeration" : "6", + "cells" : [ + [ + 6, + 3 + ], + [ + 6, + 4 + ], + [ + 6, + 5 + ], + [ + 6, + 6 + ], + [ + 6, + 7 + ], + [ + 6, + 8 + ] + ] + }, + { + "number" : 14, + "enumeration" : "3", + "cells" : [ + [ + 9, + 4 + ], + [ + 9, + 5 + ], + [ + 9, + 6 + ] + ] + }, + { + "number" : 18, + "enumeration" : "6", + "cells" : [ + [ + 8, + 6 + ], + [ + 8, + 7 + ], + [ + 8, + 8 + ], + [ + 8, + 9 + ], + [ + 8, + 10 + ], + [ + 8, + 11 + ] + ] + }, + { + "number" : 19, + "enumeration" : "9", + "cells" : [ + [ + 10, + 6 + ], + [ + 10, + 7 + ], + [ + 10, + 8 + ], + [ + 10, + 9 + ], + [ + 10, + 10 + ], + [ + 10, + 11 + ], + [ + 10, + 12 + ], + [ + 10, + 13 + ], + [ + 10, + 14 + ] + ] + }, + { + "number" : 20, + "enumeration" : "8", + "cells" : [ + [ + 12, + 7 + ], + [ + 12, + 8 + ], + [ + 12, + 9 + ], + [ + 12, + 10 + ], + [ + 12, + 11 + ], + [ + 12, + 12 + ], + [ + 12, + 13 + ], + [ + 12, + 14 + ] + ] + }, + { + "number" : 21, + "enumeration" : "8", + "cells" : [ + [ + 14, + 7 + ], + [ + 14, + 8 + ], + [ + 14, + 9 + ], + [ + 14, + 10 + ], + [ + 14, + 11 + ], + [ + 14, + 12 + ], + [ + 14, + 13 + ], + [ + 14, + 14 + ] + ] + }, + { + "number" : 23, + "enumeration" : "3", + "cells" : [ + [ + 5, + 8 + ], + [ + 5, + 9 + ], + [ + 5, + 10 + ] + ] + }, + { + "number" : 25, + "enumeration" : "6", + "cells" : [ + [ + 0, + 9 + ], + [ + 0, + 10 + ], + [ + 0, + 11 + ], + [ + 0, + 12 + ], + [ + 0, + 13 + ], + [ + 0, + 14 + ] + ] + }, + { + "number" : 26, + "enumeration" : "6", + "cells" : [ + [ + 2, + 9 + ], + [ + 2, + 10 + ], + [ + 2, + 11 + ], + [ + 2, + 12 + ], + [ + 2, + 13 + ], + [ + 2, + 14 + ] + ] + }, + { + "number" : 29, + "enumeration" : "5", + "cells" : [ + [ + 4, + 10 + ], + [ + 4, + 11 + ], + [ + 4, + 12 + ], + [ + 4, + 13 + ], + [ + 4, + 14 + ] + ] + }, + { + "number" : 30, + "enumeration" : "5", + "cells" : [ + [ + 6, + 10 + ], + [ + 6, + 11 + ], + [ + 6, + 12 + ], + [ + 6, + 13 + ], + [ + 6, + 14 + ] + ] + } + ] + } +} \ No newline at end of file -- GitLab From 8660044be9c6fec433dcc8da1ca5cbd406ab8ed8 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 26 Sep 2025 03:30:36 -0400 Subject: [PATCH 17/32] Add #ifdef RUN_PERFORMANCE_TESTS --- src/clue-matches-tests.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 33154bab..c0ed73eb 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -193,6 +193,8 @@ test_duplicate_words_ipuz (Fixture *fixture, gconstpointer user_data) /* Performance tests */ +#define RUN_PERFORMANCE_TESTS +#ifdef RUN_PERFORMANCE_TESTS static void foreach_clue_func (IpuzClues* clues, IpuzClueDirection direction, IpuzClue* clue, @@ -248,6 +250,8 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_sparse, -1); DEFINE_PERFORMANCE_TEST (test_cryptic_half, -1); DEFINE_PERFORMANCE_TEST (test_cryptic_most, -1); DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); +#endif + /* Add tests*/ @@ -284,6 +288,7 @@ main (int argc, char **argv) // TODO: Add macro guard. // TODO: Improve print output. + #ifdef RUN_PERFORMANCE_TESTS ADD_PERFORMANCE_TEST (test_performance_empty, "empty-grid.ipuz"); ADD_PERFORMANCE_TEST (test_american_empty, "american-empty.ipuz"); ADD_PERFORMANCE_TEST (test_american_sparse, "american-sparse.ipuz"); @@ -295,6 +300,7 @@ main (int argc, char **argv) ADD_PERFORMANCE_TEST (test_cryptic_half, "cryptic-half.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_most, "cryptic-most.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_full, "cryptic-full.ipuz"); + #endif return g_test_run (); } -- GitLab From 27d57658c976a270fc9effbdbc928d053c1585b9 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 26 Sep 2025 03:39:40 -0400 Subject: [PATCH 18/32] Improve print output --- src/clue-matches-tests.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index c0ed73eb..e9aa4e99 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -213,9 +213,9 @@ static void foreach_clue_func (IpuzClues* clues, g_timer_stop (fixture->timer); } -#define NUM_RUNS 3 +#define NUM_RUNS 1 static void -test_performance (Fixture *fixture, gfloat max_time) +test_performance (const gchar *test_name, Fixture *fixture, gfloat max_time) { IpuzGrid *grid = fixture->grid; gfloat average_time; @@ -225,18 +225,18 @@ test_performance (Fixture *fixture, gfloat max_time) ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; - g_message ("%s: %f\n", G_STRFUNC, average_time); + g_print ("\n%s: %f seconds.\n\n", test_name, average_time); g_assert_cmpfloat (average_time, <=, max_time); } -#define DEFINE_PERFORMANCE_TEST(NAME, MAX_TIME) \ - static void \ - NAME (Fixture *fixture, gconstpointer user_data) \ - { \ - if (MAX_TIME == -1) \ - test_performance (fixture, FLT_MAX); \ - else \ - test_performance (fixture, MAX_TIME); \ +#define DEFINE_PERFORMANCE_TEST(NAME, MAX_TIME) \ + static void \ + NAME (Fixture *fixture, gconstpointer user_data) \ + { \ + if (MAX_TIME == -1) \ + test_performance (#NAME, fixture, FLT_MAX); \ + else \ + test_performance (#NAME, fixture, MAX_TIME); \ } DEFINE_PERFORMANCE_TEST (test_performance_empty, -1); @@ -286,8 +286,6 @@ main (int argc, char **argv) ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); - // TODO: Add macro guard. - // TODO: Improve print output. #ifdef RUN_PERFORMANCE_TESTS ADD_PERFORMANCE_TEST (test_performance_empty, "empty-grid.ipuz"); ADD_PERFORMANCE_TEST (test_american_empty, "american-empty.ipuz"); -- GitLab From bd4ac7aa05f001505980202c9d76dcb1ebf22a7f Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 26 Sep 2025 03:49:47 -0400 Subject: [PATCH 19/32] Create subdir for IPUZ tests --- src/clue-matches-tests.c | 13 ++++++------- .../clue-matches/{ => ipuz-tests}/block-cells.ipuz | 0 src/tests/clue-matches/{ => ipuz-tests}/dense.ipuz | 0 .../{ => ipuz-tests}/duplicate-words.ipuz | 0 .../{ => ipuz-tests}/invalid-intersection.ipuz | 0 .../clue-matches/{ => ipuz-tests}/null-cells.ipuz | 0 src/tests/clue-matches/{ => ipuz-tests}/rebus.ipuz | 0 .../{ => ipuz-tests}/simple-across.ipuz | 0 .../clue-matches/{ => ipuz-tests}/simple-down.ipuz | 0 .../{ => ipuz-tests}/valid-intersection.ipuz | 0 10 files changed, 6 insertions(+), 7 deletions(-) rename src/tests/clue-matches/{ => ipuz-tests}/block-cells.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/dense.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/duplicate-words.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/invalid-intersection.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/null-cells.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/rebus.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/simple-across.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/simple-down.ipuz (100%) rename src/tests/clue-matches/{ => ipuz-tests}/valid-intersection.ipuz (100%) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index e9aa4e99..5b75f26b 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -255,12 +255,12 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); /* Add tests*/ -#define ADD_IPUZ_TEST(test_name, file_name) \ - g_test_add ("/clue_matches/" #test_name, \ - Fixture, \ - "tests/clue-matches/" file_name, \ - fixture_set_up, \ - test_name, \ +#define ADD_IPUZ_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + Fixture, \ + "tests/clue-matches/ipuz-tests/" file_name, \ + fixture_set_up, \ + test_name, \ fixture_tear_down) #define ADD_PERFORMANCE_TEST(test_name, file_name) \ @@ -276,7 +276,6 @@ main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); - /* FIXME: Use separate subdirs. */ ADD_IPUZ_TEST (test_simple_across_ipuz, "simple-across.ipuz"); ADD_IPUZ_TEST (test_simple_down_ipuz, "simple-down.ipuz"); ADD_IPUZ_TEST (test_valid_intersection_ipuz, "valid-intersection.ipuz"); diff --git a/src/tests/clue-matches/block-cells.ipuz b/src/tests/clue-matches/ipuz-tests/block-cells.ipuz similarity index 100% rename from src/tests/clue-matches/block-cells.ipuz rename to src/tests/clue-matches/ipuz-tests/block-cells.ipuz diff --git a/src/tests/clue-matches/dense.ipuz b/src/tests/clue-matches/ipuz-tests/dense.ipuz similarity index 100% rename from src/tests/clue-matches/dense.ipuz rename to src/tests/clue-matches/ipuz-tests/dense.ipuz diff --git a/src/tests/clue-matches/duplicate-words.ipuz b/src/tests/clue-matches/ipuz-tests/duplicate-words.ipuz similarity index 100% rename from src/tests/clue-matches/duplicate-words.ipuz rename to src/tests/clue-matches/ipuz-tests/duplicate-words.ipuz diff --git a/src/tests/clue-matches/invalid-intersection.ipuz b/src/tests/clue-matches/ipuz-tests/invalid-intersection.ipuz similarity index 100% rename from src/tests/clue-matches/invalid-intersection.ipuz rename to src/tests/clue-matches/ipuz-tests/invalid-intersection.ipuz diff --git a/src/tests/clue-matches/null-cells.ipuz b/src/tests/clue-matches/ipuz-tests/null-cells.ipuz similarity index 100% rename from src/tests/clue-matches/null-cells.ipuz rename to src/tests/clue-matches/ipuz-tests/null-cells.ipuz diff --git a/src/tests/clue-matches/rebus.ipuz b/src/tests/clue-matches/ipuz-tests/rebus.ipuz similarity index 100% rename from src/tests/clue-matches/rebus.ipuz rename to src/tests/clue-matches/ipuz-tests/rebus.ipuz diff --git a/src/tests/clue-matches/simple-across.ipuz b/src/tests/clue-matches/ipuz-tests/simple-across.ipuz similarity index 100% rename from src/tests/clue-matches/simple-across.ipuz rename to src/tests/clue-matches/ipuz-tests/simple-across.ipuz diff --git a/src/tests/clue-matches/simple-down.ipuz b/src/tests/clue-matches/ipuz-tests/simple-down.ipuz similarity index 100% rename from src/tests/clue-matches/simple-down.ipuz rename to src/tests/clue-matches/ipuz-tests/simple-down.ipuz diff --git a/src/tests/clue-matches/valid-intersection.ipuz b/src/tests/clue-matches/ipuz-tests/valid-intersection.ipuz similarity index 100% rename from src/tests/clue-matches/valid-intersection.ipuz rename to src/tests/clue-matches/ipuz-tests/valid-intersection.ipuz -- GitLab From 24fe16074ffd53aadd3680a63c00c9b4e15afca3 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 02:26:09 -0400 Subject: [PATCH 20/32] Rename "ipuz tests" to "correctness tests" --- src/clue-matches-tests.c | 28 +++++++++---------- .../block-cells.ipuz | 0 .../dense.ipuz | 0 .../duplicate-words.ipuz | 0 .../invalid-intersection.ipuz | 0 .../null-cells.ipuz | 0 .../rebus.ipuz | 0 .../simple-across.ipuz | 0 .../simple-down.ipuz | 0 .../valid-intersection.ipuz | 0 10 files changed, 14 insertions(+), 14 deletions(-) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/block-cells.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/dense.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/duplicate-words.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/invalid-intersection.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/null-cells.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/rebus.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/simple-across.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/simple-down.ipuz (100%) rename src/tests/clue-matches/{ipuz-tests => correctness-tests}/valid-intersection.ipuz (100%) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 5b75f26b..9bb728fc 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -255,12 +255,12 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); /* Add tests*/ -#define ADD_IPUZ_TEST(test_name, file_name) \ - g_test_add ("/clue_matches/" #test_name, \ - Fixture, \ - "tests/clue-matches/ipuz-tests/" file_name, \ - fixture_set_up, \ - test_name, \ +#define ADD_CORRECTNESS_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + Fixture, \ + "tests/clue-matches/correctness-tests/" file_name, \ + fixture_set_up, \ + test_name, \ fixture_tear_down) #define ADD_PERFORMANCE_TEST(test_name, file_name) \ @@ -276,14 +276,14 @@ main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); - ADD_IPUZ_TEST (test_simple_across_ipuz, "simple-across.ipuz"); - ADD_IPUZ_TEST (test_simple_down_ipuz, "simple-down.ipuz"); - ADD_IPUZ_TEST (test_valid_intersection_ipuz, "valid-intersection.ipuz"); - ADD_IPUZ_TEST (test_invalid_intersection_ipuz, "invalid-intersection.ipuz"); - ADD_IPUZ_TEST (test_dense_ipuz, "dense.ipuz"); - ADD_IPUZ_TEST (test_block_cells_ipuz, "block-cells.ipuz"); - ADD_IPUZ_TEST (test_null_cells_ipuz, "null-cells.ipuz"); - ADD_IPUZ_TEST (test_rebus_ipuz, "rebus.ipuz"); + ADD_CORRECTNESS_TEST (test_simple_across_ipuz, "simple-across.ipuz"); + ADD_CORRECTNESS_TEST (test_simple_down_ipuz, "simple-down.ipuz"); + ADD_CORRECTNESS_TEST (test_valid_intersection_ipuz, "valid-intersection.ipuz"); + ADD_CORRECTNESS_TEST (test_invalid_intersection_ipuz, "invalid-intersection.ipuz"); + ADD_CORRECTNESS_TEST (test_dense_ipuz, "dense.ipuz"); + ADD_CORRECTNESS_TEST (test_block_cells_ipuz, "block-cells.ipuz"); + ADD_CORRECTNESS_TEST (test_null_cells_ipuz, "null-cells.ipuz"); + ADD_CORRECTNESS_TEST (test_rebus_ipuz, "rebus.ipuz"); #ifdef RUN_PERFORMANCE_TESTS ADD_PERFORMANCE_TEST (test_performance_empty, "empty-grid.ipuz"); diff --git a/src/tests/clue-matches/ipuz-tests/block-cells.ipuz b/src/tests/clue-matches/correctness-tests/block-cells.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/block-cells.ipuz rename to src/tests/clue-matches/correctness-tests/block-cells.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/dense.ipuz b/src/tests/clue-matches/correctness-tests/dense.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/dense.ipuz rename to src/tests/clue-matches/correctness-tests/dense.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/duplicate-words.ipuz b/src/tests/clue-matches/correctness-tests/duplicate-words.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/duplicate-words.ipuz rename to src/tests/clue-matches/correctness-tests/duplicate-words.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/invalid-intersection.ipuz b/src/tests/clue-matches/correctness-tests/invalid-intersection.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/invalid-intersection.ipuz rename to src/tests/clue-matches/correctness-tests/invalid-intersection.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/null-cells.ipuz b/src/tests/clue-matches/correctness-tests/null-cells.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/null-cells.ipuz rename to src/tests/clue-matches/correctness-tests/null-cells.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/rebus.ipuz b/src/tests/clue-matches/correctness-tests/rebus.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/rebus.ipuz rename to src/tests/clue-matches/correctness-tests/rebus.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/simple-across.ipuz b/src/tests/clue-matches/correctness-tests/simple-across.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/simple-across.ipuz rename to src/tests/clue-matches/correctness-tests/simple-across.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/simple-down.ipuz b/src/tests/clue-matches/correctness-tests/simple-down.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/simple-down.ipuz rename to src/tests/clue-matches/correctness-tests/simple-down.ipuz diff --git a/src/tests/clue-matches/ipuz-tests/valid-intersection.ipuz b/src/tests/clue-matches/correctness-tests/valid-intersection.ipuz similarity index 100% rename from src/tests/clue-matches/ipuz-tests/valid-intersection.ipuz rename to src/tests/clue-matches/correctness-tests/valid-intersection.ipuz -- GitLab From 191a1eae7cb48985fa2de9168d7e14a1acdf6827 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 02:47:45 -0400 Subject: [PATCH 21/32] Use separate fixtures for the two test types --- src/clue-matches-tests.c | 122 ++++++++++++++++++++++++--------------- 1 file changed, 77 insertions(+), 45 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 9bb728fc..e7fc3d78 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -26,13 +26,18 @@ #include "test-utils.h" -/* Helper code */ +/* Fixture code */ + +typedef struct { + WordList *word_list; + IpuzGrid *grid; +} CorrectnessTestFixture; typedef struct { WordList *word_list; IpuzGrid *grid; GTimer *timer; -} Fixture; +} PerformanceTestFixture; static IpuzGrid* create_grid (const gchar* filename) @@ -41,7 +46,8 @@ create_grid (const gchar* filename) return IPUZ_GRID (state->xword); } -static void fixture_set_up (Fixture *fixture, gconstpointer user_data) +static void correctness_fixture_set_up (CorrectnessTestFixture *fixture, + gconstpointer user_data) { const gchar *ipuz_file_path = (const gchar *) user_data; @@ -49,13 +55,11 @@ static void fixture_set_up (Fixture *fixture, gconstpointer user_data) fixture->grid = create_grid (ipuz_file_path); } -static void fixture_tear_down (Fixture *fixture, gconstpointer user_data) +static void correctness_fixture_tear_down (CorrectnessTestFixture *fixture, + gconstpointer user_data) { g_object_unref (fixture->word_list); - if (fixture->timer != NULL) - g_timer_destroy (fixture->timer); - /* If I try to free the grid: * g_object_unref (fixture->grid); * I get this error: @@ -63,6 +67,26 @@ static void fixture_tear_down (Fixture *fixture, gconstpointer user_data) */ } +static void performance_fixture_set_up (PerformanceTestFixture *fixture, + gconstpointer user_data) +{ + const gchar *ipuz_file_path = (const gchar *) user_data; + + fixture->word_list = get_broda_word_list (); + fixture->grid = create_grid (ipuz_file_path); +} + +static void performance_fixture_tear_down (PerformanceTestFixture *fixture, + gconstpointer user_data) +{ + g_object_unref (fixture->word_list); + g_assert_nonnull (fixture->timer); + g_timer_destroy (fixture->timer); +} + + +/* IPUZ tests */ + static IpuzClue* get_clue (IpuzGrid* grid, IpuzClueDirection direction, guint index) { @@ -90,9 +114,6 @@ str_array_to_word_array (const gchar *str_array[], WordList *word_list) return word_array; } - -/* IPUZ tests */ - static void test_clue_matches (WordList *word_list, IpuzGrid *grid, @@ -122,33 +143,38 @@ test_clue_matches (WordList *word_list, ASSERT_CLUE_MATCHES(DIRECTION, INDEX, NULL); static void -test_simple_across_ipuz (Fixture *fixture, gconstpointer user_data) +test_simple_across_ipuz (CorrectnessTestFixture *fixture, + gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 2, "EGGS", "EGGO", "EGGY"); } static void -test_simple_down_ipuz (Fixture *fixture, gconstpointer user_data) +test_simple_down_ipuz (CorrectnessTestFixture *fixture, + gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_DOWN, 3, "EGGS", "EGGO", "EGGY"); } static void -test_valid_intersection_ipuz (Fixture *fixture, gconstpointer user_data) +test_valid_intersection_ipuz (CorrectnessTestFixture *fixture, + gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 1, "WORD", "WORM"); ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_DOWN, 3, "EDIT", "EMIT"); } static void -test_invalid_intersection_ipuz (Fixture *fixture, gconstpointer user_data) +test_invalid_intersection_ipuz (CorrectnessTestFixture *fixture, + gconstpointer user_data) { ASSERT_CLUE_MATCHES_EMPTY (IPUZ_CLUE_DIRECTION_ACROSS, 3); ASSERT_CLUE_MATCHES_EMPTY (IPUZ_CLUE_DIRECTION_DOWN, 3); } static void -test_dense_ipuz (Fixture *fixture, gconstpointer user_data) +test_dense_ipuz (CorrectnessTestFixture *fixture, + gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 0, "WORD"); ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 1, "ARIA"); @@ -161,21 +187,21 @@ test_dense_ipuz (Fixture *fixture, gconstpointer user_data) } static void -test_block_cells_ipuz (Fixture *fixture, gconstpointer user_data) +test_block_cells_ipuz (CorrectnessTestFixture *fixture, gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 0, "ADD", "AID", "AND", "AMD"); ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_DOWN, 0, "AXES", "AXIS"); } static void -test_null_cells_ipuz (Fixture *fixture, gconstpointer user_data) +test_null_cells_ipuz (CorrectnessTestFixture *fixture, gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 0, "ADD", "AID", "AND", "AMD"); ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_DOWN, 0, "AXES", "AXIS"); } static void -test_rebus_ipuz (Fixture *fixture, gconstpointer user_data) +test_rebus_ipuz (CorrectnessTestFixture *fixture, gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 0, "REBUS", "REMUS"); ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_DOWN, 2, "BANANA", "MANANA"); @@ -183,7 +209,8 @@ test_rebus_ipuz (Fixture *fixture, gconstpointer user_data) /* FIXME(tests): See https://gitlab.gnome.org/jrb/crosswords/-/issues/313. static void -test_duplicate_words_ipuz (Fixture *fixture, gconstpointer user_data) +test_duplicate_words_ipuz (CorrectnessTestFixture *fixture, + gconstpointer user_data) { ASSERT_CLUE_MATCHES (IPUZ_CLUE_DIRECTION_ACROSS, 0, "ZERO"); ASSERT_CLUE_MATCHES_EMPTY (IPUZ_CLUE_DIRECTION_DOWN, 0); @@ -201,8 +228,11 @@ static void foreach_clue_func (IpuzClues* clues, IpuzClueId* clue_id, gpointer user_data) { - Fixture *fixture = (Fixture *) user_data; - WordList *word_list = fixture->word_list; + PerformanceTestFixture *fixture; + WordList *word_list; + + fixture = (PerformanceTestFixture *) user_data; + word_list = fixture->word_list; if (fixture->timer == NULL) fixture->timer = g_timer_new (); @@ -215,7 +245,9 @@ static void foreach_clue_func (IpuzClues* clues, #define NUM_RUNS 1 static void -test_performance (const gchar *test_name, Fixture *fixture, gfloat max_time) +test_performance (const gchar *test_name, + PerformanceTestFixture *fixture, + gfloat max_time) { IpuzGrid *grid = fixture->grid; gfloat average_time; @@ -229,14 +261,14 @@ test_performance (const gchar *test_name, Fixture *fixture, gfloat max_time) g_assert_cmpfloat (average_time, <=, max_time); } -#define DEFINE_PERFORMANCE_TEST(NAME, MAX_TIME) \ - static void \ - NAME (Fixture *fixture, gconstpointer user_data) \ - { \ - if (MAX_TIME == -1) \ - test_performance (#NAME, fixture, FLT_MAX); \ - else \ - test_performance (#NAME, fixture, MAX_TIME); \ +#define DEFINE_PERFORMANCE_TEST(NAME, MAX_TIME) \ + static void \ + NAME (PerformanceTestFixture *fixture, gconstpointer user_data) \ + { \ + if (MAX_TIME == -1) \ + test_performance (#NAME, fixture, FLT_MAX); \ + else \ + test_performance (#NAME, fixture, MAX_TIME); \ } DEFINE_PERFORMANCE_TEST (test_performance_empty, -1); @@ -255,21 +287,21 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); /* Add tests*/ -#define ADD_CORRECTNESS_TEST(test_name, file_name) \ - g_test_add ("/clue_matches/" #test_name, \ - Fixture, \ - "tests/clue-matches/correctness-tests/" file_name, \ - fixture_set_up, \ - test_name, \ - fixture_tear_down) - -#define ADD_PERFORMANCE_TEST(test_name, file_name) \ - g_test_add ("/clue_matches/" #test_name, \ - Fixture, \ - "tests/clue-matches/performance-tests/" file_name, \ - fixture_set_up, \ - test_name, \ - fixture_tear_down) +#define ADD_CORRECTNESS_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + CorrectnessTestFixture, \ + "tests/clue-matches/correctness-tests/" file_name, \ + correctness_fixture_set_up, \ + test_name, \ + correctness_fixture_tear_down) + +#define ADD_PERFORMANCE_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + PerformanceTestFixture, \ + "tests/clue-matches/performance-tests/" file_name, \ + performance_fixture_set_up, \ + test_name, \ + performance_fixture_tear_down) int main (int argc, char **argv) -- GitLab From 6e81de64f53036b02c554d507f1b401d738b06df Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 06:52:47 -0400 Subject: [PATCH 22/32] Add PerformanceTestUserData struct --- src/clue-matches-tests.c | 53 ++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index e7fc3d78..f66555f9 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -28,17 +28,6 @@ /* Fixture code */ -typedef struct { - WordList *word_list; - IpuzGrid *grid; -} CorrectnessTestFixture; - -typedef struct { - WordList *word_list; - IpuzGrid *grid; - GTimer *timer; -} PerformanceTestFixture; - static IpuzGrid* create_grid (const gchar* filename) { @@ -46,6 +35,11 @@ create_grid (const gchar* filename) return IPUZ_GRID (state->xword); } +typedef struct { + WordList *word_list; + IpuzGrid *grid; +} CorrectnessTestFixture; + static void correctness_fixture_set_up (CorrectnessTestFixture *fixture, gconstpointer user_data) { @@ -67,13 +61,26 @@ static void correctness_fixture_tear_down (CorrectnessTestFixture *fixture, */ } +typedef struct { + WordList *word_list; + IpuzGrid *grid; + GTimer *timer; + guint *combined_runtime; +} PerformanceTestFixture; + +typedef struct { + const gchar *ipuz_file_path; + guint *combined_runtime; +} PerformanceTestUserData; + static void performance_fixture_set_up (PerformanceTestFixture *fixture, gconstpointer user_data) { - const gchar *ipuz_file_path = (const gchar *) user_data; - + PerformanceTestUserData *ptest_user_data = + (PerformanceTestUserData *) user_data; fixture->word_list = get_broda_word_list (); - fixture->grid = create_grid (ipuz_file_path); + fixture->grid = create_grid (ptest_user_data->ipuz_file_path); + fixture->combined_runtime = ptest_user_data->combined_runtime; } static void performance_fixture_tear_down (PerformanceTestFixture *fixture, @@ -295,17 +302,30 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); test_name, \ correctness_fixture_tear_down) + #define ADD_PERFORMANCE_TEST(test_name, file_name) \ + \ + PerformanceTestUserData test_name##_user_data; \ + test_name##_user_data.ipuz_file_path = \ + "tests/clue-matches/performance-tests/" file_name; \ + test_name##_user_data.combined_runtime = &combined_runtime; \ + \ g_test_add ("/clue_matches/" #test_name, \ PerformanceTestFixture, \ - "tests/clue-matches/performance-tests/" file_name, \ + &test_name##_user_data, \ performance_fixture_set_up, \ test_name, \ - performance_fixture_tear_down) + performance_fixture_tear_down); \ + \ + num_performance_tests++ + int main (int argc, char **argv) { + guint num_performance_tests = 0; + guint combined_runtime = 0; + g_test_init (&argc, &argv, NULL); ADD_CORRECTNESS_TEST (test_simple_across_ipuz, "simple-across.ipuz"); @@ -329,6 +349,7 @@ main (int argc, char **argv) ADD_PERFORMANCE_TEST (test_cryptic_half, "cryptic-half.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_most, "cryptic-most.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_full, "cryptic-full.ipuz"); + g_message ("%d %d", num_performance_tests, combined_runtime); #endif return g_test_run (); -- GitLab From 605db866e3551cc089037e965238a9f06e440abc Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 07:16:06 -0400 Subject: [PATCH 23/32] Print test results --- src/clue-matches-tests.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index f66555f9..0b451709 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -65,12 +65,12 @@ typedef struct { WordList *word_list; IpuzGrid *grid; GTimer *timer; - guint *combined_runtime; + gfloat *combined_runtime; } PerformanceTestFixture; typedef struct { const gchar *ipuz_file_path; - guint *combined_runtime; + gfloat *combined_runtime; } PerformanceTestUserData; static void performance_fixture_set_up (PerformanceTestFixture *fixture, @@ -324,7 +324,7 @@ int main (int argc, char **argv) { guint num_performance_tests = 0; - guint combined_runtime = 0; + gfloat combined_runtime = 0; g_test_init (&argc, &argv, NULL); @@ -349,7 +349,13 @@ main (int argc, char **argv) ADD_PERFORMANCE_TEST (test_cryptic_half, "cryptic-half.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_most, "cryptic-most.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_full, "cryptic-full.ipuz"); - g_message ("%d %d", num_performance_tests, combined_runtime); + + g_message ("******************************"); + g_message ("* PERFORMANCE TESTS RESULTS *"); + g_message ("* *"); + g_message ("* Combined runtime: %f *", combined_runtime); + g_message ("* Average runtime: %f *", 0.0); + g_message ("******************************"); #endif return g_test_run (); -- GitLab From 2a150a6308b2244e8d9e16396c70449bc055b0eb Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 07:20:16 -0400 Subject: [PATCH 24/32] Remove MAX_TIME --- src/clue-matches-tests.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 0b451709..f41c95a2 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -253,8 +253,7 @@ static void foreach_clue_func (IpuzClues* clues, #define NUM_RUNS 1 static void test_performance (const gchar *test_name, - PerformanceTestFixture *fixture, - gfloat max_time) + PerformanceTestFixture *fixture) { IpuzGrid *grid = fixture->grid; gfloat average_time; @@ -265,30 +264,26 @@ test_performance (const gchar *test_name, average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; g_print ("\n%s: %f seconds.\n\n", test_name, average_time); - g_assert_cmpfloat (average_time, <=, max_time); } -#define DEFINE_PERFORMANCE_TEST(NAME, MAX_TIME) \ +#define DEFINE_PERFORMANCE_TEST(NAME) \ static void \ NAME (PerformanceTestFixture *fixture, gconstpointer user_data) \ - { \ - if (MAX_TIME == -1) \ - test_performance (#NAME, fixture, FLT_MAX); \ - else \ - test_performance (#NAME, fixture, MAX_TIME); \ - } - -DEFINE_PERFORMANCE_TEST (test_performance_empty, -1); -DEFINE_PERFORMANCE_TEST (test_american_empty, -1); -DEFINE_PERFORMANCE_TEST (test_american_sparse, -1); -DEFINE_PERFORMANCE_TEST (test_american_half, -1); -DEFINE_PERFORMANCE_TEST (test_american_most, -1); -DEFINE_PERFORMANCE_TEST (test_american_full, -1); -DEFINE_PERFORMANCE_TEST (test_cryptic_empty, -1); -DEFINE_PERFORMANCE_TEST (test_cryptic_sparse, -1); -DEFINE_PERFORMANCE_TEST (test_cryptic_half, -1); -DEFINE_PERFORMANCE_TEST (test_cryptic_most, -1); -DEFINE_PERFORMANCE_TEST (test_cryptic_full, -1); + { \ + test_performance (#NAME, fixture); \ + } + +DEFINE_PERFORMANCE_TEST (test_performance_empty); +DEFINE_PERFORMANCE_TEST (test_american_empty); +DEFINE_PERFORMANCE_TEST (test_american_sparse); +DEFINE_PERFORMANCE_TEST (test_american_half); +DEFINE_PERFORMANCE_TEST (test_american_most); +DEFINE_PERFORMANCE_TEST (test_american_full); +DEFINE_PERFORMANCE_TEST (test_cryptic_empty); +DEFINE_PERFORMANCE_TEST (test_cryptic_sparse); +DEFINE_PERFORMANCE_TEST (test_cryptic_half); +DEFINE_PERFORMANCE_TEST (test_cryptic_most); +DEFINE_PERFORMANCE_TEST (test_cryptic_full); #endif -- GitLab From 1442aa4fc52f0049d2cd4e3d768e838999727a74 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 07:42:59 -0400 Subject: [PATCH 25/32] Calculate combined_runtime --- src/clue-matches-tests.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index f41c95a2..7f70594d 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -251,7 +251,7 @@ static void foreach_clue_func (IpuzClues* clues, } #define NUM_RUNS 1 -static void +static gfloat test_performance (const gchar *test_name, PerformanceTestFixture *fixture) { @@ -264,13 +264,20 @@ test_performance (const gchar *test_name, average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; g_print ("\n%s: %f seconds.\n\n", test_name, average_time); + return average_time; } #define DEFINE_PERFORMANCE_TEST(NAME) \ static void \ NAME (PerformanceTestFixture *fixture, gconstpointer user_data) \ - { \ - test_performance (#NAME, fixture); \ + { \ + gfloat *combined_runtime; \ + PerformanceTestUserData *ptest_user_data; \ + \ + ptest_user_data = (PerformanceTestUserData *) user_data; \ + combined_runtime = ptest_user_data->combined_runtime; \ + \ + *combined_runtime += test_performance (#NAME, fixture); \ } DEFINE_PERFORMANCE_TEST (test_performance_empty); @@ -320,6 +327,7 @@ main (int argc, char **argv) { guint num_performance_tests = 0; gfloat combined_runtime = 0; + int retval; g_test_init (&argc, &argv, NULL); @@ -344,14 +352,20 @@ main (int argc, char **argv) ADD_PERFORMANCE_TEST (test_cryptic_half, "cryptic-half.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_most, "cryptic-most.ipuz"); ADD_PERFORMANCE_TEST (test_cryptic_full, "cryptic-full.ipuz"); + #endif + retval = g_test_run (); + + #ifdef RUN_PERFORMANCE_TESTS + g_message (" "); g_message ("******************************"); g_message ("* PERFORMANCE TESTS RESULTS *"); g_message ("* *"); g_message ("* Combined runtime: %f *", combined_runtime); - g_message ("* Average runtime: %f *", 0.0); + g_message ("* Average runtime: %f *", combined_runtime / + num_performance_tests); g_message ("******************************"); #endif - return g_test_run (); + return retval; } -- GitLab From b81bf5fe03ad1e0578bff643313603dfdd3e40f3 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 07:50:53 -0400 Subject: [PATCH 26/32] Edit text output --- src/clue-matches-tests.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 7f70594d..3133ccd0 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -358,13 +358,14 @@ main (int argc, char **argv) #ifdef RUN_PERFORMANCE_TESTS g_message (" "); - g_message ("******************************"); - g_message ("* PERFORMANCE TESTS RESULTS *"); - g_message ("* *"); - g_message ("* Combined runtime: %f *", combined_runtime); - g_message ("* Average runtime: %f *", combined_runtime / - num_performance_tests); - g_message ("******************************"); + g_message ("**************************************"); + g_message ("* PERFORMANCE TESTS RESULTS *"); + g_message ("* *"); + g_message ("* Combined runtime: %f seconds *", combined_runtime); + g_message ("* Average runtime: %f seconds *", combined_runtime / + num_performance_tests); + g_message ("**************************************"); + g_message (" "); #endif return retval; -- GitLab From 8bd82b1f92b20caed8f58202d5fb4f966aaa00c7 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 07:54:19 -0400 Subject: [PATCH 27/32] Add more #ifdef guards --- src/clue-matches-tests.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 3133ccd0..639c0543 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -61,6 +61,8 @@ static void correctness_fixture_tear_down (CorrectnessTestFixture *fixture, */ } +#define RUN_PERFORMANCE_TESTS +#ifdef RUN_PERFORMANCE_TESTS typedef struct { WordList *word_list; IpuzGrid *grid; @@ -90,6 +92,7 @@ static void performance_fixture_tear_down (PerformanceTestFixture *fixture, g_assert_nonnull (fixture->timer); g_timer_destroy (fixture->timer); } +#endif /* IPUZ tests */ @@ -227,7 +230,6 @@ test_duplicate_words_ipuz (CorrectnessTestFixture *fixture, /* Performance tests */ -#define RUN_PERFORMANCE_TESTS #ifdef RUN_PERFORMANCE_TESTS static void foreach_clue_func (IpuzClues* clues, IpuzClueDirection direction, @@ -325,9 +327,12 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_full); int main (int argc, char **argv) { + int retval; + + #ifdef RUN_PERFORMANCE_TESTS guint num_performance_tests = 0; gfloat combined_runtime = 0; - int retval; + #endif g_test_init (&argc, &argv, NULL); -- GitLab From fc53e58ef97ce680c662f7fe611b2de8faaed8a1 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 07:57:25 -0400 Subject: [PATCH 28/32] Edit output message --- src/clue-matches-tests.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 639c0543..14f9227b 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -265,7 +265,9 @@ test_performance (const gchar *test_name, ipuz_clues_foreach_clue (IPUZ_CLUES (grid), foreach_clue_func, fixture); average_time = g_timer_elapsed (fixture->timer, NULL) / NUM_RUNS; - g_print ("\n%s: %f seconds.\n\n", test_name, average_time); + g_message (" "); + g_message ("%s runtime: %f seconds", test_name, average_time); + g_message (" "); return average_time; } -- GitLab From 2536430324e72c384f7d6789eee4ab86c3d7a093 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 08:10:51 -0400 Subject: [PATCH 29/32] Simplify macro --- src/clue-matches-tests.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 14f9227b..0ced6105 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -275,13 +275,11 @@ test_performance (const gchar *test_name, static void \ NAME (PerformanceTestFixture *fixture, gconstpointer user_data) \ { \ - gfloat *combined_runtime; \ PerformanceTestUserData *ptest_user_data; \ - \ ptest_user_data = (PerformanceTestUserData *) user_data; \ - combined_runtime = ptest_user_data->combined_runtime; \ \ - *combined_runtime += test_performance (#NAME, fixture); \ + *(ptest_user_data->combined_runtime) += \ + test_performance (#NAME, fixture); \ } DEFINE_PERFORMANCE_TEST (test_performance_empty); -- GitLab From 4e67b9c09a16d16a0b1d910c7c8f51b14da1f1e5 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Tue, 30 Sep 2025 08:12:47 -0400 Subject: [PATCH 30/32] Rename test --- src/clue-matches-tests.c | 4 +- .../performance-tests/empty-grid.ipuz | 656 ------------------ 2 files changed, 2 insertions(+), 658 deletions(-) delete mode 100644 src/tests/clue-matches/performance-tests/empty-grid.ipuz diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index 0ced6105..e719da54 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -282,7 +282,7 @@ test_performance (const gchar *test_name, test_performance (#NAME, fixture); \ } -DEFINE_PERFORMANCE_TEST (test_performance_empty); +DEFINE_PERFORMANCE_TEST (test_large_empty); DEFINE_PERFORMANCE_TEST (test_american_empty); DEFINE_PERFORMANCE_TEST (test_american_sparse); DEFINE_PERFORMANCE_TEST (test_american_half); @@ -346,7 +346,7 @@ main (int argc, char **argv) ADD_CORRECTNESS_TEST (test_rebus_ipuz, "rebus.ipuz"); #ifdef RUN_PERFORMANCE_TESTS - ADD_PERFORMANCE_TEST (test_performance_empty, "empty-grid.ipuz"); + ADD_PERFORMANCE_TEST (test_large_empty, "large-empty.ipuz"); ADD_PERFORMANCE_TEST (test_american_empty, "american-empty.ipuz"); ADD_PERFORMANCE_TEST (test_american_sparse, "american-sparse.ipuz"); ADD_PERFORMANCE_TEST (test_american_half, "american-half.ipuz"); diff --git a/src/tests/clue-matches/performance-tests/empty-grid.ipuz b/src/tests/clue-matches/performance-tests/empty-grid.ipuz deleted file mode 100644 index dee7d631..00000000 --- a/src/tests/clue-matches/performance-tests/empty-grid.ipuz +++ /dev/null @@ -1,656 +0,0 @@ -{ - "kind" : [ - "http://ipuz.org/crossword#1" - ], - "version" : "http://ipuz.org/v2", - "title" : "My Crossword", - "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "origin" : "GNOME Crosswords Editor (0.3.16)", - "block" : "#", - "empty" : "0", - "dimensions" : { - "width" : 15, - "height" : 15 - }, - "puzzle" : [ - [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15 - ], - [ - 16, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 17, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 18, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 19, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 20, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 21, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 22, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 23, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 24, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 25, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 26, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 27, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 28, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 29, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "solution" : [ - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ] - ], - "showenumerations" : false, - "clues" : { - "Across:Across" : [ - [ - 1, - null - ], - [ - 16, - null - ], - [ - 17, - null - ], - [ - 18, - null - ], - [ - 19, - null - ], - [ - 20, - null - ], - [ - 21, - null - ], - [ - 22, - null - ], - [ - 23, - null - ], - [ - 24, - null - ], - [ - 25, - null - ], - [ - 26, - null - ], - [ - 27, - null - ], - [ - 28, - null - ], - [ - 29, - null - ] - ], - "Down:Down" : [ - [ - 1, - null - ], - [ - 2, - null - ], - [ - 3, - null - ], - [ - 4, - null - ], - [ - 5, - null - ], - [ - 6, - null - ], - [ - 7, - null - ], - [ - 8, - null - ], - [ - 9, - null - ], - [ - 10, - null - ], - [ - 11, - null - ], - [ - 12, - null - ], - [ - 13, - null - ], - [ - 14, - null - ], - [ - 15, - null - ] - ] - } -} \ No newline at end of file -- GitLab From dca8bf629d688a4d539dda0e5a9b95402c56abc9 Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Wed, 1 Oct 2025 01:16:41 -0400 Subject: [PATCH 31/32] Add file that was supposed to be in last commit --- .../performance-tests/large-empty.ipuz | 656 ++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 src/tests/clue-matches/performance-tests/large-empty.ipuz diff --git a/src/tests/clue-matches/performance-tests/large-empty.ipuz b/src/tests/clue-matches/performance-tests/large-empty.ipuz new file mode 100644 index 00000000..dee7d631 --- /dev/null +++ b/src/tests/clue-matches/performance-tests/large-empty.ipuz @@ -0,0 +1,656 @@ +{ + "kind" : [ + "http://ipuz.org/crossword#1" + ], + "version" : "http://ipuz.org/v2", + "title" : "My Crossword", + "charset-str" : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "origin" : "GNOME Crosswords Editor (0.3.16)", + "block" : "#", + "empty" : "0", + "dimensions" : { + "width" : 15, + "height" : 15 + }, + "puzzle" : [ + [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + [ + 16, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 17, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 18, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 19, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 20, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 21, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 22, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 23, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 24, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 25, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 26, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 27, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 28, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 29, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "solution" : [ + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ], + [ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + ] + ], + "showenumerations" : false, + "clues" : { + "Across:Across" : [ + [ + 1, + null + ], + [ + 16, + null + ], + [ + 17, + null + ], + [ + 18, + null + ], + [ + 19, + null + ], + [ + 20, + null + ], + [ + 21, + null + ], + [ + 22, + null + ], + [ + 23, + null + ], + [ + 24, + null + ], + [ + 25, + null + ], + [ + 26, + null + ], + [ + 27, + null + ], + [ + 28, + null + ], + [ + 29, + null + ] + ], + "Down:Down" : [ + [ + 1, + null + ], + [ + 2, + null + ], + [ + 3, + null + ], + [ + 4, + null + ], + [ + 5, + null + ], + [ + 6, + null + ], + [ + 7, + null + ], + [ + 8, + null + ], + [ + 9, + null + ], + [ + 10, + null + ], + [ + 11, + null + ], + [ + 12, + null + ], + [ + 13, + null + ], + [ + 14, + null + ], + [ + 15, + null + ] + ] + } +} \ No newline at end of file -- GitLab From d9fb4a7e9b0d6d3c6e61e5bcfcd97e82dd349dfc Mon Sep 17 00:00:00 2001 From: Victor Ma Date: Fri, 3 Oct 2025 19:03:29 -0400 Subject: [PATCH 32/32] Remove sub-subdirs --- src/clue-matches-tests.c | 52 +++++++++---------- .../american-empty.ipuz | 0 .../american-full.ipuz | 0 .../american-half.ipuz | 0 .../american-most.ipuz | 0 .../american-sparse.ipuz | 0 .../{correctness-tests => }/block-cells.ipuz | 0 .../cryptic-empty.ipuz | 0 .../{performance-tests => }/cryptic-full.ipuz | 0 .../{performance-tests => }/cryptic-half.ipuz | 0 .../{performance-tests => }/cryptic-most.ipuz | 0 .../cryptic-sparse.ipuz | 0 .../{correctness-tests => }/dense.ipuz | 0 .../duplicate-words.ipuz | 0 .../invalid-intersection.ipuz | 0 .../{performance-tests => }/large-empty.ipuz | 0 .../{correctness-tests => }/null-cells.ipuz | 0 .../{correctness-tests => }/rebus.ipuz | 0 .../simple-across.ipuz | 0 .../{correctness-tests => }/simple-down.ipuz | 0 .../valid-intersection.ipuz | 0 21 files changed, 26 insertions(+), 26 deletions(-) rename src/tests/clue-matches/{performance-tests => }/american-empty.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/american-full.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/american-half.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/american-most.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/american-sparse.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/block-cells.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/cryptic-empty.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/cryptic-full.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/cryptic-half.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/cryptic-most.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/cryptic-sparse.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/dense.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/duplicate-words.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/invalid-intersection.ipuz (100%) rename src/tests/clue-matches/{performance-tests => }/large-empty.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/null-cells.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/rebus.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/simple-across.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/simple-down.ipuz (100%) rename src/tests/clue-matches/{correctness-tests => }/valid-intersection.ipuz (100%) diff --git a/src/clue-matches-tests.c b/src/clue-matches-tests.c index e719da54..e13c75a4 100644 --- a/src/clue-matches-tests.c +++ b/src/clue-matches-tests.c @@ -142,14 +142,14 @@ test_clue_matches (WordList *word_list, g_assert_true (word_array_equals (clue_matches, expected_word_array)); } -#define ASSERT_CLUE_MATCHES(DIRECTION, INDEX, ...) \ - test_clue_matches (fixture->word_list, \ - fixture->grid, \ - DIRECTION, \ - INDEX, \ +#define ASSERT_CLUE_MATCHES(DIRECTION, INDEX, ...) \ + test_clue_matches (fixture->word_list, \ + fixture->grid, \ + DIRECTION, \ + INDEX, \ (const gchar*[]){__VA_ARGS__, NULL}) -#define ASSERT_CLUE_MATCHES_EMPTY(DIRECTION, INDEX) \ +#define ASSERT_CLUE_MATCHES_EMPTY(DIRECTION, INDEX) \ ASSERT_CLUE_MATCHES(DIRECTION, INDEX, NULL); static void @@ -298,29 +298,29 @@ DEFINE_PERFORMANCE_TEST (test_cryptic_full); /* Add tests*/ -#define ADD_CORRECTNESS_TEST(test_name, file_name) \ - g_test_add ("/clue_matches/" #test_name, \ - CorrectnessTestFixture, \ - "tests/clue-matches/correctness-tests/" file_name, \ - correctness_fixture_set_up, \ - test_name, \ +#define ADD_CORRECTNESS_TEST(test_name, file_name) \ + g_test_add ("/clue_matches/" #test_name, \ + CorrectnessTestFixture, \ + "tests/clue-matches/" file_name, \ + correctness_fixture_set_up, \ + test_name, \ correctness_fixture_tear_down) -#define ADD_PERFORMANCE_TEST(test_name, file_name) \ - \ - PerformanceTestUserData test_name##_user_data; \ - test_name##_user_data.ipuz_file_path = \ - "tests/clue-matches/performance-tests/" file_name; \ - test_name##_user_data.combined_runtime = &combined_runtime; \ - \ - g_test_add ("/clue_matches/" #test_name, \ - PerformanceTestFixture, \ - &test_name##_user_data, \ - performance_fixture_set_up, \ - test_name, \ - performance_fixture_tear_down); \ - \ +#define ADD_PERFORMANCE_TEST(test_name, file_name) \ + \ + PerformanceTestUserData test_name##_user_data; \ + test_name##_user_data.ipuz_file_path = \ + "tests/clue-matches/" file_name; \ + test_name##_user_data.combined_runtime = &combined_runtime; \ + \ + g_test_add ("/clue_matches/" #test_name, \ + PerformanceTestFixture, \ + &test_name##_user_data, \ + performance_fixture_set_up, \ + test_name, \ + performance_fixture_tear_down); \ + \ num_performance_tests++ diff --git a/src/tests/clue-matches/performance-tests/american-empty.ipuz b/src/tests/clue-matches/american-empty.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/american-empty.ipuz rename to src/tests/clue-matches/american-empty.ipuz diff --git a/src/tests/clue-matches/performance-tests/american-full.ipuz b/src/tests/clue-matches/american-full.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/american-full.ipuz rename to src/tests/clue-matches/american-full.ipuz diff --git a/src/tests/clue-matches/performance-tests/american-half.ipuz b/src/tests/clue-matches/american-half.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/american-half.ipuz rename to src/tests/clue-matches/american-half.ipuz diff --git a/src/tests/clue-matches/performance-tests/american-most.ipuz b/src/tests/clue-matches/american-most.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/american-most.ipuz rename to src/tests/clue-matches/american-most.ipuz diff --git a/src/tests/clue-matches/performance-tests/american-sparse.ipuz b/src/tests/clue-matches/american-sparse.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/american-sparse.ipuz rename to src/tests/clue-matches/american-sparse.ipuz diff --git a/src/tests/clue-matches/correctness-tests/block-cells.ipuz b/src/tests/clue-matches/block-cells.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/block-cells.ipuz rename to src/tests/clue-matches/block-cells.ipuz diff --git a/src/tests/clue-matches/performance-tests/cryptic-empty.ipuz b/src/tests/clue-matches/cryptic-empty.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/cryptic-empty.ipuz rename to src/tests/clue-matches/cryptic-empty.ipuz diff --git a/src/tests/clue-matches/performance-tests/cryptic-full.ipuz b/src/tests/clue-matches/cryptic-full.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/cryptic-full.ipuz rename to src/tests/clue-matches/cryptic-full.ipuz diff --git a/src/tests/clue-matches/performance-tests/cryptic-half.ipuz b/src/tests/clue-matches/cryptic-half.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/cryptic-half.ipuz rename to src/tests/clue-matches/cryptic-half.ipuz diff --git a/src/tests/clue-matches/performance-tests/cryptic-most.ipuz b/src/tests/clue-matches/cryptic-most.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/cryptic-most.ipuz rename to src/tests/clue-matches/cryptic-most.ipuz diff --git a/src/tests/clue-matches/performance-tests/cryptic-sparse.ipuz b/src/tests/clue-matches/cryptic-sparse.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/cryptic-sparse.ipuz rename to src/tests/clue-matches/cryptic-sparse.ipuz diff --git a/src/tests/clue-matches/correctness-tests/dense.ipuz b/src/tests/clue-matches/dense.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/dense.ipuz rename to src/tests/clue-matches/dense.ipuz diff --git a/src/tests/clue-matches/correctness-tests/duplicate-words.ipuz b/src/tests/clue-matches/duplicate-words.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/duplicate-words.ipuz rename to src/tests/clue-matches/duplicate-words.ipuz diff --git a/src/tests/clue-matches/correctness-tests/invalid-intersection.ipuz b/src/tests/clue-matches/invalid-intersection.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/invalid-intersection.ipuz rename to src/tests/clue-matches/invalid-intersection.ipuz diff --git a/src/tests/clue-matches/performance-tests/large-empty.ipuz b/src/tests/clue-matches/large-empty.ipuz similarity index 100% rename from src/tests/clue-matches/performance-tests/large-empty.ipuz rename to src/tests/clue-matches/large-empty.ipuz diff --git a/src/tests/clue-matches/correctness-tests/null-cells.ipuz b/src/tests/clue-matches/null-cells.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/null-cells.ipuz rename to src/tests/clue-matches/null-cells.ipuz diff --git a/src/tests/clue-matches/correctness-tests/rebus.ipuz b/src/tests/clue-matches/rebus.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/rebus.ipuz rename to src/tests/clue-matches/rebus.ipuz diff --git a/src/tests/clue-matches/correctness-tests/simple-across.ipuz b/src/tests/clue-matches/simple-across.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/simple-across.ipuz rename to src/tests/clue-matches/simple-across.ipuz diff --git a/src/tests/clue-matches/correctness-tests/simple-down.ipuz b/src/tests/clue-matches/simple-down.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/simple-down.ipuz rename to src/tests/clue-matches/simple-down.ipuz diff --git a/src/tests/clue-matches/correctness-tests/valid-intersection.ipuz b/src/tests/clue-matches/valid-intersection.ipuz similarity index 100% rename from src/tests/clue-matches/correctness-tests/valid-intersection.ipuz rename to src/tests/clue-matches/valid-intersection.ipuz -- GitLab