diff options
| author | miod <> | 2014-05-12 19:14:14 +0000 | 
|---|---|---|
| committer | miod <> | 2014-05-12 19:14:14 +0000 | 
| commit | d65c39e2c5f99603b15513e73dbc0dc5ca5b73fd (patch) | |
| tree | f99b0c7d57d24dcda17ac624bffd72e594930568 /src/regress/lib/libcrypto/pqueue/pq_test.c | |
| parent | 184c91d9e726029e0dd6782d9ec4e2e1a7f7fc70 (diff) | |
| download | openbsd-d65c39e2c5f99603b15513e73dbc0dc5ca5b73fd.tar.gz openbsd-d65c39e2c5f99603b15513e73dbc0dc5ca5b73fd.tar.bz2 openbsd-d65c39e2c5f99603b15513e73dbc0dc5ca5b73fd.zip  | |
Move the `pqueue' part of libcrypto, which is a glorified sorted linked list
of 64-bit data, and only used by DTLS, to libssl where it belongs.
Remove pqueue_print() which is a debugging interface and serves no useful
purpose, except for the regress test, which grows its own pqueue_print()
routine.
Bump libcrypto major and libssl minor.
WARNING: do not update your tree right now, more changes are coming, which
will ride the libcrypto major bump.
Diffstat (limited to 'src/regress/lib/libcrypto/pqueue/pq_test.c')
| -rw-r--r-- | src/regress/lib/libcrypto/pqueue/pq_test.c | 24 | 
1 files changed, 20 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/pqueue/pq_test.c b/src/regress/lib/libcrypto/pqueue/pq_test.c index 32c39cd507..fa78c8fa4c 100644 --- a/src/regress/lib/libcrypto/pqueue/pq_test.c +++ b/src/regress/lib/libcrypto/pqueue/pq_test.c  | |||
| @@ -57,13 +57,29 @@ | |||
| 57 | * | 57 | * | 
| 58 | */ | 58 | */ | 
| 59 | 59 | ||
| 60 | #include "pqueue.h" | 60 | #include <openssl/pqueue.h> | 
| 61 | 61 | ||
| 62 | /* remember to change expected.txt if you change these values */ | 62 | /* remember to change expected.txt if you change these values */ | 
| 63 | unsigned char prio1[8] = "supercal"; | 63 | unsigned char prio1[8] = "supercal"; | 
| 64 | unsigned char prio2[8] = "ifragili"; | 64 | unsigned char prio2[8] = "ifragili"; | 
| 65 | unsigned char prio3[8] = "sticexpi"; | 65 | unsigned char prio3[8] = "sticexpi"; | 
| 66 | 66 | ||
| 67 | static void | ||
| 68 | pqueue_print(pqueue pq) | ||
| 69 | { | ||
| 70 | pitem *iter, *item; | ||
| 71 | |||
| 72 | iter = pqueue_iterator(pq); | ||
| 73 | for (item = pqueue_next(&iter); item != NULL; | ||
| 74 | item = pqueue_next(&iter)) { | ||
| 75 | printf("item\t%02x%02x%02x%02x%02x%02x%02x%02x\n", | ||
| 76 | item->priority[0], item->priority[1], | ||
| 77 | item->priority[2], item->priority[3], | ||
| 78 | item->priority[4], item->priority[5], | ||
| 79 | item->priority[6], item->priority[7]); | ||
| 80 | } | ||
| 81 | } | ||
| 82 | |||
| 67 | int | 83 | int | 
| 68 | main(void) | 84 | main(void) | 
| 69 | { | 85 | { | 
| @@ -82,13 +98,13 @@ main(void) | |||
| 82 | pqueue_insert(pq, item); | 98 | pqueue_insert(pq, item); | 
| 83 | 99 | ||
| 84 | item = pqueue_find(pq, prio1); | 100 | item = pqueue_find(pq, prio1); | 
| 85 | fprintf(stderr, "found %ld\n", item->priority); | 101 | fprintf(stderr, "found %p\n", item->priority); | 
| 86 | 102 | ||
| 87 | item = pqueue_find(pq, prio2); | 103 | item = pqueue_find(pq, prio2); | 
| 88 | fprintf(stderr, "found %ld\n", item->priority); | 104 | fprintf(stderr, "found %p\n", item->priority); | 
| 89 | 105 | ||
| 90 | item = pqueue_find(pq, prio3); | 106 | item = pqueue_find(pq, prio3); | 
| 91 | fprintf(stderr, "found %ld\n", item ? item->priority: 0); | 107 | fprintf(stderr, "found %p\n", item ? item->priority: 0); | 
| 92 | 108 | ||
| 93 | pqueue_print(pq); | 109 | pqueue_print(pq); | 
| 94 | 110 | ||
