~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progs/perftest.c: Use from Glibc syscall numbers.
[catacomb]
/
math
/
group-test.c
diff --git
a/math/group-test.c
b/math/group-test.c
index
7cd0cd2
..
dfbc37f
100644
(file)
--- a/
math/group-test.c
+++ b/
math/group-test.c
@@
-29,6
+29,7
@@
#include <stdarg.h>
#include <stdarg.h>
+#include <mLib/macros.h>
#include <mLib/testrig.h>
#include "group.h"
#include <mLib/testrig.h>
#include "group.h"
@@
-42,8
+43,11
@@
static group *getgroup(const char *p) {
group *g; qd_parse qd;
qd.p = p; qd.e = 0; g = group_parse(&qd);
if (g && !qd_eofp(&qd)) { G_DESTROYGROUP(g); g = 0; qd.e = "junk at eof"; }
group *g; qd_parse qd;
qd.p = p; qd.e = 0; g = group_parse(&qd);
if (g && !qd_eofp(&qd)) { G_DESTROYGROUP(g); g = 0; qd.e = "junk at eof"; }
- if (!g) { fprintf(stderr, "bad group string `%.*s|%s': %s\n", qd.p - p,
- p, qd.p, qd.e); exit(1); }
+ if (!g) {
+ fprintf(stderr, "bad group string `%.*s|%s': %s\n",
+ (int)(qd.p - p), p, qd.p, qd.e);
+ exit(1);
+ }
return (g);
}
return (g);
}
@@
-75,8
+79,9
@@
static void showmp(const char *p, mp *x, int r) {
putc('\n', stderr);
}
putc('\n', stderr);
}
-static int check(const char *op, const char *gd, group *g,
- ge *r, ge *c, ...) {
+static int EXECL_LIKE(0)
+ check(const char *op, const char *gd, group *g, ge *r, ge *c, ...)
+{
va_list ap;
if (G_EQ(g, r, c)) return (1);
va_list ap;
if (G_EQ(g, r, c)) return (1);
@@
-104,7
+109,7
@@
static int vcheck(dstr *v)
gr->ops->destroy(gr);
if (!e) e = "ok";
G_DESTROYGROUP(g);
gr->ops->destroy(gr);
if (!e) e = "ok";
G_DESTROYGROUP(g);
- if (
strcmp(e
, v[1].buf)) {
+ if (
STRCMP(e, !=
, v[1].buf)) {
ok = 0;
fprintf(stderr, "*** check failed\n");
fprintf(stderr, "*** group: %s\n", v[0].buf);
ok = 0;
fprintf(stderr, "*** check failed\n");
fprintf(stderr, "*** group: %s\n", v[0].buf);
@@
-386,7
+391,7
@@
static int vtobuf(dstr *v)
ic = G_TOBUF(g, &b, x);
c.len = BLEN(&b);
if (ic != ir || (!ic && (c.len != v[3].len ||
ic = G_TOBUF(g, &b, x);
c.len = BLEN(&b);
if (ic != ir || (!ic && (c.len != v[3].len ||
-
memcmp(c.buf
, v[3].buf, c.len)))) {
+
MEMCMP(c.buf, !=
, v[3].buf, c.len)))) {
ok = 0;
fprintf(stderr, "*** tobuf failed\n");
fprintf(stderr, "*** group: %s\n", v[0].buf);
ok = 0;
fprintf(stderr, "*** tobuf failed\n");
fprintf(stderr, "*** group: %s\n", v[0].buf);
@@
-451,7
+456,7
@@
static int vtoraw(dstr *v)
ic = G_TORAW(g, &b, x);
c.len = BLEN(&b);
if (ic != ir || (!ic && (c.len != v[3].len ||
ic = G_TORAW(g, &b, x);
c.len = BLEN(&b);
if (ic != ir || (!ic && (c.len != v[3].len ||
-
memcmp(c.buf
, v[3].buf, c.len)))) {
+
MEMCMP(c.buf, !=
, v[3].buf, c.len)))) {
ok = 0;
fprintf(stderr, "*** toraw failed\n");
fprintf(stderr, "*** group: %s\n", v[0].buf);
ok = 0;
fprintf(stderr, "*** toraw failed\n");
fprintf(stderr, "*** group: %s\n", v[0].buf);