X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fsort-test.c;h=208de918fcc340f44f74c473a2826b22f8f01326;hb=568071c379af91c725b3db1da2c615bd4a203e93;hp=92f8d9b762d861574d9b13972affe5e8a15f0432;hpb=3f93cae0cb8c5bcf7e5319f16f79de2b25b4ead1;p=libucw.git diff --git a/lib/sorter/sort-test.c b/lib/sorter/sort-test.c index 92f8d9b7..208de918 100644 --- a/lib/sorter/sort-test.c +++ b/lib/sorter/sort-test.c @@ -21,6 +21,13 @@ #include #include +/*** A hack for overriding radix-sorter configuration ***/ + +#ifdef FORCE_RADIX_BITS +#undef CONFIG_UCW_RADIX_SORTER_BITS +#define CONFIG_UCW_RADIX_SORTER_BITS FORCE_RADIX_BITS +#endif + /*** Time measurement ***/ static timestamp_t timer; @@ -468,7 +475,7 @@ static int s5_presort(struct fastbuf *dest, void *buf, size_t bufsize) n++; if (!n) return 0; - s5p_sort(a, n, NULL, 0); + s5p_sort(a, n); uns i = 0; while (i < n) { @@ -663,9 +670,20 @@ main(int argc, char **argv) goto usage; break; case 't': - t = atol(optarg); - if (t >= TMAX) - goto usage; + { + char *w[32]; + int f = sepsplit(optarg, ',', w, ARRAY_SIZE(w)); + if (f < 0) + goto usage; + t = 0; + for (int i=0; i= TMAX) + goto usage; + t |= 1 << j; + } + } break; case 'v': sorter_trace++; @@ -678,10 +696,8 @@ main(int argc, char **argv) if (optind != argc) goto usage; - if (t != ~0U) - run_test(t, size); - else - for (uns i=0; i