Commit 86502ad3 authored by Rusty Russell's avatar Rusty Russell

strset: update tools for new ABI

Broken since commit 7c69053b
which normalized API.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent c0117ccb
...@@ -69,7 +69,7 @@ int main(int argc, char *argv[]) ...@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
strset_set(&set, words[i]); strset_add(&set, words[i]);
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) ...@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (!strset_test(&set, words[i])) if (!strset_get(&set, words[i]))
abort(); abort();
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -91,7 +91,7 @@ int main(int argc, char *argv[]) ...@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
if (strset_test(&set, misswords[i])) if (strset_get(&set, misswords[i]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -102,7 +102,7 @@ int main(int argc, char *argv[]) ...@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0, j = 0; i < num; i++, j = (j + 10007) % num) for (i = 0, j = 0; i < num; i++, j = (j + 10007) % num)
if (!strset_test(&set, words[j])) if (!strset_get(&set, words[j]))
abort(); abort();
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -111,7 +111,7 @@ int main(int argc, char *argv[]) ...@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (!strset_clear(&set, words[i])) if (!strset_del(&set, words[i]))
abort(); abort();
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -120,7 +120,7 @@ int main(int argc, char *argv[]) ...@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
strset_set(&set, words[i]); strset_add(&set, words[i]);
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -128,7 +128,7 @@ int main(int argc, char *argv[]) ...@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i+=2) for (i = 0; i < num; i+=2)
if (!strset_clear(&set, words[i])) if (!strset_del(&set, words[i]))
abort(); abort();
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -138,7 +138,7 @@ int main(int argc, char *argv[]) ...@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
start = time_now(); start = time_now();
for (i = 0; i < num; i+=2) for (i = 0; i < num; i+=2)
strset_set(&set, misswords[i]); strset_add(&set, misswords[i]);
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -146,10 +146,10 @@ int main(int argc, char *argv[]) ...@@ -146,10 +146,10 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 1; i < num; i+=2) for (i = 1; i < num; i+=2)
if (!strset_test(&set, words[i])) if (!strset_get(&set, words[i]))
abort(); abort();
for (i = 0; i < num; i+=2) { for (i = 0; i < num; i+=2) {
if (!strset_test(&set, misswords[i])) if (!strset_get(&set, misswords[i]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -159,10 +159,10 @@ int main(int argc, char *argv[]) ...@@ -159,10 +159,10 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i+=2) for (i = 0; i < num; i+=2)
if (strset_test(&set, words[i])) if (strset_get(&set, words[i]))
abort(); abort();
for (i = 1; i < num; i+=2) { for (i = 1; i < num; i+=2) {
if (strset_test(&set, misswords[i])) if (strset_get(&set, misswords[i]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -173,9 +173,9 @@ int main(int argc, char *argv[]) ...@@ -173,9 +173,9 @@ int main(int argc, char *argv[])
printf("#11: Churn 1: "); printf("#11: Churn 1: ");
start = time_now(); start = time_now();
for (j = 0; j < num; j+=2) { for (j = 0; j < num; j+=2) {
if (!strset_clear(&set, misswords[j])) if (!strset_del(&set, misswords[j]))
abort(); abort();
if (!strset_set(&set, words[j])) if (!strset_add(&set, words[j]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -184,9 +184,9 @@ int main(int argc, char *argv[]) ...@@ -184,9 +184,9 @@ int main(int argc, char *argv[])
printf("#12: Churn 2: "); printf("#12: Churn 2: ");
start = time_now(); start = time_now();
for (j = 1; j < num; j+=2) { for (j = 1; j < num; j+=2) {
if (!strset_clear(&set, words[j])) if (!strset_del(&set, words[j]))
abort(); abort();
if (!strset_set(&set, misswords[j])) if (!strset_add(&set, misswords[j]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -195,9 +195,9 @@ int main(int argc, char *argv[]) ...@@ -195,9 +195,9 @@ int main(int argc, char *argv[])
printf("#13: Churn 3: "); printf("#13: Churn 3: ");
start = time_now(); start = time_now();
for (j = 1; j < num; j+=2) { for (j = 1; j < num; j+=2) {
if (!strset_clear(&set, misswords[j])) if (!strset_del(&set, misswords[j]))
abort(); abort();
if (!strset_set(&set, words[j])) if (!strset_add(&set, words[j]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -208,7 +208,7 @@ int main(int argc, char *argv[]) ...@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (!strset_test(&set, words[i])) if (!strset_get(&set, words[i]))
abort(); abort();
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
...@@ -217,7 +217,7 @@ int main(int argc, char *argv[]) ...@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
if (strset_test(&set, misswords[i])) if (strset_get(&set, misswords[i]))
abort(); abort();
} }
stop = time_now(); stop = time_now();
...@@ -228,7 +228,7 @@ int main(int argc, char *argv[]) ...@@ -228,7 +228,7 @@ int main(int argc, char *argv[])
fflush(stdout); fflush(stdout);
start = time_now(); start = time_now();
for (i = 0, j = 0; i < num; i++, j = (j + 10007) % num) for (i = 0, j = 0; i < num; i++, j = (j + 10007) % num)
if (!strset_test(&set, words[j])) if (!strset_get(&set, words[j]))
abort(); abort();
stop = time_now(); stop = time_now();
printf(" %zu ns\n", normalize(&start, &stop, num)); printf(" %zu ns\n", normalize(&start, &stop, num));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment