ReactOS  0.4.12-dev-918-g6c6e7b8
main.c
Go to the documentation of this file.
1 /*
2  * ReactOS test program -
3  *
4  * main.c
5  *
6  * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
7  *
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.
12  *
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.
17  *
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.
21  */
22 
23 #define WIN32_LEAN_AND_MEAN
24 #include <windows.h>
25 #include <tchar.h>
26 #include <wchar.h>
27 #include <stdio.h>
28 #include <stdlib.h>
29 
30 #include "main.h"
31 
32 
33 #define VERSION 1
34 
35 #ifdef UNICODE
36 #define TARGET "UNICODE"
37 #else
38 #define TARGET "MBCS"
39 #endif
40 
43 
44 int usage(char* argv0)
45 {
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");
62  return 0;
63 }
64 
65 int __cdecl main(int argc, char* argv[])
66 {
67  int test_num = 0;
68  int version = 0;
69  int result = 0;
70  int i = 0;
71 
72  printf("%s test application - build %03d (default: %s)\n", argv[0], VERSION, TARGET);
73  if (argc < 2) {
74  return usage(argv[0]);
75  }
76  for (i = 1; i < argc; i++) {
77  if (strstr(argv[i], "ansi") || strstr(argv[i], "ANSI")) {
78  version = 1;
79  } else if (strstr(argv[i], "unicode") || strstr(argv[i], "UNICODE")) {
80  version = 2;
81  } else if (strstr(argv[i], "clean") || strstr(argv[i], "CLEAN")) {
82  test_num = -1;
83  } else if (strstr(argv[i], "verbose") || strstr(argv[i], "VERBOSE")) {
84  verbose_flagged = 1;
85  } else if (strstr(argv[i], "status") || strstr(argv[i], "STATUS")) {
86  status_flagged = 1;
87  } else {
88  test_num = atoi(argv[1]);
89  //if (test_num < 0
90  }
91  }
92  for (i = test_num; i <= test_num; i++) {
93  if (!test_num) {
94  test_num = 4;
95  i = 1;
96  }
97  switch (version) {
98  case 1:
100  break;
101  case 2:
103  break;
104  default:
107  break;
108  }
109  }
110  printf("finished\n");
111  return result;
112 }
113 
114 #ifndef __GNUC__
115 
116 char* args[] = { "fileio.exe", "0", "unicode", "verbose"};
117 
119 {
120  main(2, args);
121  return 0;
122 }
123 
124 #endif /*__GNUC__*/
BOOL verbose_flagged
Definition: main.c:41
static int argc
Definition: ServiceArgs.c:12
#define __cdecl
Definition: accygwin.h:79
#define VERSION
Definition: main.c:33
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
int usage(char *argv0)
Definition: main.c:44
#define argv
Definition: mplay32.c:18
Definition: match.c:390
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
static const WCHAR version[]
Definition: asmname.c:64
int __cdecl mainCRTStartup(void)
Definition: main.c:36
int main(int argc, const char *argv[])
Definition: main.c:122
#define TARGET
Definition: main.c:38
static char argv0[MAX_PATH]
Definition: shlexec.c:56
int run_ansi_tests(int test_num)
Definition: fileio.c:28
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
int run_unicode_tests(int test_num)
Definition: wfileio.c:28
GLuint64EXT * result
Definition: glext.h:11304
BOOL status_flagged
Definition: main.c:42
#define printf
Definition: config.h:203