C
Chris M. Thomasson
This code includes my sub-string search algorithm, the automated test, and a
stress test for my algorithm:
http://clc.pastebin.com/f5cb3bbd2
This testing framework helped me find several bugs in my algorithm. I have
fixed them and so far, so good... I will continue to blast the shi% out of
my algorithm with this test and report any errors here.
The automated test randomly generates a comparand string, then it builds a
source string and inserts the comparand at random positions within it. It
records all the offsets, and the count of matches. Now, you can use this
information to verify that your search algorithm is getting everything
correct. Please refer to the `strstr_test_create()' function which generates
the random data. Then refer to the `strstr_test_xstrstr()' function which
actually verifies that my algorithm is getting things right.
AFAICT, it's a fairly decent way to blast your sub-string search algorithm
with tremendous forms of random data.
Enjoy!
BTW, if you have any improvements in mind, please share all of them.
;^)
stress test for my algorithm:
http://clc.pastebin.com/f5cb3bbd2
This testing framework helped me find several bugs in my algorithm. I have
fixed them and so far, so good... I will continue to blast the shi% out of
my algorithm with this test and report any errors here.
The automated test randomly generates a comparand string, then it builds a
source string and inserts the comparand at random positions within it. It
records all the offsets, and the count of matches. Now, you can use this
information to verify that your search algorithm is getting everything
correct. Please refer to the `strstr_test_create()' function which generates
the random data. Then refer to the `strstr_test_xstrstr()' function which
actually verifies that my algorithm is getting things right.
AFAICT, it's a fairly decent way to blast your sub-string search algorithm
with tremendous forms of random data.
Enjoy!
BTW, if you have any improvements in mind, please share all of them.
;^)