1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id BC35F431FAF
\r
6 for <notmuch@notmuchmail.org>; Sun, 15 Jan 2012 00:05:18 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5
\r
12 tests=[HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id m9UHXtLjTjfT for <notmuch@notmuchmail.org>;
\r
16 Sun, 15 Jan 2012 00:05:17 -0800 (PST)
\r
17 Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com
\r
18 [209.85.210.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 49D2A431FAE
\r
21 for <notmuch@notmuchmail.org>; Sun, 15 Jan 2012 00:05:17 -0800 (PST)
\r
22 Received: by dalz17 with SMTP id z17so2743369dal.26
\r
23 for <notmuch@notmuchmail.org>; Sun, 15 Jan 2012 00:05:15 -0800 (PST)
\r
25 Received: by 10.68.213.38 with SMTP id np6mr16285599pbc.37.1326614715150; Sun,
\r
26 15 Jan 2012 00:05:15 -0800 (PST)
\r
27 Received: by 10.68.58.234 with HTTP; Sun, 15 Jan 2012 00:05:15 -0800 (PST)
\r
28 Received: by 10.68.58.234 with HTTP; Sun, 15 Jan 2012 00:05:15 -0800 (PST)
\r
29 In-Reply-To: <1326591624-15493-10-git-send-email-david@tethera.net>
\r
30 References: <874nwxbkhr.fsf@zancas.localnet>
\r
31 <1326591624-15493-1-git-send-email-david@tethera.net>
\r
32 <1326591624-15493-10-git-send-email-david@tethera.net>
\r
33 Date: Sun, 15 Jan 2012 10:05:15 +0200
\r
35 <CAB+hUn9Eas_4DRc8FDk+S88JiWhcOipHc_ePn4pHe89B72=JiA@mail.gmail.com>
\r
36 Subject: Re: [PATCH v3 09/10] random-dump.c: new test-binary to generate dump
\r
38 From: Jani Nikula <jani@nikula.org>
\r
39 To: David Bremner <david@tethera.net>
\r
40 Content-Type: multipart/alternative; boundary=e89a8ff1c322d9b16904b68c8ec8
\r
41 Cc: notmuch@notmuchmail.org, David Bremner <bremner@debian.org>
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Sun, 15 Jan 2012 08:05:18 -0000
\r
56 --e89a8ff1c322d9b16904b68c8ec8
\r
57 Content-Type: text/plain; charset=UTF-8
\r
59 On Jan 15, 2012 3:41 AM, "David Bremner" <david@tethera.net> wrote:
\r
61 > From: David Bremner <bremner@debian.org>
\r
63 > This binary creates a "torture test" dump file for the new dump
\r
66 > test/Makefile.local | 4 ++
\r
68 > test/random-dump.c | 144
\r
69 +++++++++++++++++++++++++++++++++++++++++++++++++++
\r
70 > 3 files changed, 149 insertions(+), 1 deletions(-)
\r
71 > create mode 100644 test/random-dump.c
\r
73 > diff --git a/test/Makefile.local b/test/Makefile.local
\r
74 > index ba697f4..b59f837 100644
\r
75 > --- a/test/Makefile.local
\r
76 > +++ b/test/Makefile.local
\r
77 > @@ -16,6 +16,9 @@ $(dir)/arg-test: $(dir)/arg-test.o
\r
78 command-line-arguments.o util/libutil.a
\r
79 > $(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o
\r
81 > $(call quiet,CC) -I. $^ -o $@ -ltalloc
\r
83 > +$(dir)/random-dump: $(dir)/random-dump.o command-line-arguments.o
\r
85 > + $(call quiet,CC) -I. $^ -o $@ -ltalloc -lm
\r
87 > $(dir)/smtp-dummy: $(smtp_dummy_modules)
\r
88 > $(call quiet,CC) $^ -o $@
\r
90 > @@ -25,6 +28,7 @@ $(dir)/symbol-test: $(dir)/symbol-test.o
\r
91 > .PHONY: test check
\r
93 > test-binaries: $(dir)/arg-test $(dir)/hex-xcode \
\r
94 > + $(dir)/random-dump \
\r
95 > $(dir)/smtp-dummy $(dir)/symbol-test
\r
97 > test: all test-binaries
\r
98 > diff --git a/test/basic b/test/basic
\r
99 > index af57026..e3a6cef 100755
\r
102 > @@ -54,7 +54,7 @@ test_begin_subtest 'Ensure that all available tests
\r
103 will be run by notmuch-test'
\r
104 > eval $(sed -n -e '/^TESTS="$/,/^"$/p' $TEST_DIRECTORY/notmuch-test)
\r
105 > tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
\r
106 > available=$(find "$TEST_DIRECTORY" -maxdepth 1 -type f -executable
\r
109 "/^(aggregate-results.sh|notmuch-test|smtp-dummy|test-verbose|symbol-test|arg-test|hex-xcode)$/d"
\r
112 "/^(aggregate-results.sh|notmuch-test|smtp-dummy|test-verbose|symbol-test|arg-test|hex-xcode|random-dump)$/d"
\r
115 > test_expect_equal "$tests_in_suite" "$available"
\r
117 > diff --git a/test/random-dump.c b/test/random-dump.c
\r
118 > new file mode 100644
\r
119 > index 0000000..1949425
\r
121 > +++ b/test/random-dump.c
\r
122 > @@ -0,0 +1,144 @@
\r
124 > + Generate a random dump file in 'notmuch' format.
\r
125 > + Generated message-id's and tags are intentionally nasty.
\r
127 > + We restrict ourselves to 7 bit message-ids, because generating
\r
128 > + random valid UTF-8 seems like work. And invalid UTF-8 can't be
\r
129 > + round-tripped via Xapian.
\r
133 > +#include <stdlib.h>
\r
134 > +#include <assert.h>
\r
135 > +#include <talloc.h>
\r
136 > +#include <string.h>
\r
137 > +#include "math.h"
\r
138 > +#include "hex-escape.h"
\r
139 > +#include "command-line-arguments.h"
\r
142 > +hex_out (void *ctx, char *buf)
\r
144 > + static char *encoded_buf = NULL;
\r
145 > + static size_t encoded_buf_size = 0;
\r
147 > + if (hex_encode (ctx, buf, &encoded_buf, &encoded_buf_size) !=
\r
149 > + fprintf (stderr, "Hex encoding failed");
\r
153 > + fputs (encoded_buf, stdout);
\r
157 > +random_chars (char *buf, int from, int stop, int max_char,
\r
158 > + const char *blacklist)
\r
162 > + for (i = from; i < stop; i++) {
\r
164 > + buf[i] = ' ' + (random () % (max_char - ' '));
\r
165 > + } while (blacklist && strchr (blacklist, buf[i]));
\r
170 > +random_tag (void *ctx, size_t len)
\r
172 > + static char *buf = NULL;
\r
173 > + static size_t buf_len = 0;
\r
175 > + int use = (random () % (len - 1)) + 1;
\r
177 > + if (len > buf_len) {
\r
178 > + buf = talloc_realloc (ctx, buf, char, len);
\r
182 > + random_chars (buf, 0, use, 255, NULL);
\r
184 > + buf[use] = '\0';
\r
186 > + hex_out (ctx, buf);
\r
190 > +random_message_id (void *ctx, size_t len)
\r
192 > + static char *buf = NULL;
\r
193 > + static size_t buf_len = 0;
\r
195 > + int lhs_len = (random () % (len / 2 - 1)) + 1;
\r
197 > + int rhs_len = (random () % len / 2) + 1;
\r
199 > + const char *blacklist = "\n\r@<>[]()";
\r
201 > + if (len > buf_len) {
\r
202 > + buf = talloc_realloc (ctx, buf, char, len);
\r
206 > + random_chars (buf, 0, lhs_len, 127, blacklist);
\r
208 > + buf[lhs_len] = '@';
\r
210 > + random_chars (buf, lhs_len + 1, lhs_len + rhs_len + 1, 127,
\r
213 > + hex_out (ctx, buf);
\r
217 > +main (int argc, char **argv)
\r
220 > + void *ctx = talloc_new (NULL);
\r
221 > + int num_lines = 500;
\r
222 > + int max_tags = 10;
\r
223 > + int message_id_len = 100;
\r
224 > + int tag_len = 50;
\r
225 > + int seed = 734569;
\r
227 > + int pad_tag = 0, pad_mid = 0;
\r
229 > + notmuch_opt_desc_t options[] = {
\r
230 > + { NOTMUCH_OPT_INT, &num_lines, "num-lines", 'n', 0 },
\r
231 > + { NOTMUCH_OPT_INT, &max_tags, "max-tags", 'm', 0 },
\r
232 > + { NOTMUCH_OPT_INT, &message_id_len, "message-id-len", 'M', 0 },
\r
233 > + { NOTMUCH_OPT_INT, &tag_len, "tag-len", 't', 0 },
\r
234 > + { NOTMUCH_OPT_INT, &seed, "tag-len", 't', 0 },
\r
238 > + { 0, 0, 0, 0, 0 }
\r
241 > + int opt_index = parse_arguments (argc, argv, options, 1);
\r
243 > + if (opt_index < 0)
\r
246 > + pad_mid = ((int) log10 (num_lines) + 1);
\r
247 > + pad_tag = ((int) log10 (max_tags)) + 1;
\r
249 > + srandom (seed);
\r
252 > + for (line = 0; line < num_lines; line++) {
\r
254 > + printf ("%0*d-", pad_mid, line);
\r
256 > + random_message_id (ctx, message_id_len);
\r
258 > + int num_tags = random () % (max_tags + 1);
\r
261 > + for (j = 0; j < num_tags; j++) {
\r
262 > + printf (" %0*d-", pad_tag, j);
\r
263 > + random_tag (ctx, tag_len);
\r
265 > + putchar ('\n');
\r
268 > + talloc_free (ctx);
\r
275 > _______________________________________________
\r
276 > notmuch mailing list
\r
277 > notmuch@notmuchmail.org
\r
278 > http://notmuchmail.org/mailman/listinfo/notmuch
\r
280 --e89a8ff1c322d9b16904b68c8ec8
\r
281 Content-Type: text/html; charset=UTF-8
\r
282 Content-Transfer-Encoding: quoted-printable
\r
285 On Jan 15, 2012 3:41 AM, "David Bremner" <<a href=3D"mailto:da=
\r
286 vid@tethera.net">david@tethera.net</a>> wrote:<br>
\r
288 > From: David Bremner <<a href=3D"mailto:bremner@debian.org">bremner@=
\r
289 debian.org</a>><br>
\r
291 > This binary creates a "torture test" dump file for the new d=
\r
295 > =C2=A0test/Makefile.local | =C2=A0 =C2=A04 ++<br>
\r
296 > =C2=A0test/basic =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A02 +-=
\r
298 > =C2=A0test/random-dump.c =C2=A0| =C2=A0144 +++++++++++++++++++++++++++=
\r
299 ++++++++++++++++++++++++<br>
\r
300 > =C2=A03 files changed, 149 insertions(+), 1 deletions(-)<br>
\r
301 > =C2=A0create mode 100644 test/random-dump.c<br>
\r
303 > diff --git a/test/Makefile.local b/test/Makefile.local<br>
\r
304 > index ba697f4..b59f837 100644<br>
\r
305 > --- a/test/Makefile.local<br>
\r
306 > +++ b/test/Makefile.local<br>
\r
307 > @@ -16,6 +16,9 @@ $(dir)/arg-test: $(dir)/arg-test.o command-line-argu=
\r
308 ments.o util/libutil.a<br>
\r
309 > =C2=A0$(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o ut=
\r
311 > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call quiet,CC) -I. $^ -o $@ -ltalloc<br>
\r
313 > +$(dir)/random-dump: =C2=A0$(dir)/random-dump.o command-line-arguments=
\r
314 .o util/libutil.a<br>
\r
315 > + =C2=A0 =C2=A0 =C2=A0 $(call quiet,CC) -I. $^ -o $@ -ltalloc -lm<br>
\r
317 > =C2=A0$(dir)/smtp-dummy: $(smtp_dummy_modules)<br>
\r
318 > =C2=A0 =C2=A0 =C2=A0 =C2=A0$(call quiet,CC) $^ -o $@<br>
\r
320 > @@ -25,6 +28,7 @@ $(dir)/symbol-test: $(dir)/symbol-test.o<br>
\r
321 > =C2=A0.PHONY: test check<br>
\r
323 > =C2=A0test-binaries: $(dir)/arg-test $(dir)/hex-xcode \<br>
\r
324 > + =C2=A0 =C2=A0 =C2=A0 $(dir)/random-dump \<br>
\r
325 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(dir)/smtp-dummy $(dir)/symbol-test<br>
\r
327 > =C2=A0test: =C2=A0all test-binaries<br>
\r
328 > diff --git a/test/basic b/test/basic<br>
\r
329 > index af57026..e3a6cef 100755<br>
\r
330 > --- a/test/basic<br>
\r
331 > +++ b/test/basic<br>
\r
332 > @@ -54,7 +54,7 @@ test_begin_subtest 'Ensure that all available te=
\r
333 sts will be run by notmuch-test'<br>
\r
334 > =C2=A0eval $(sed -n -e '/^TESTS=3D"$/,/^"$/p' $TEST_=
\r
335 DIRECTORY/notmuch-test)<br>
\r
336 > =C2=A0tests_in_suite=3D$(for i in $TESTS; do echo $i; done | sort)<br>
\r
337 > =C2=A0available=3D$(find "$TEST_DIRECTORY" -maxdepth 1 -type=
\r
338 f -executable -printf '%f\n' | \<br>
\r
339 > - =C2=A0 =C2=A0sed -r -e "/^(aggregate-results.sh|notmuch-test|sm=
\r
340 tp-dummy|test-verbose|symbol-test|arg-test|hex-xcode)$/d" | \<br>
\r
341 > + =C2=A0 =C2=A0sed -r -e "/^(aggregate-results.sh|notmuch-test|sm=
\r
342 tp-dummy|test-verbose|symbol-test|arg-test|hex-xcode|random-dump)$/d" =
\r
344 > =C2=A0 =C2=A0 sort)<br>
\r
345 > =C2=A0test_expect_equal "$tests_in_suite" "$available&q=
\r
348 > diff --git a/test/random-dump.c b/test/random-dump.c<br>
\r
349 > new file mode 100644<br>
\r
350 > index 0000000..1949425<br>
\r
351 > --- /dev/null<br>
\r
352 > +++ b/test/random-dump.c<br>
\r
353 > @@ -0,0 +1,144 @@<br>
\r
355 > + =C2=A0 Generate a random dump file in 'notmuch' format.<br>
\r
356 > + =C2=A0 Generated message-id's and tags are intentionally nasty.<=
\r
359 > + =C2=A0 We restrict ourselves to 7 bit message-ids, because generatin=
\r
361 > + =C2=A0 random valid UTF-8 seems like work. And invalid UTF-8 can'=
\r
363 > + =C2=A0 round-tripped via Xapian.<br>
\r
367 > +#include <stdlib.h><br>
\r
368 > +#include <assert.h><br>
\r
369 > +#include <talloc.h><br>
\r
370 > +#include <string.h><br>
\r
371 > +#include "math.h"<br>
\r
372 > +#include "hex-escape.h"<br>
\r
373 > +#include "command-line-arguments.h"<br>
\r
375 > +static void<br>
\r
376 > +hex_out (void *ctx, char *buf)<br>
\r
378 > + =C2=A0 =C2=A0static char *encoded_buf =3D NULL;<br>
\r
379 > + =C2=A0 =C2=A0static size_t encoded_buf_size =3D 0;<br>
\r
381 > + =C2=A0 =C2=A0if (hex_encode (ctx, buf, &encoded_buf, &encode=
\r
382 d_buf_size) !=3D HEX_SUCCESS) {<br>
\r
383 > + =C2=A0 =C2=A0 =C2=A0 fprintf (stderr, "Hex encoding failed"=
\r
385 > + =C2=A0 =C2=A0 =C2=A0 exit (1);<br>
\r
386 > + =C2=A0 =C2=A0}<br>
\r
388 > + =C2=A0 =C2=A0fputs (encoded_buf, stdout);<br>
\r
391 > +static void<br>
\r
392 > +random_chars (char *buf, int from, int stop, int max_char,<br>
\r
393 > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const char *blacklist)<br>
\r
395 > + =C2=A0 =C2=A0int i;<br>
\r
397 > + =C2=A0 =C2=A0for (i =3D from; i < stop; i++) {<br>
\r
398 > + =C2=A0 =C2=A0 =C2=A0 do {<br>
\r
399 > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[i] =3D ' ' + (random =
\r
400 () % (max_char - ' '));<br>
\r
401 > + =C2=A0 =C2=A0 =C2=A0 } while (blacklist && strchr (blacklist=
\r
403 > + =C2=A0 =C2=A0}<br>
\r
406 > +static void<br>
\r
407 > +random_tag (void *ctx, size_t len)<br>
\r
409 > + =C2=A0 =C2=A0static char *buf =3D NULL;<br>
\r
410 > + =C2=A0 =C2=A0static size_t buf_len =3D 0;<br>
\r
412 > + =C2=A0 =C2=A0int use =3D (random () % (len - 1)) + 1;<br>
\r
414 > + =C2=A0 =C2=A0if (len > buf_len) {<br>
\r
415 > + =C2=A0 =C2=A0 =C2=A0 buf =3D talloc_realloc (ctx, buf, char, len);<b=
\r
417 > + =C2=A0 =C2=A0 =C2=A0 buf_len =3D len;<br>
\r
418 > + =C2=A0 =C2=A0}<br>
\r
420 > + =C2=A0 =C2=A0random_chars (buf, 0, use, 255, NULL);<br>
\r
422 > + =C2=A0 =C2=A0buf[use] =3D '\0';<br>
\r
424 > + =C2=A0 =C2=A0hex_out (ctx, buf);<br>
\r
427 > +static void<br>
\r
428 > +random_message_id (void *ctx, size_t len)<br>
\r
430 > + =C2=A0 =C2=A0static char *buf =3D NULL;<br>
\r
431 > + =C2=A0 =C2=A0static size_t buf_len =3D 0;<br>
\r
433 > + =C2=A0 =C2=A0int lhs_len =3D (random () % (len / 2 - 1)) + 1;<br>
\r
435 > + =C2=A0 =C2=A0int rhs_len =3D (random () % len / 2) + 1;<br>
\r
437 > + =C2=A0 =C2=A0const char *blacklist =3D "\n\r@<>[]()"=
\r
440 > + =C2=A0 =C2=A0if (len > buf_len) {<br>
\r
441 > + =C2=A0 =C2=A0 =C2=A0 buf =3D talloc_realloc (ctx, buf, char, len);<b=
\r
443 > + =C2=A0 =C2=A0 =C2=A0 buf_len =3D len;<br>
\r
444 > + =C2=A0 =C2=A0}<br>
\r
446 > + =C2=A0 =C2=A0random_chars (buf, 0, lhs_len, 127, blacklist);<br>
\r
448 > + =C2=A0 =C2=A0buf[lhs_len] =3D '@';<br>
\r
450 > + =C2=A0 =C2=A0random_chars (buf, lhs_len + 1, lhs_len + rhs_len + 1, =
\r
451 127, blacklist);<br>
\r
453 > + =C2=A0 =C2=A0hex_out (ctx, buf);<br>
\r
457 > +main (int argc, char **argv)<br>
\r
460 > + =C2=A0 =C2=A0void *ctx =3D talloc_new (NULL);<br>
\r
461 > + =C2=A0 =C2=A0int num_lines =3D 500;<br>
\r
462 > + =C2=A0 =C2=A0int max_tags =3D 10;<br>
\r
463 > + =C2=A0 =C2=A0int message_id_len =3D 100;<br>
\r
464 > + =C2=A0 =C2=A0int tag_len =3D 50;<br>
\r
465 > + =C2=A0 =C2=A0int seed =3D 734569;<br>
\r
467 > + =C2=A0 =C2=A0int pad_tag =3D 0, pad_mid =3D 0;<br>
\r
469 > + =C2=A0 =C2=A0notmuch_opt_desc_t options[] =3D {<br>
\r
470 > + =C2=A0 =C2=A0 =C2=A0 { NOTMUCH_OPT_INT, &num_lines, "num-li=
\r
471 nes", 'n', 0 },<br>
\r
472 > + =C2=A0 =C2=A0 =C2=A0 { NOTMUCH_OPT_INT, &max_tags, "max-tag=
\r
473 s", 'm', 0 },<br>
\r
474 > + =C2=A0 =C2=A0 =C2=A0 { NOTMUCH_OPT_INT, &message_id_len, "m=
\r
475 essage-id-len", 'M', 0 },<br>
\r
476 > + =C2=A0 =C2=A0 =C2=A0 { NOTMUCH_OPT_INT, &tag_len, "tag-len&=
\r
477 quot;, 't', 0 },<br>
\r
478 > + =C2=A0 =C2=A0 =C2=A0 { NOTMUCH_OPT_INT, &seed, "tag-len&quo=
\r
479 t;, 't', 0 },</p>
\r
480 <p>s/tag-len/seed/</p>
\r
481 <p>> + =C2=A0 =C2=A0 =C2=A0 { 0, 0, 0, 0, 0 }<br>
\r
482 > + =C2=A0 =C2=A0};<br>
\r
484 > + =C2=A0 =C2=A0int opt_index =3D parse_arguments (argc, argv, options,=
\r
487 > + =C2=A0 =C2=A0if (opt_index < 0)<br>
\r
488 > + =C2=A0 =C2=A0 =C2=A0 exit (1);<br>
\r
490 > + =C2=A0 =C2=A0pad_mid =3D ((int) log10 (num_lines) + 1);<br>
\r
491 > + =C2=A0 =C2=A0pad_tag =3D ((int) log10 (max_tags)) + 1;<br>
\r
493 > + =C2=A0 =C2=A0srandom (seed);<br>
\r
495 > + =C2=A0 =C2=A0int line;<br>
\r
496 > + =C2=A0 =C2=A0for (line =3D 0; line < num_lines; line++) {<br>
\r
498 > + =C2=A0 =C2=A0 =C2=A0 printf ("%0*d-", pad_mid, line);<br>
\r
500 > + =C2=A0 =C2=A0 =C2=A0 random_message_id (ctx, message_id_len);<br>
\r
502 > + =C2=A0 =C2=A0 =C2=A0 int num_tags =3D random () % (max_tags + 1);<br=
\r
505 > + =C2=A0 =C2=A0 =C2=A0 int j;<br>
\r
506 > + =C2=A0 =C2=A0 =C2=A0 for (j =3D 0; j < num_tags; j++) {<br>
\r
507 > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 printf (" %0*d-", pad_t=
\r
509 > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 random_tag (ctx, tag_len);<br>
\r
510 > + =C2=A0 =C2=A0 =C2=A0 }<br>
\r
511 > + =C2=A0 =C2=A0 =C2=A0 putchar ('\n');<br>
\r
512 > + =C2=A0 =C2=A0}<br>
\r
514 > + =C2=A0 =C2=A0talloc_free (ctx);<br>
\r
516 > + =C2=A0 =C2=A0return 0;<br>
\r
521 > _______________________________________________<br>
\r
522 > notmuch mailing list<br>
\r
523 > <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a>=
\r
525 > <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch">http://not=
\r
526 muchmail.org/mailman/listinfo/notmuch</a><br>
\r
529 --e89a8ff1c322d9b16904b68c8ec8--
\r