1 /* $NetBSD: spewG.c,v 1.1.1.2 2012/05/07 00:41:46 wiz Exp $ */
4 /* spew out a thoroughly gigantic file designed so that bzip2
5 can compress it reasonably rapidly. This is to help test
6 support for large files (> 2GB) in a reasonable amount of time.
7 I suggest you use the undocumented --exponential option to
8 bzip2 when compressing the resulting file; this saves a bit of
9 time. Note: *don't* bother with --exponential when compressing
10 Real Files; it'll just waste a lot of CPU time :-)
11 (but is otherwise harmless).
14 /* ------------------------------------------------------------------
15 This file is part of bzip2/libbzip2, a program and library for
16 lossless, block-sorting data compression.
18 bzip2/libbzip2 version 1.0.6 of 6 September 2010
19 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
21 Please read the WARNING, DISCLAIMER and PATENTS sections in the
24 This program is released under the terms of the license contained
26 ------------------------------------------------------------------ */
29 #define _FILE_OFFSET_BITS 64
34 /* The number of megabytes of junk to spew out (roughly) */
35 #define MEGABYTES 5000
40 int main ( int argc
, char** argv
)
44 setbuffer ( stdout
, buf
, N_BUF
);
45 for (kk
= 0; kk
< MEGABYTES
* 515; kk
+=3) {
47 for (ii
= 0; ii
< p
; ii
++)
48 printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" );
49 for (ii
= 0; ii
< p
-1; ii
++)
50 printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" );
51 for (ii
= 0; ii
< p
+1; ii
++)
52 printf ( "ccccccccccccccccccccccccccccccccccccc" );