projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
083a691
)
Tiny fix to stringmap's run.c
author
Joey Adams
<joeyadams3.14159@gmail.com>
Wed, 15 Jul 2009 21:29:38 +0000
(17:29 -0400)
committer
Joey Adams
<joeyadams3.14159@gmail.com>
Wed, 15 Jul 2009 21:29:38 +0000
(17:29 -0400)
ccan/stringmap/test/run.c
patch
|
blob
|
history
diff --git
a/ccan/stringmap/test/run.c
b/ccan/stringmap/test/run.c
index 37e98e602f8fe9e7a712647360250325876e165c..68c5538a3977d1799e7a78bfa4391b7e0d8da872 100644
(file)
--- a/
ccan/stringmap/test/run.c
+++ b/
ccan/stringmap/test/run.c
@@
-68,6
+68,8
@@
static char *random_string(struct block_pool *bp) {
struct test_entry {
const char *str;
char *value;
struct test_entry {
const char *str;
char *value;
+ /* value is not a string, but a pointer to char marking that
+ this key has been entered already. */
};
static int by_str(const void *ap, const void *bp) {
};
static int by_str(const void *ap, const void *bp) {
@@
-161,11
+163,11
@@
static int test_stringmap(size_t count, FILE *out) {
unique_count++;
} else {
unique_count++;
} else {
- if (strcmp(i->
value, map.last->value
))
+ if (strcmp(i->
str, map.last->str
))
err("lookup returned incorrect string");
if (i->value != *node)
err("lookup returned incorrect value");
err("lookup returned incorrect string");
if (i->value != *node)
err("lookup returned incorrect value");
- if (!*
*nod
e)
+ if (!*
i->valu
e)
err("lookup returned bogus value");
}
}
err("lookup returned bogus value");
}
}