summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anderson <ejona86@gmail.com>2010-12-28 00:03:06 -0600
committerEric Anderson <ejona86@gmail.com>2010-12-28 00:03:06 -0600
commitf3beb91856ff2babea54c11d17d235f9701657f1 (patch)
tree1f62df20851a1df68e2e018c4c025c801962a3c3
parent3378383d6fae63b9ad13138405d360bc30e0501f (diff)
downloadmd5game-lcs_upper_bound.tar.gz
md5game-lcs_upper_bound.zip
The rough lcs calculation can't be compared against MSFlcs_upper_bound
PEDANTIC testing showed an error with the current n * 4 + 6. pedantic_n = 7 and n = 6 during the PEDANTIC_TEST. I just reverting to old behavior until we can convert the value to something that can be compared to MSF.
-rw-r--r--runner.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/runner.c b/runner.c
index 5dd494d..bb97328 100644
--- a/runner.c
+++ b/runner.c
@@ -61,8 +61,10 @@
#ifdef PEDANTIC
// use similar to "assert(a >= b);"
# define PEDANTIC_TEST_GTE(a, b) {if ((a) < (b)) printf("Pedantic test failed (%s:%d): %s\n failed: %s (%d) >= %s (%d)\n", __FILE__, __LINE__, input_hex, #a, a, #b, b);}
+# define PEDANTIC_TEST_GT(a, b) {if ((a) <= (b)) printf("Pedantic test failed (%s:%d): %s\n failed: %s (%d) > %s (%d)\n", __FILE__, __LINE__, input_hex, #a, a, #b, b);}
#else
# define PEDANTIC_TEST_GTE(a, b)
+# define PEDANTIC_TEST_GT(a, b)
#endif
#ifdef TIMINGS
@@ -263,10 +265,11 @@ int main() {
* there is a match of 7 or greater, and sometimes return >0 if there
* is a match of 4 or greater.
*/
- n = n * 4 + 6;
- PEDANTIC_TEST_GTE(n, pedantic_n);
- if (n < MSF)
+ // TODO: get this condition to compare against MSF
+ if (n == 0) {
+ PEDANTIC_TEST_GT(MSF, pedantic_n);
break;
+ }
}
possible_matches++;