50022dfb7621f449d3ed994662de50c39ae3ad0c
2 * ReactOS test program -
6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #define WIN32_LEAN_AND_MEAN
36 #define TARGET "UNICODE"
41 BOOL verbose_flagged
= 0;
42 BOOL status_flagged
= 0;
44 int usage(char* argv0
)
46 printf("USAGE: %s test_id [unicode]|[ansi] [clean]|[status][verbose]\n", argv0
);
47 printf("\tWhere test_id is one of:\n");
48 printf("\t0 - (default) regression mode, run tests 1-4 displaying failures only\n");
49 printf("\t1 - Write DOS style eol data to file in text mode (text.dos)\n");
50 printf("\t2 - Write NIX style eol data to file in binary mode (binary.dos)\n");
51 printf("\t3 - Write DOS style eol data to file in text mode (text.nix)\n");
52 printf("\t4 - Write NIX style eol data to file in binary mode (binary.nix)\n");
53 printf("\t5 - Echo console line input\n");
54 printf("\t6 - Dump console line input in hex format\n");
55 printf("\t7 - The source code is your friend\n");
56 printf("\t[unicode] - perform tests using UNICODE versions of library functions\n");
57 printf("\t[ansi] - perform tests using ANSI versions of library functions\n");
58 printf("\t If neither unicode or ansi is specified build default is used\n");
59 printf("\t[clean] - delete all temporary test output files\n");
60 printf("\t[status] - enable extra status display while running\n");
61 printf("\t[verbose] - enable verbose output when running\n");
65 int __cdecl
main(int argc
, char* argv
[])
72 printf("%s test application - build %03d (default: %s)\n", argv
[0], VERSION
, TARGET
);
74 return usage(argv
[0]);
76 for (i
= 1; i
< argc
; i
++) {
77 if (strstr(argv
[i
], "ansi") || strstr(argv
[i
], "ANSI")) {
79 } else if (strstr(argv
[i
], "unicode") || strstr(argv
[i
], "UNICODE")) {
81 } else if (strstr(argv
[i
], "clean") || strstr(argv
[i
], "CLEAN")) {
83 } else if (strstr(argv
[i
], "verbose") || strstr(argv
[i
], "VERBOSE")) {
85 } else if (strstr(argv
[i
], "status") || strstr(argv
[i
], "STATUS")) {
88 test_num
= atoi(argv
[1]);
93 for (i
= test_num
; i
<= test_num
; i
++) {
100 result
= test_ansi_files(i
);
103 result
= test_unicode_files(i
);
106 result
= test_ansi_files(i
);
107 result
= test_unicode_files(i
);
113 for (i
= 1; i
<= 4; i
++) {
114 result
= test_ansi_files(i
);
115 result
= test_unicode_files(i
);
120 //result = test_ansi_files(test_num);
121 while (i
<= test_num
) {
122 result
= test_ansi_files(i
);
126 //result = test_unicode_files(test_num);
127 while (i
<= test_num
) {
128 result
= test_unicode_files(i
);
132 while (i
<= test_num
) {
133 result
= test_ansi_files(i
);
134 result
= test_unicode_files(i
);
141 printf("finished\n");
149 writing binary files short one byte. ie. odd number file lengths.
150 reading text files returns one extra byte.
155 char* args
[] = { "fileio.exe", "0", "unicode", "verbose"};
157 char* args1
[] = { "fileio.exe", "1", "unicode" };
158 char* args2
[] = { "fileio.exe", "2", "unicode" };
159 char* args3
[] = { "fileio.exe", "3", "unicode" };
160 char* args4
[] = { "fileio.exe", "4", "unicode" };
162 int __cdecl
mainCRTStartup(void)