23#define WIN32_LEAN_AND_MEAN
31#define _tfopen _wfopen
32#define _tunlink _wunlink
34#define _gettchar getwchar
35#define _puttchar putwchar
36#define _THEX_FORMAT _T("0x%04x ")
39#define _tunlink _unlink
41#define _gettchar getchar
42#define _puttchar putchar
43#define _THEX_FORMAT "0x%02x "
47#define TEST_BUFFER_SIZE 200
48#define TEST_FILE_LINES 4
56 _T(
"line2: some more printable text and punctuation !@#$%^&*()\r\n")\
57 _T(
"line3: followed up with some numerals 1234567890\r\n")\
58 _T(
"line4: done.\r\n");
61 _T(
"line2: some more printable text and punctuation !@#$%^&*()\n")\
62 _T(
"line3: followed up with some numerals 1234567890\n")\
66#define TEST_B1_FILE_SIZE ((((sizeof(dos_data)/2)-1)+TEST_FILE_LINES)/2)
67#define TEST_B2_FILE_SIZE (((sizeof(dos_data)/2)-1)*2)
68#define TEST_B3_FILE_SIZE ((((sizeof(nix_data)/2)-1)+TEST_FILE_LINES)/2)
69#define TEST_B4_FILE_SIZE (((sizeof(nix_data)/2)-1)*2)
71#define TEST_B1_FILE_SIZE (sizeof(dos_data)-1+TEST_FILE_LINES)
72#define TEST_B2_FILE_SIZE (sizeof(dos_data)-1-TEST_FILE_LINES)
73#define TEST_B3_FILE_SIZE (sizeof(nix_data)-1+TEST_FILE_LINES)
74#define TEST_B4_FILE_SIZE (sizeof(nix_data)-1)
86 TCHAR* file_data =
_T(
"this file should have been truncated to zero bytes...");
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) {
305 for (
j = 0;
j <
i;
j++) {
318 _tprintf(
_T(
"Enter lines for dumping or <ctrl-z><nl> to finish:\n"));
383 printf(
"performing test: %d (%s)\n", test_num,
type);
387 printf(
"System unable to truncate files yet, unlinking:\n");
static int test_text_fileio(TCHAR *file_name, TCHAR *file_data, int tsize, int bsize)
static int test_console_io(void)
static BOOL verify_output_file(TCHAR *file_name, TCHAR *file_mode, TCHAR *file_data)
static BOOL test_file_truncate(TCHAR *file_name)
#define TEST_B2_FILE_SIZE
static BOOL create_output_file(TCHAR *file_name, TCHAR *file_mode, TCHAR *file_data)
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 TCHAR test_buffer[TEST_BUFFER_SIZE]
static int test_console_getchar(void)
static int create_test_file(TCHAR *file_name, TCHAR *write_mode, TCHAR *read_mode, TCHAR *file_data)
#define TEST_B4_FILE_SIZE
#define TEST_B3_FILE_SIZE
static int test_files(int test_num, char *type)
static int check_file_size(TCHAR *file_name, TCHAR *file_mode, int expected)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLuint GLsizei GLsizei * length
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
_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)
static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG ULONG ULONG ULONG ULONG read_mode
_CRTIMP int __cdecl _putch(_In_ int _Ch)