Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: tests/create_compress_files.c

Issue 12568011: Update XZ Utils to 5.0.4 (third_party) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xz/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /////////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////////
2 // 2 //
3 /// \file create_compress_files.c 3 /// \file create_compress_files.c
4 /// \brief Creates bunch of test files to be compressed 4 /// \brief Creates bunch of test files to be compressed
5 /// 5 ///
6 /// Using a test file generator program saves space in the source code 6 /// Using a test file generator program saves space in the source code
7 /// package considerably. 7 /// package considerably.
8 // 8 //
9 // Author: Lasse Collin 9 // Author: Lasse Collin
10 // 10 //
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 } 73 }
74 74
75 75
76 // File that repeats "abc\n" a few thousand times. This is targeted 76 // File that repeats "abc\n" a few thousand times. This is targeted
77 // especially at Subblock filter's run-length encoder. 77 // especially at Subblock filter's run-length encoder.
78 static void 78 static void
79 write_abc(FILE *file) 79 write_abc(FILE *file)
80 { 80 {
81 for (size_t i = 0; i < 12345; ++i) 81 for (size_t i = 0; i < 12345; ++i)
82 » » fwrite("abc\n", 4, 1, file); 82 » » if (fwrite("abc\n", 4, 1, file) != 1)
83 » » » exit(1);
83 } 84 }
84 85
85 86
86 // File that doesn't compress. We always use the same random seed to 87 // File that doesn't compress. We always use the same random seed to
87 // generate identical files on all systems. 88 // generate identical files on all systems.
88 static void 89 static void
89 write_random(FILE *file) 90 write_random(FILE *file)
90 { 91 {
91 uint32_t n = 5; 92 uint32_t n = 5;
92 93
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 149
149 150
150 int 151 int
151 main(void) 152 main(void)
152 { 153 {
153 create_test(abc); 154 create_test(abc);
154 create_test(random); 155 create_test(random);
155 create_test(text); 156 create_test(text);
156 return 0; 157 return 0;
157 } 158 }
OLDNEW
« README.chromium ('K') | « tests/Makefile.am ('k') | tests/files/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698