summaryrefslogtreecommitdiff
path: root/src/regress/lib/libcrypto/pqueue/pq_test.c
diff options
context:
space:
mode:
authormiod <>2014-05-12 19:14:14 +0000
committermiod <>2014-05-12 19:14:14 +0000
commitbb1f78b0976389edbc302ea662b80029cbf5ce5a (patch)
treef99b0c7d57d24dcda17ac624bffd72e594930568 /src/regress/lib/libcrypto/pqueue/pq_test.c
parent9d93f27329372e68682819911c1e89467694ad93 (diff)
downloadopenbsd-bb1f78b0976389edbc302ea662b80029cbf5ce5a.tar.gz
openbsd-bb1f78b0976389edbc302ea662b80029cbf5ce5a.tar.bz2
openbsd-bb1f78b0976389edbc302ea662b80029cbf5ce5a.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.c24
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 */
63unsigned char prio1[8] = "supercal"; 63unsigned char prio1[8] = "supercal";
64unsigned char prio2[8] = "ifragili"; 64unsigned char prio2[8] = "ifragili";
65unsigned char prio3[8] = "sticexpi"; 65unsigned char prio3[8] = "sticexpi";
66 66
67static void
68pqueue_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
67int 83int
68main(void) 84main(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