#include <windows.h>
#include <tchar.h>
#include <wchar.h>
#include <stdio.h>
Go to the source code of this file.
|
static BOOL | test_file_truncate (TCHAR *file_name) |
|
static BOOL | create_output_file (TCHAR *file_name, TCHAR *file_mode, TCHAR *file_data) |
|
static BOOL | verify_output_file (TCHAR *file_name, TCHAR *file_mode, TCHAR *file_data) |
|
static int | create_test_file (TCHAR *file_name, TCHAR *write_mode, TCHAR *read_mode, TCHAR *file_data) |
|
static int | check_file_size (TCHAR *file_name, TCHAR *file_mode, int expected) |
|
static int | test_console_io (void) |
|
static int | test_console_getchar (void) |
|
static int | test_console_putch (void) |
|
static int | test_unlink_files (void) |
|
static int | test_text_fileio (TCHAR *file_name, TCHAR *file_data, int tsize, int bsize) |
|
static int | test_binary_fileio (TCHAR *file_name, TCHAR *file_data, int tsize, int bsize) |
|
static int | test_files (int test_num, char *type) |
|
◆ _gettchar
◆ _puttchar
◆ _TEOF
◆ _tfopen
◆ _THEX_FORMAT
◆ _tunlink
◆ TEST_B1_FILE_SIZE
◆ TEST_B2_FILE_SIZE
◆ TEST_B3_FILE_SIZE
◆ TEST_B4_FILE_SIZE
◆ TEST_BUFFER_SIZE
◆ TEST_FILE_LINES
◆ WIN32_LEAN_AND_MEAN
◆ check_file_size()
static int check_file_size |
( |
TCHAR * |
file_name, |
|
|
TCHAR * |
file_mode, |
|
|
int |
expected |
|
) |
| |
|
static |
Definition at line 250 of file _tfileio.c.
251{
256
258
260 }
264 return 1;
265 }
269 }
271 }
276 }
277
279
280 }
285 }
286 } else {
288 }
290}
GLuint GLuint GLsizei count
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
Referenced by test_binary_fileio(), and test_text_fileio().
◆ create_output_file()
◆ create_test_file()
Definition at line 226 of file _tfileio.c.
227{
230 }
234 }
238 }
239 } else {
240
241 return 2;
242 }
243 } else {
245 return 1;
246 }
247 return 0;
248}
static BOOL verify_output_file(TCHAR *file_name, TCHAR *file_mode, TCHAR *file_data)
static BOOL create_output_file(TCHAR *file_name, TCHAR *file_mode, TCHAR *file_data)
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG read_mode
Referenced by test_binary_fileio(), and test_text_fileio().
◆ test_binary_fileio()
Definition at line 369 of file _tfileio.c.
370{
372
377}
static int create_test_file(TCHAR *file_name, TCHAR *write_mode, TCHAR *read_mode, TCHAR *file_data)
static int check_file_size(TCHAR *file_name, TCHAR *file_mode, int expected)
Referenced by test_files().
◆ test_console_getchar()
static int test_console_getchar |
( |
void |
| ) |
|
|
static |
Definition at line 313 of file _tfileio.c.
314{
317
318 _tprintf(
_T(
"Enter lines for dumping or <ctrl-z><nl> to finish:\n"));
319
320
323
324 }
326}
Referenced by test_files().
◆ test_console_io()
static int test_console_io |
( |
void |
| ) |
|
|
static |
Definition at line 292 of file _tfileio.c.
293{
297
299
300
303 }
305 for (
j = 0;
j <
i;
j++) {
307 }
310 return 0;
311}
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
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 GLint GLint j
Referenced by test_files().
◆ test_console_putch()
static int test_console_putch |
( |
void |
| ) |
|
|
static |
Definition at line 328 of file _tfileio.c.
329{
331
343}
_CRTIMP int __cdecl _putch(_In_ int _Ch)
Referenced by test_files().
◆ test_file_truncate()
static BOOL test_file_truncate |
( |
TCHAR * |
file_name | ) |
|
|
static |
Definition at line 80 of file _tfileio.c.
81{
86 TCHAR* file_data =
_T(
"this file should have been truncated to zero bytes...");
88
91 }
92
95 } else {
98 }
100 } else {
103 }
104
110 }
112 } else {
114 }
115
122 }
124 }
129 }
131 } else {
133 }
136 }
138}
Referenced by test_files().
◆ test_files()
static int test_files |
( |
int |
test_num, |
|
|
char * |
type |
|
) |
| |
|
static |
Definition at line 379 of file _tfileio.c.
380{
382
383 printf(
"performing test: %d (%s)\n", test_num,
type);
384
385
387 printf(
"System unable to truncate files yet, unlinking:\n");
389 }
390
391 switch (test_num) {
392 case 1:
394 break;
395 case 2:
397 break;
398 case 3:
400 break;
401 case 4:
403 break;
404 case 5:
406 break;
407 case 6:
409 break;
410 case 7:
412 break;
413 case -1:
415 break;
416 default:
418 break;
419 }
421}
static int test_text_fileio(TCHAR *file_name, TCHAR *file_data, int tsize, int bsize)
static int test_console_io(void)
static BOOL test_file_truncate(TCHAR *file_name)
#define TEST_B2_FILE_SIZE
static int test_binary_fileio(TCHAR *file_name, TCHAR *file_data, int tsize, int bsize)
#define TEST_B1_FILE_SIZE
static int test_unlink_files(void)
static int test_console_putch(void)
static int test_console_getchar(void)
#define TEST_B4_FILE_SIZE
#define TEST_B3_FILE_SIZE
GLuint GLuint GLsizei GLenum type
Referenced by run_ansi_tests(), and run_unicode_tests().
◆ test_text_fileio()
◆ test_unlink_files()
static int test_unlink_files |
( |
void |
| ) |
|
|
static |
◆ verify_output_file()
Definition at line 159 of file _tfileio.c.
160{
163 int line_num = 0;
173 }
177
178 ++line_num;
180 _tprintf(
_T(
"ERROR: read excess bytes from line %d, length %d, but expected %d\n"), line_num,
length, req_len);
181 error_flagged =
TRUE;
182 break;
183 }
185 _tprintf(
_T(
"ERROR: read to few bytes from line %d, length %d, but expected %d\n"), line_num,
length, req_len);
186 error_flagged =
TRUE;
187 break;
188 }
190 _tprintf(
_T(
"STATUS: Verifying %d bytes read from line %d\n"),
length, line_num);
191 }
194 } else {
201 }
202 }
204 } else {
205 error_flagged =
TRUE;
206 }
207 }
209 }
214 }
215 if (!line_num) {
217 }
218 if (error_flagged ==
TRUE) {
221 }
224}
static TCHAR test_buffer[TEST_BUFFER_SIZE]
GLuint GLsizei GLsizei * length
Referenced by create_test_file().
◆ dos_data
Initial value:=
_T(
"line1: this is a bunch of readable text.\r\n")
_T("line2: some more printable
text and punctuation !@
#$%^&*()\r\n")
_T("line3: followed up with some numerals 1234567890\r\n")
_T("line4: done.\r\n")
Definition at line 55 of file _tfileio.c.
Referenced by test_files().
◆ nix_data
Initial value:=
_T(
"line1: this is a bunch of readable text.\n")
_T("line2: some more printable
text and punctuation !@
#$%^&*()\n")
_T("line3: followed up with some numerals 1234567890\n")
_T("line4: done.\n")
Definition at line 60 of file _tfileio.c.
Referenced by test_files().
◆ status_flagged
◆ test_buffer
Definition at line 53 of file _tfileio.c.
Referenced by event_client(), oob_client(), oob_server(), select_server(), simple_client(), simple_mixed_client(), simple_server(), test_frequency(), test_primary(), test_primary_3d(), test_primary_3d_with_listener(), test_primary_secondary(), test_RtlCompressBuffer(), test_secondary(), test_sha_ctx(), and verify_output_file().
◆ verbose_flagged