#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
#define _THEX_FORMAT "0x%02x " |
◆ _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.
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
GLuint GLuint GLsizei count
_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()
Definition at line 140 of file _tfileio.c.
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
Referenced by create_test_file().
◆ create_test_file()
Definition at line 226 of file _tfileio.c.
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.
static int check_file_size(TCHAR *file_name, TCHAR *file_mode, int expected)
static int create_test_file(TCHAR *file_name, TCHAR *write_mode, TCHAR *read_mode, TCHAR *file_data)
Referenced by test_files().
◆ test_console_getchar()
static int test_console_getchar |
( |
void |
| ) |
|
|
static |
◆ test_console_io()
static int test_console_io |
( |
void |
| ) |
|
|
static |
Definition at line 292 of file _tfileio.c.
305 for (
j = 0;
j <
i;
j++) {
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
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
Referenced by test_files().
◆ test_console_putch()
static int test_console_putch |
( |
void |
| ) |
|
|
static |
◆ test_file_truncate()
static BOOL test_file_truncate |
( |
TCHAR * |
file_name | ) |
|
|
static |
Definition at line 80 of file _tfileio.c.
86 TCHAR* file_data =
_T(
"this file should have been truncated to zero bytes...");
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
GLuint GLuint GLsizei count
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
Referenced by test_files().
◆ test_files()
static int test_files |
( |
int |
test_num, |
|
|
char * |
type |
|
) |
| |
|
static |
Definition at line 379 of file _tfileio.c.
383 printf(
"performing test: %d (%s)\n", test_num,
type);
387 printf(
"System unable to truncate files yet, unlinking:\n");
#define TEST_B4_FILE_SIZE
static BOOL test_file_truncate(TCHAR *file_name)
#define TEST_B1_FILE_SIZE
static int test_unlink_files(void)
#define TEST_B3_FILE_SIZE
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_console_getchar(void)
static int test_console_io(void)
GLuint GLuint GLsizei GLenum type
static int test_console_putch(void)
#define TEST_B2_FILE_SIZE
Referenced by run_ansi_tests(), and run_unicode_tests().
◆ test_text_fileio()
Definition at line 359 of file _tfileio.c.
static int check_file_size(TCHAR *file_name, TCHAR *file_mode, int expected)
static int create_test_file(TCHAR *file_name, TCHAR *write_mode, TCHAR *read_mode, TCHAR *file_data)
Referenced by test_files().
◆ test_unlink_files()
static int test_unlink_files |
( |
void |
| ) |
|
|
static |
◆ verify_output_file()
Definition at line 159 of file _tfileio.c.
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;
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;
190 _tprintf(
_T(
"STATUS: Verifying %d bytes read from line %d\n"),
length, line_num);
205 error_flagged =
TRUE;
218 if (error_flagged ==
TRUE) {
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
GLenum GLuint GLenum GLsizei length
size_t __cdecl _tcslen(const _TCHAR *str)
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
static TCHAR test_buffer[TEST_BUFFER_SIZE]
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
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
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")
GLdouble GLdouble GLdouble r
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")
Definition at line 60 of file _tfileio.c.
Referenced by test_files().
◆ status_flagged
◆ test_buffer
◆ verbose_flagged