home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
MNO100.ZIP
/
MNOTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-05-15
|
156KB
|
6,820 lines
/*------------------------------------------------------------*/
/* MNOTEST.C ( OS/2 ) */
/* */
/* */
/* Test the MNOCALLS library functions. */
/* */
/* */
/*------------------------------------------------------------*/
#include <stdio.h> /* Library I/O routines. */
#include <stdlib.h> /* Library common routines. */
#include <string.h> /* Library string routines. */
#define INCL_BASE
#include <os2.h>
#include "SYMTYPES.H" /* Type definitions. */
#include "MNOCALLS.H" /* DLL function definitions.*/
#define SHORTSLEEP 1L
#define LONGSLEEP 5000L
PUCHAR pchMonoBuf ;
PUCHAR pchColorBuf ;
VOID CompareVideoBufs ( void ) ;
VOID CompareCharacterBufs ( void ) ;
VOID TestMnoSetCurPos ( void ) ;
VOID TestMnoWrtTTY ( void ) ;
VOID TestAnsiEsc ( void ) ;
VOID TestMnoWrtCharStr ( void ) ;
VOID TestMnoWrtCellStr ( void ) ;
VOID TestMnoReadCharStr ( void ) ;
VOID TestMnoReadCellStr ( void ) ;
VOID TestMnoWrtNAttr ( void ) ;
VOID TestMnoWrtNCell ( void ) ;
VOID TestMnoWrtNChar ( void ) ;
VOID TestMnoWrtCharStrAtt ( void ) ;
VOID TestMnoScrollDn ( void ) ;
VOID TestMnoScrollUp ( void ) ;
VOID TestMnoScrollLf ( void ) ;
VOID TestMnoScrollRt ( void ) ;
VOID TestMnoScrolling ( void ) ;
VOID MakeTestScreen ( void ) ;
VOID MonoVioExperiment ( void ) ;
VOID TestMnoGetCurType ( void ) ;
VOID TestMnoSetCurType ( void ) ;
VOID TestMnoGetPhysBuf ( void ) ;
VOID TestOK ( void ) ;
VOID TestMdaDrvr ( void ) ;
/*------------------------------------------------------------*/
/* Main function. */
/*------------------------------------------------------------*/
main ()
{
TestMdaDrvr () ;
TestMnoSetCurType () ;
TestMnoGetCurType () ;
TestMnoReadCellStr () ;
TestMnoReadCharStr () ;
TestMnoGetPhysBuf () ;
TestMnoSetCurPos () ;
TestMnoWrtTTY () ;
TestAnsiEsc () ;
TestMnoWrtCellStr () ;
TestMnoWrtCharStr () ;
TestMnoWrtCharStrAtt () ;
TestMnoWrtNAttr () ;
TestMnoWrtNCell () ;
TestMnoWrtNChar () ;
TestMnoScrollRt () ;
TestMnoScrollLf () ;
TestMnoScrollUp () ;
TestMnoScrollDn () ;
TestMnoScrolling () ;
TestOK () ;
#if 0
MonoVioExperiment () ;
#endif
exit ( 0 ) ;
/* Suppress warning message. */
return ( 0 ) ;
} /* End of main function. */
/*------------------------------------------------------------*/
/* Test Mda Drvr. */
/*------------------------------------------------------------*/
VOID TestMdaDrvr ()
{
USHORT usMnoStatus = 0 ;
VIOCURSORINFO vioCursorInfo ;
UCHAR szText [ 200 ] = "" ;
USHORT fAnsi = 0 ;
usMnoStatus = MnoGetCurType ( &vioCursorInfo, 0 ) ;
if ( usMnoStatus )
{
if ( usMnoStatus == ERROR_OPEN_FAILED )
fprintf (
stderr,
"\nMNOTEST has failed because the MNODRVR.SYS device\n"
"driver did not open properly. Status: %u.\n",
usMnoStatus ) ;
else
fprintf (
stderr,
"\nMNOTEST has failed on the first attempt to use\n"
"MNOCALLS.DLL. Status: %u.\n",
usMnoStatus ) ;
exit ( 1 ) ;
}
usMnoStatus = MnoGetAnsi ( &fAnsi, 0 ) ;
if ( usMnoStatus )
{
sprintf (
szText,
"\nMNOTEST cannot execute as a detached process.\r\n"
"MnoGetAnsi Status: %u.\r\n",
usMnoStatus ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
exit ( 1 ) ;
}
} /* End of TestMdaDrvr function. */
/*------------------------------------------------------------*/
/* Test OK. */
/*------------------------------------------------------------*/
VOID TestOK ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
UCHAR szText [ 200 ] ;
VIOCURSORINFO vioCursorInfo ;
vioCursorInfo.yStart = 12 ;
vioCursorInfo.cEnd = 13 ;
vioCursorInfo.cx = 1 ;
vioCursorInfo.attr = 0 ;
usVioStatus = VioSetCurType ( &vioCursorInfo, 0 ) ;
usMnoStatus = MnoSetCurType ( &vioCursorInfo, 0 ) ;
strcpy (
szText,
"\033[2J\033[0mTEST SUCCESSFUL." ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
} /* End of TestOK function. */
/*------------------------------------------------------------*/
/* Compare Character Bufs. */
/*------------------------------------------------------------*/
VOID CompareCharacterBufs ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
PUCHAR pchColor ;
PUCHAR pchMono ;
UCHAR bMonoBuffer [ 2000 ] ;
UCHAR bColorBuffer [ 2000 ] ;
USHORT usMonoBufLen = 2000 ;
USHORT usColorBufLen = 2000 ;
USHORT i ;
UCHAR szText [ 2000 ] ;
usVioStatus = VioReadCharStr (
bColorBuffer,
&usColorBufLen,
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoReadCharStr (
bMonoBuffer,
&usMonoBufLen,
usRow,
usColumn,
0 ) ;
pchColor = bColorBuffer ;
pchMono = bMonoBuffer ;
for ( i = 0 ; i < 2000 ; i++ )
if ( *pchColor++ != *pchMono++ )
{
sprintf (
szText,
"Screens have a character mismatch. "
"Row %d Column %d Vio %x Mno %x",
i / 80,
i % 80,
*( pchColor - 1 ),
*( pchMono - 1 )) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
usVioStatus = VioSetCurPos (
i / 80,
i % 80,
0 ) ;
usMnoStatus = MnoSetCurPos (
i / 80,
i % 80,
0 ) ;
DosSleep ( 4 * LONGSLEEP ) ;
exit ( 1 ) ;
}
} /* End of CompareCharacterBufs function. */
/*------------------------------------------------------------*/
/* Compare Video Bufs. */
/*------------------------------------------------------------*/
VOID CompareVideoBufs ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
PUCHAR pchColor ;
PUCHAR pchMono ;
UCHAR bMonoBuffer [ 4000 ] ;
UCHAR bColorBuffer [ 4000 ] ;
USHORT usMonoBufLen = 4000 ;
USHORT usColorBufLen = 4000 ;
USHORT i ;
UCHAR szText [ 2000 ] ;
usVioStatus = VioReadCellStr (
bColorBuffer,
&usColorBufLen,
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoReadCellStr (
bMonoBuffer,
&usMonoBufLen,
usRow,
usColumn,
0 ) ;
pchColor = bColorBuffer ;
pchMono = bMonoBuffer ;
for ( i = 0 ; i < 4000 ; i++ )
if ( *pchColor++ != *pchMono++ )
{
sprintf (
szText,
"Screens have a cell mismatch. "
"Row %d Column %d Vio %x Mno %x",
( i / 2 ) / 80,
( i / 2 ) % 80,
*( pchColor - 1 ),
*( pchMono - 1 )) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
usVioStatus = VioSetCurPos (
( i / 2 ) / 80,
( i / 2 ) % 80,
0 ) ;
usMnoStatus = MnoSetCurPos (
( i / 2 ) / 80,
( i / 2 ) % 80,
0 ) ;
DosSleep ( 4 * LONGSLEEP ) ;
exit ( 1 ) ;
}
} /* End of CompareVideoBufs function. */
/*------------------------------------------------------------*/
/* Test Mno Read Cell Str. */
/*------------------------------------------------------------*/
VOID TestMnoReadCellStr ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
USHORT cMnoText = 0 ;
USHORT cVioText = 0 ;
UCHAR szText [ 500 ] = "" ;
UCHAR szMnoText [ 500 ] = "" ;
UCHAR szVioText [ 500 ] = "" ;
PUCHAR pszMnoText = szMnoText ;
PUCHAR pszVioText = szVioText ;
strcpy ( szText, "Test of ReadCellStr Parm errors 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
1,
0 ) ;
cVioText = 30 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
100,
1,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 001 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ReadCellStr Parm errors 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
cVioText = 30 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
1,
100,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 002 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ReadCellStr Parm errors 003" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
cVioText = 30 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
1,
1,
10 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 003 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ReadCellStr 004" ) ;
for ( i = 1 ; i < 30 ; i++ )
{
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
i,
i + 30,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
i,
i + 30,
0 ) ;
}
cVioText = 30 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
1,
1,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
1,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 004 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 004 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCellStr 004 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
cVioText = 300 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
1,
1,
0 ) ;
cMnoText = 300 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
1,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 005 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 005 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCellStr 005 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
cVioText = 30 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
1,
70,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
1,
70,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 006 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 006 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCellStr 006 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
cVioText = 300 ;
usVioStatus = VioReadCellStr (
pszVioText,
&cVioText,
24,
60,
0 ) ;
cMnoText = 300 ;
usMnoStatus = MnoReadCellStr (
szMnoText,
&cMnoText,
24,
60,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCellStr 007 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCellStr 007 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCellStr 007 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoReadCellStr function. */
/*------------------------------------------------------------*/
/* Test Mno Read Char Str. */
/*------------------------------------------------------------*/
VOID TestMnoReadCharStr ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
USHORT cMnoText = 0 ;
USHORT cVioText = 0 ;
UCHAR szText [ 500 ] = "" ;
UCHAR szMnoText [ 500 ] = "" ;
UCHAR szVioText [ 500 ] = "" ;
PUCHAR pszMnoText = szMnoText ;
PUCHAR pszVioText = szVioText ;
strcpy ( szText, "Test of ReadCharStr Parm errors 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
1,
0 ) ;
cVioText = 30 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
100,
1,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 001 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ReadCharStr Parm errors 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
cVioText = 30 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
1,
100,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 002 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ReadCharStr Parm errors 003" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
2,
1,
0 ) ;
cVioText = 30 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
1,
1,
10 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 003 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ReadCharStr 004" ) ;
for ( i = 1 ; i < 30 ; i++ )
{
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
i,
i + 30,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
i,
i + 30,
0 ) ;
}
cVioText = 30 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
1,
1,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
1,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 004 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 004 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCharStr 004 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
cVioText = 300 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
1,
1,
0 ) ;
cMnoText = 300 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
1,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 005 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 005 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCharStr 005 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
cVioText = 30 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
1,
70,
0 ) ;
cMnoText = 30 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
1,
70,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 006 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 006 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCharStr 006 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
cVioText = 300 ;
usVioStatus = VioReadCharStr (
pszVioText,
&cVioText,
24,
60,
0 ) ;
cMnoText = 300 ;
usMnoStatus = MnoReadCharStr (
szMnoText,
&cMnoText,
24,
60,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ReadCharStr 007 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
if ( cVioText != cMnoText )
{
fprintf (
stderr,
"Test ReadCharStr 007 bad length, Vio=%d Mno=%d",
cVioText,
cMnoText ) ;
exit ( 1 ) ;
}
szMnoText [ cMnoText ] = '\0' ;
szVioText [ cVioText ] = '\0' ;
if ( strcmp(szMnoText, szVioText) != 0 )
{
fprintf (
stderr,
"Test ReadCharStr 007 not matched, \nVio=%s \nMno=%s",
szVioText,
szMnoText ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoReadCharStr function. */
/*------------------------------------------------------------*/
/* Test Mno Get Phys Buf. */
/*------------------------------------------------------------*/
VOID TestMnoGetPhysBuf ()
{
USHORT usVioStatus = 0 ;
USHORT usMnoStatus = 0 ;
VIOPHYSBUF vioPhysBuffer ;
UCHAR szText [ 200 ] = "" ;
PBYTE pColorBuf = NULL ;
PBYTE pMonoBuf = NULL ;
vioPhysBuffer.cb = 4000 ;
usVioStatus = VioGetPhysBuf ( &vioPhysBuffer, 0 ) ;
/*---------------------------------------------*/
/* When debugging under CodeView, VioGetPhysBuf*/
/* will fail because the call is made from a */
/* background process. */
/*---------------------------------------------*/
if ( usVioStatus != 0 )
return ;
pColorBuf = MAKEP ( vioPhysBuffer.asel [ 0 ], 0 ) ;
*pColorBuf++ = 'T' ;
*pColorBuf++ = 0x70 ;
*pColorBuf++ = 'e' ;
*pColorBuf++ = 0x70 ;
*pColorBuf++ = 's' ;
*pColorBuf++ = 0x70 ;
*pColorBuf++ = 't' ;
*pColorBuf++ = 0x70 ;
*pColorBuf++ = '.' ;
*pColorBuf++ = 0x70 ;
usMnoStatus = MnoGetPhysBuf ( &vioPhysBuffer, 0 ) ;
pMonoBuf = MAKEP ( vioPhysBuffer.asel [ 0 ], 0 ) ;
*pMonoBuf++ = 'T' ;
*pMonoBuf++ = 0x70 ;
*pMonoBuf++ = 'e' ;
*pMonoBuf++ = 0x70 ;
*pMonoBuf++ = 's' ;
*pMonoBuf++ = 0x70 ;
*pMonoBuf++ = 't' ;
*pMonoBuf++ = 0x70 ;
*pMonoBuf++ = '.' ;
*pMonoBuf++ = 0x70 ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoGetPhysBuf function. */
/*------------------------------------------------------------*/
/* Test Mno Get Cur Type. */
/*------------------------------------------------------------*/
VOID TestMnoGetCurType ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
VIOCURSORINFO vioCursorInfo ;
UCHAR szText [ 200 ] = "" ;
usVioStatus = VioGetCurType ( &vioCursorInfo, 10 ) ;
usMnoStatus = MnoGetCurType ( &vioCursorInfo, 10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"001 TestMnoGetCurType bad return, Vio=%d Mno=%d\n",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioGetCurType ( &vioCursorInfo, 0 ) ;
sprintf (
szText,
"Cursor Start=%d End=%d Width=%d attr=%x\r\n",
vioCursorInfo.yStart,
vioCursorInfo.cEnd,
vioCursorInfo.cx,
vioCursorInfo.attr ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoGetCurType ( &vioCursorInfo, 0 ) ;
sprintf (
szText,
"Cursor Start=%d End=%d Width=%d attr=%x\r\n",
vioCursorInfo.yStart,
vioCursorInfo.cEnd,
vioCursorInfo.cx,
vioCursorInfo.attr ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
} /* End of TestMnoGetCurType function. */
/*------------------------------------------------------------*/
/* Test Mno Set Cur Type. */
/*------------------------------------------------------------*/
VOID TestMnoSetCurType ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
VIOCURSORINFO vioCursorInfo ;
UCHAR szText [ 200 ] = "" ;
usVioStatus = VioSetCurType ( &vioCursorInfo, 10 ) ;
usMnoStatus = MnoSetCurType ( &vioCursorInfo, 10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"001 TestMnoSetCurType bad return, Vio=%d Mno=%d\n",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioGetCurType ( &vioCursorInfo, 0 ) ;
sprintf (
szText,
"Start=%d End=%d Width=%d attr=%x\r\n",
vioCursorInfo.yStart,
vioCursorInfo.cEnd,
vioCursorInfo.cx,
vioCursorInfo.attr ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoGetCurType ( &vioCursorInfo, 0 ) ;
sprintf (
szText,
"Start=%d End=%d Width=%d attr=%x\r\n",
vioCursorInfo.yStart,
vioCursorInfo.cEnd,
vioCursorInfo.cx,
vioCursorInfo.attr ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
/*---------------------------------------------*/
/* Clear the screen to avoid incorrect */
/* initialization of cursor size by VIO. */
/*---------------------------------------------*/
strcpy ( szText, "\033[2J" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
vioCursorInfo.yStart = 0 ;
usVioStatus = VioSetCurType ( &vioCursorInfo, 0 ) ;
usMnoStatus = MnoSetCurType ( &vioCursorInfo, 0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"002 TestMnoSetCurType bad return, Vio=%d Mno=%d\n",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
vioCursorInfo.cEnd = 7 ;
usVioStatus = VioSetCurType ( &vioCursorInfo, 0 ) ;
usMnoStatus = MnoSetCurType ( &vioCursorInfo, 0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"003 TestMnoSetCurType bad return, Vio=%d Mno=%d\n",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
vioCursorInfo.attr = 0xFFFF ;
usVioStatus = VioSetCurType ( &vioCursorInfo, 0 ) ;
usMnoStatus = MnoSetCurType ( &vioCursorInfo, 0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"004 TestMnoSetCurType bad return, Vio=%d Mno=%d\n",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
vioCursorInfo.attr = 0 ;
usVioStatus = VioSetCurType ( &vioCursorInfo, 0 ) ;
usMnoStatus = MnoSetCurType ( &vioCursorInfo, 0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"005 TestMnoSetCurType bad return, Vio=%d Mno=%d\n",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioGetCurType ( &vioCursorInfo, 0 ) ;
sprintf (
szText,
"Start=%d End=%d Width=%d attr=%x\r\n",
vioCursorInfo.yStart,
vioCursorInfo.cEnd,
vioCursorInfo.cx,
vioCursorInfo.attr ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoGetCurType ( &vioCursorInfo, 0 ) ;
sprintf (
szText,
"Start=%d End=%d Width=%d attr=%x\r\n",
vioCursorInfo.yStart,
vioCursorInfo.cEnd,
vioCursorInfo.cx,
vioCursorInfo.attr ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoSetCurType function. */
/*------------------------------------------------------------*/
/* Mono Vio Experiment. */
/*------------------------------------------------------------*/
VOID MonoVioExperiment ()
{
USHORT usVioStatus = 0 ;
VIOCURSORINFO viociCursor ;
usVioStatus = VioGetCurType ( &viociCursor, 0 ) ;
printf ( "usVioStatus=%d\n", usVioStatus ) ;
printf ( "attr=%d\n", viociCursor.attr ) ;
printf ( "Start=%d\n", viociCursor.yStart ) ;
printf ( "End=%d\n", viociCursor.cEnd ) ;
printf ( "Width=%d\n", viociCursor.cx ) ;
viociCursor.attr =
( viociCursor.attr == -1 ) ? 0 : -1 ;
usVioStatus = VioSetCurType ( &viociCursor, 0 ) ;
printf ( "attr=%d\n", viociCursor.attr ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioGetCurType ( &viociCursor, 0 ) ;
printf ( "usVioStatus=%d\n", usVioStatus ) ;
printf ( "attr=%d\n", viociCursor.attr ) ;
viociCursor.yStart = 5 ;
viociCursor.attr =
( viociCursor.attr == -1 ) ? 0 : -1 ;
usVioStatus = VioSetCurType ( &viociCursor, 0 ) ;
printf ( "attr=%d\n", viociCursor.attr ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of MonoVioExperiment function. */
/*------------------------------------------------------------*/
/* Make Test Screen. */
/*------------------------------------------------------------*/
VOID MakeTestScreen ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
BYTE bCell [ 10 ] =
{ '0', 0x0F,
'1', 0x07,
'2', 0x07,
'3', 0x07,
'4', 0x07 } ;
/*---------------------------------------------*/
/* */
/* Monochrome Adapter Attribute Byte. */
/* */
/* */
/* 0... .... No blinking */
/* 1... .... Blinking */
/* .... 0... Normal foreground intensity. */
/* .... 1... Bright foreground intensity. */
/* .... .001 Underlining */
/* .000 .... Black background. */
/* .111 .... White background. */
/* .... .000 Black foreground. */
/* .... .111 White foreground. */
/* */
/* 0111 0000 \160 0x70 Reverse video. */
/* 1111 0000 \360 0x70 Blinking reverse. */
/* 1000 0111 \207 0x80 Blinking. */
/* 0000 1111 \017 0x0F Bold. */
/* 0000 0111 \007 0x07 Normal. */
/* 0000 0001 \001 0x01 Underline. */
/* */
/*---------------------------------------------*/
for ( usRow = 0 ; usRow < 25 ; usRow++ )
usVioStatus = VioWrtNCell (
( PBYTE ) ( bCell + ( 2 * ( usRow % 5 ))),
80,
usRow,
0,
0 ) ;
for ( usRow = 0 ; usRow < 25 ; usRow++ )
usVioStatus = MnoWrtNCell (
( PBYTE ) ( bCell + ( 2 * ( usRow % 5 ))),
80,
usRow,
0,
0 ) ;
} /* End of MakeTestScreen function. */
/*------------------------------------------------------------*/
/* Test Mno Scrolling. */
/*------------------------------------------------------------*/
VOID TestMnoScrolling ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE chChar = ' ' ;
PBYTE pchChar = &chChar ;
BYTE bCell [ 2 ] = { 0 } ;
BYTE bAttr = 0x00 ;
bAttr = 0x70 ;
bCell [ 0 ] = '.' ;
bCell [ 1 ] = 0x0F ;
MakeTestScreen () ;
for ( i = 0 ; i < 200 ; i++ )
{
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,5) */
/* */
/* Down 1 row. */
/*---------------------------------------------*/
usVioStatus = VioScrollDn (
0,
0,
24,
5,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
0,
0,
24,
5,
1,
bCell,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (19,0)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Right 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollRt (
19,
0,
24,
79,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
19,
0,
24,
79,
1,
bCell,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,74)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Up 1 row. */
/*---------------------------------------------*/
usVioStatus = VioScrollUp (
0,
74,
24,
79,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
0,
74,
24,
79,
1,
bCell,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(5,79) */
/* */
/* Left 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollLf (
0,
0,
5,
79,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
0,
0,
5,
79,
1,
bCell,
0 ) ;
DosSleep ( SHORTSLEEP ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Right 80 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = ' ' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioScrollRt (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoScrolling function. */
/*------------------------------------------------------------*/
/* Test Mno Scroll Rt. */
/*------------------------------------------------------------*/
VOID TestMnoScrollRt ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE chChar = ' ' ;
PBYTE pchChar = &chChar ;
BYTE bCell [ 2 ] = { 0 } ;
BYTE bAttr = 0x00 ;
bAttr = 0x70 ;
bCell [ 0 ] = '.' ;
bCell [ 1 ] = 0x0F ;
MakeTestScreen () ;
usVioStatus = VioScrollRt (
75,
80,
0,
81,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
75,
80,
0,
81,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollRt 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollRt (
0,
65,
0,
61,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
0,
65,
0,
61,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollRt 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollRt (
0,
0,
24,
79,
10,
bCell,
10 ) ;
usMnoStatus = MnoScrollRt (
0,
0,
24,
79,
10,
bCell,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollRt 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ScrollRt 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usVioStatus = VioWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the character at (0,0): */
/* */
/* Right 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollRt (
0,
0,
0,
0,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
0,
0,
0,
0,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (1,1)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(2,2) */
/* */
/* Right 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollRt (
1,
1,
2,
2,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
1,
1,
2,
2,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollRt 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (2,2)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(6,79) */
/* */
/* Right 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollRt (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollRt 003" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,10)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,79) */
/* */
/* Right 2 columns. */
/*---------------------------------------------*/
usVioStatus = VioScrollRt (
15,
10,
20,
79,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
15,
10,
20,
79,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollRt 004" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(15,30) */
/* */
/* Right 6 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = '/' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollRt (
15,
0,
15,
30,
6,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
15,
0,
15,
30,
6,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollRt 005" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (6,70)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Right 5 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = '-' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollRt (
6,
70,
24,
79,
18,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
6,
70,
24,
79,
18,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollRt 006" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (8,60)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,75) */
/* */
/* Right 9 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = '#' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollRt (
8,
60,
20,
75,
9,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
8,
60,
20,
75,
9,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Right 80 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = ' ' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioScrollRt (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
usMnoStatus = MnoScrollRt (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoScrollRt function. */
/*------------------------------------------------------------*/
/* Test Mno Scroll Lf. */
/*------------------------------------------------------------*/
VOID TestMnoScrollLf ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE chChar = ' ' ;
PBYTE pchChar = &chChar ;
BYTE bCell [ 2 ] = { 0 } ;
BYTE bAttr = 0x00 ;
bAttr = 0x70 ;
bCell [ 0 ] = '.' ;
bCell [ 1 ] = 0x0F ;
MakeTestScreen () ;
usVioStatus = VioScrollLf (
75,
80,
0,
81,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
75,
80,
0,
81,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollLf 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollLf (
0,
65,
0,
61,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
0,
65,
0,
61,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollLf 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollLf (
0,
0,
24,
79,
10,
bCell,
10 ) ;
usMnoStatus = MnoScrollLf (
0,
0,
24,
79,
10,
bCell,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollLf 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ScrollLf 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usVioStatus = VioWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the character at (0,0): */
/* */
/* Left 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollLf (
0,
0,
0,
0,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
0,
0,
0,
0,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (1,1)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(2,2) */
/* */
/* Left 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollLf (
1,
1,
2,
2,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
1,
1,
2,
2,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollLf 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (2,2)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(6,79) */
/* */
/* Left 1 column. */
/*---------------------------------------------*/
usVioStatus = VioScrollLf (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollLf 003" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,10)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,79) */
/* */
/* Left 2 columns. */
/*---------------------------------------------*/
usVioStatus = VioScrollLf (
15,
10,
20,
79,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
15,
10,
20,
79,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollLf 004" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(15,30) */
/* */
/* Left 6 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = '/' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollLf (
15,
0,
15,
30,
6,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
15,
0,
15,
30,
6,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollLf 005" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (6,70)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Left 5 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = '-' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollLf (
6,
70,
24,
79,
18,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
6,
70,
24,
79,
18,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollLf 006" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (8,60)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,75) */
/* */
/* Left 9 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = '#' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollLf (
8,
60,
20,
75,
9,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
8,
60,
20,
75,
9,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Left 80 columns. */
/*---------------------------------------------*/
bCell [ 0 ] = ' ' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioScrollLf (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
usMnoStatus = MnoScrollLf (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoScrollLf function. */
/*------------------------------------------------------------*/
/* Test Mno Scroll Up. */
/*------------------------------------------------------------*/
VOID TestMnoScrollUp ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE chChar = ' ' ;
PBYTE pchChar = &chChar ;
BYTE bCell [ 2 ] = { 0 } ;
BYTE bAttr = 0x00 ;
bAttr = 0x70 ;
bCell [ 0 ] = '.' ;
bCell [ 1 ] = 0x0F ;
MakeTestScreen () ;
usVioStatus = VioScrollUp (
75,
80,
0,
81,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
75,
80,
0,
81,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollUp 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollUp (
0,
65,
0,
61,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
0,
65,
0,
61,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollUp 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollUp (
0,
0,
24,
79,
10,
bCell,
10 ) ;
usMnoStatus = MnoScrollUp (
0,
0,
24,
79,
10,
bCell,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollUp 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ScrollUp 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usVioStatus = VioWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the character at (0,0): */
/* */
/* up 1 line. */
/*---------------------------------------------*/
usVioStatus = VioScrollUp (
0,
0,
0,
0,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
0,
0,
0,
0,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (1,1)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(2,2) */
/* */
/* Up 1 line. */
/*---------------------------------------------*/
usVioStatus = VioScrollUp (
1,
1,
2,
2,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
1,
1,
2,
2,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollUp 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (2,2)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(6,79) */
/* */
/* Up 1 line. */
/*---------------------------------------------*/
usVioStatus = VioScrollUp (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollUp 003" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,10)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,79) */
/* */
/* Up 2 lines. */
/*---------------------------------------------*/
usVioStatus = VioScrollUp (
15,
10,
20,
79,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
15,
10,
20,
79,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollUp 004" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,0) */
/* */
/* Up 6 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = '/' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollUp (
15,
0,
20,
0,
6,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
15,
0,
20,
0,
6,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollUp 005" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (6,70)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Up 18 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = '-' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollUp (
6,
70,
24,
79,
18,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
6,
70,
24,
79,
18,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollUp 006" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (8,60)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,75) */
/* */
/* Up 9 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = '#' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollUp (
8,
60,
20,
75,
9,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
8,
60,
20,
75,
9,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Up 25 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = ' ' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioScrollUp (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
usMnoStatus = MnoScrollUp (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoScrollUp function. */
/*------------------------------------------------------------*/
/* Test Mno Scroll Dn. */
/*------------------------------------------------------------*/
VOID TestMnoScrollDn ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE chChar = ' ' ;
PBYTE pchChar = &chChar ;
BYTE bCell [ 2 ] = { 0 } ;
BYTE bAttr = 0x00 ;
bAttr = 0x70 ;
bCell [ 0 ] = '.' ;
bCell [ 1 ] = 0x0F ;
MakeTestScreen () ;
usVioStatus = VioScrollDn (
75,
80,
0,
81,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
75,
80,
0,
81,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollDn 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollDn (
0,
65,
0,
61,
0,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
0,
65,
0,
61,
0,
bCell,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollDn 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioScrollDn (
0,
0,
24,
79,
10,
bCell,
10 ) ;
usMnoStatus = MnoScrollDn (
0,
0,
24,
79,
10,
bCell,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test ScrollDn 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of ScrollDn 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usVioStatus = VioWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the character at (0,0): */
/* */
/* Down 1 line. */
/*---------------------------------------------*/
usVioStatus = VioScrollDn (
0,
0,
0,
0,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
0,
0,
0,
0,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (1,1)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(2,2) */
/* */
/* Down 1 line. */
/*---------------------------------------------*/
usVioStatus = VioScrollDn (
1,
1,
2,
2,
1,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
1,
1,
2,
2,
1,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollDn 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (2,2)-----------+ */
/* | | */
/* | | */
/* | | */
/* +-----------(6,79) */
/* */
/* Down 1 line. */
/*---------------------------------------------*/
usVioStatus = VioScrollDn (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
2,
2,
6,
0xFFFF,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollDn 003" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,10)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,79) */
/* */
/* Down 2 lines. */
/*---------------------------------------------*/
usVioStatus = VioScrollDn (
15,
10,
20,
79,
2,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
15,
10,
20,
79,
2,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollDn 004" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (15,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,0) */
/* */
/* Down 6 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = '/' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollDn (
15,
0,
20,
0,
6,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
15,
0,
20,
0,
6,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollDn 005" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (6,70)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Down 18 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = '-' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollDn (
6,
70,
24,
79,
18,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
6,
70,
24,
79,
18,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of ScrollDn 006" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
10,
0 ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (8,60)----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(20,75) */
/* */
/* Down 9 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = '#' ;
bCell [ 1 ] = 0x0F ;
usVioStatus = VioScrollDn (
8,
60,
20,
75,
9,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
8,
60,
20,
75,
9,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
/*---------------------------------------------*/
/* Scroll the box at (row,col): */
/* */
/* (0,0)-----------+ */
/* | | */
/* | | */
/* | | */
/* +----------(24,79) */
/* */
/* Down 25 lines. */
/*---------------------------------------------*/
bCell [ 0 ] = ' ' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioScrollDn (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
usMnoStatus = MnoScrollDn (
0,
0,
0xFFFF,
0xFFFF,
0xFFFF,
bCell,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoScrollDn function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt N Char. */
/*------------------------------------------------------------*/
VOID TestMnoWrtNChar ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE chChar = ' ' ;
PBYTE pchChar = &chChar ;
chChar = 'E' ;
usVioStatus = VioWrtNChar (
pchChar,
1,
100,
1,
0 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
1,
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNChar 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtNChar (
pchChar,
1,
1,
100,
0 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
1,
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNChar 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtNChar (
pchChar,
1,
1,
1,
10 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
1,
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNChar 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of WrtNChar 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
0,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
0,
0 ) ;
chChar = 'F' ;
usVioStatus = VioWrtNChar (
pchChar,
0,
0,
0,
0 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
0,
0,
0,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of WrtNChar 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
chChar = 'G' ;
usVioStatus = VioWrtNChar (
pchChar,
2000,
0,
0,
0 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
2000,
0,
0,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
chChar = 'H' ;
for ( i = 0 ; i < 25 ; i++ )
{
usVioStatus = VioWrtNChar (
pchChar,
25,
i,
i+10,
0 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
25,
i,
i+10,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
chChar = 'I' ;
for ( i = 0 ; i < 25 ; i++ )
{
usVioStatus = VioWrtNChar (
pchChar,
30,
i,
65,
0 ) ;
usMnoStatus = MnoWrtNChar (
pchChar,
30,
i,
65,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoWrtNChar function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt N Cell. */
/*------------------------------------------------------------*/
VOID TestMnoWrtNCell ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
BYTE bCell [ 2 ] = { 0 } ;
bCell [ 0 ] = 'A' ;
bCell [ 1 ] = 0x07 ;
usVioStatus = VioWrtNCell (
bCell,
1,
100,
1,
0 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
1,
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNCell 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtNCell (
bCell,
1,
1,
100,
0 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
1,
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNCell 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtNCell (
bCell,
1,
1,
1,
10 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
1,
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNCell 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of WrtNCell 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
0,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
0,
0 ) ;
bCell [ 0 ] = 'X' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioWrtNCell (
bCell,
0,
0,
0,
0 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
0,
0,
0,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of WrtNCell 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
bCell [ 0 ] = 'B' ;
bCell [ 1 ] = 0x70 ;
usVioStatus = VioWrtNCell (
bCell,
2000,
0,
0,
0 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
2000,
0,
0,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
bCell [ 0 ] = 'C' ;
bCell [ 1 ] = 0x0F ;
for ( i = 0 ; i < 25 ; i++ )
{
usVioStatus = VioWrtNCell (
bCell,
30,
i,
i,
0 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
30,
i,
i,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
bCell [ 0 ] = 'D' ;
bCell [ 1 ] = 0x01 ;
for ( i = 0 ; i < 25 ; i++ )
{
usVioStatus = VioWrtNCell (
bCell,
30,
i,
65,
0 ) ;
usMnoStatus = MnoWrtNCell (
bCell,
30,
i,
65,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoWrtNCell function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt N Attr. */
/*------------------------------------------------------------*/
VOID TestMnoWrtNAttr ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
BYTE bAttr = 0x00 ;
UCHAR szText [ 5000 ] = "" ;
bAttr = 0x07 ;
usVioStatus = VioWrtNAttr (
&bAttr,
1,
100,
1,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
1,
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNAttr 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtNAttr (
&bAttr,
1,
1,
100,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
1,
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNAttr 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtNAttr (
&bAttr,
1,
1,
1,
10 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
1,
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtNAttr 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of WrtNAttr 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
0,
0,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
0,
0,
0 ) ;
bAttr = 0x70 ;
usVioStatus = VioWrtNAttr (
&bAttr,
0,
0,
0,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
0,
0,
0,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "Test of WrtNAttr 002" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
0,
0 ) ;
bAttr = 0x70 ;
usVioStatus = VioWrtNAttr (
&bAttr,
2000,
0,
0,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
2000,
0,
0,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
bAttr = 0x0F ;
for ( i = 0 ; i < 25 ; i++ )
{
usVioStatus = VioWrtNAttr (
&bAttr,
30,
i,
i,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
30,
i,
i,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
bAttr = 0x01 ;
for ( i = 0 ; i < 25 ; i++ )
{
usVioStatus = VioWrtNAttr (
&bAttr,
30,
i,
65,
0 ) ;
usMnoStatus = MnoWrtNAttr (
&bAttr,
30,
i,
65,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoWrtNAttr function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt Cell Str. */
/*------------------------------------------------------------*/
VOID TestMnoWrtCellStr ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
/*---------------------------------------------*/
/* */
/* Monochrome Adapter Attribute Byte. */
/* */
/* */
/* 0... .... No blinking */
/* 1... .... Blinking */
/* .... 0... Normal foreground intensity. */
/* .... 1... Bright foreground intensity. */
/* .... .001 Underlining */
/* .000 .... Black background. */
/* .111 .... White background. */
/* .... .000 Black foreground. */
/* .... .111 White foreground. */
/* */
/* 0111 0000 \160 Reverse video. */
/* 1111 0000 \360 Blinking reverse video. */
/* 1000 0111 \207 Blinking. */
/* 0000 1111 \017 Bold. */
/* 0000 0111 \007 Normal */
/* */
/*---------------------------------------------*/
strcpy (
szText,
"T\07e\07s\07t\07 \07o\07f\07 \07"
"W\07r\07t\07C\07e\07l\07l\07S\07"
"t\07r\07 \07P\07a\07r\07m\07 \07"
"e\07r\07r\07o\07r\07s\07" ) ;
usVioStatus = VioWrtCellStr (
szText,
strlen ( szText ),
100,
1,
0 ) ;
usMnoStatus = MnoWrtCellStr (
szText,
strlen ( szText ),
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCellStr 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtCellStr (
szText,
strlen ( szText ),
1,
100,
0 ) ;
usMnoStatus = MnoWrtCellStr (
szText,
strlen ( szText ),
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCellStr 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtCellStr (
szText,
strlen ( szText ),
1,
1,
10 ) ;
usMnoStatus = MnoWrtCellStr (
szText,
strlen ( szText ),
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCellStr 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy (
szText,
"T\160e\160s\160t\160 \160o\160f\160 \160"
"W\017r\017t\017C\017e\017l\017l\017S\017t\017r\007" ) ;
for ( i = 1 ; i < 30 ; i++ )
{
usVioStatus = VioWrtCellStr (
szText,
strlen ( szText ),
i,
i + 25,
0 ) ;
usMnoStatus = MnoWrtCellStr (
szText,
strlen ( szText ),
i,
i + 25,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoWrtCellStr function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt Char Str. */
/*------------------------------------------------------------*/
VOID TestMnoWrtCharStr ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
strcpy ( szText, "Test of WrtCharStr Parm errors 001" ) ;
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
100,
1,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
100,
1,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCharStr 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
100,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
100,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCharStr 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
1,
1,
10 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
1,
1,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCharStr 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of WrtCharStr 004" ) ;
for ( i = 1 ; i < 30 ; i++ )
{
usVioStatus = VioWrtCharStr (
szText,
strlen ( szText ),
i,
i,
0 ) ;
usMnoStatus = MnoWrtCharStr (
szText,
strlen ( szText ),
i,
i,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoWrtCharStr function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt Char Str Att. */
/*------------------------------------------------------------*/
VOID TestMnoWrtCharStrAtt ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
BYTE bAttr = 0x07 ;
UCHAR szText [ 5000 ] = "" ;
strcpy ( szText, "Test of WrtCharStrAtt Parm errors 001" ) ;
usVioStatus = VioWrtCharStrAtt (
szText,
strlen ( szText ),
100,
1,
&bAttr,
0 ) ;
usMnoStatus = MnoWrtCharStrAtt (
szText,
strlen ( szText ),
100,
1,
&bAttr,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCharStrAtt 001 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtCharStrAtt (
szText,
strlen ( szText ),
1,
100,
&bAttr,
0 ) ;
usMnoStatus = MnoWrtCharStrAtt (
szText,
strlen ( szText ),
1,
100,
&bAttr,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCharStrAtt 002 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioWrtCharStrAtt (
szText,
strlen ( szText ),
1,
1,
&bAttr,
10 ) ;
usMnoStatus = MnoWrtCharStrAtt (
szText,
strlen ( szText ),
1,
1,
&bAttr,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"Test WrtCharStrAtt 003 bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
strcpy ( szText, "Test of WrtCharStrAtt 004" ) ;
for ( i = 1 ; i < 30 ; i++ )
{
switch ( i % 5 )
{
case 0 :
bAttr = 0x07 ;
break ;
case 1 :
bAttr = 0x0F ;
break ;
case 2 :
bAttr = 0x70 ;
break ;
case 3 :
bAttr = 0x01 ;
break ;
case 4 :
bAttr = 0x87 ;
break ;
}
usVioStatus = VioWrtCharStrAtt (
szText,
strlen ( szText ),
i,
i,
&bAttr,
0 ) ;
usMnoStatus = MnoWrtCharStrAtt (
szText,
strlen ( szText ),
i,
i,
&bAttr,
0 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( LONGSLEEP ) ;
} /* End of TestMnoWrtCharStrAtt function. */
/*------------------------------------------------------------*/
/* Test Ansi Esc. */
/*------------------------------------------------------------*/
VOID TestAnsiEsc ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
USHORT i = 0 ;
UCHAR szText [ 5000 ] = "" ;
strcpy (szText,"\033[2J");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2JAnsi Test 001");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2;2fAnsi Test 002");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[0003;0003fAnsi Test 003");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[24;74HAnsi Test 004");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[HAnsi Test 005");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[25;74HAnsi Test 006");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[;HAnsi Test 007");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[5;HAnsi Test 008");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
#if 0
strcpy (szText,"\033[;24HVIO fails Ansi Test 009");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
#endif
strcpy (szText,"\033[2J\033[10;24HAnsi Test 010");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[AAnsi Test 011");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[1AAnsi Test 012");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2AAnsi Test 013");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[3AAnsi Test 014");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[4AAnsi Test 015");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2J\033[10;24HAnsi Test 016");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[BAnsi Test 017");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[1BAnsi Test 018");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2BAnsi Test 019");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[3BAnsi Test 020");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[4BAnsi Test 021");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[5BAnsi Test 022");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2J\033[10;24HAnsi Test 023");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[CAnsi Test 024");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[1CAnsi Test 025");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2CAnsi Test 026");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[3CAnsi Test 027");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[4CAnsi Test 028");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[5CAnsi Test 029");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2J\033[10;24HAnsi Test 030");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[DAnsi Test 031");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[1DAnsi Test 032");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2DAnsi Test 034");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[3DAnsi Test 035");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[4DAnsi Test 036");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[5DAnsi Test 037");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[99DAnsi Test 038");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[10DAnsi Test 039");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2J\033[s\033[10;10HAnsi Test 040");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[5;50HAnsi Test 041");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[uAnsi Test 042");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[5;50HAnsi Test 043");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[uAnsi Test 044");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2J\033[s\033[10;1HAnsi Test 045 abcdefghijklmnopqrs");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[10;3f");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy ( szText, "\033[2J\033[B" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
for ( i = 0 ; i < 500 ; i++ )
{
strcpy ( szText, "ABCD" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
}
strcpy (szText,"\033[1;79f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[2;1f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[10;10f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[11;80f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[24;25f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[1;79f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (szText,"\033[19;2f\033[K");
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"\033[2J\033[B\r\n" ) ;
strcat (
szText,
"\033[0mAll attributes off ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;1mBold on ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;2mFaint on ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;3mItalic on ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;5mBlink on ABCDEFGH \033[1mBold on " ) ;
strcat (
szText,
"\033[7mRevrse Video on " ) ;
strcat (
szText,
"\033[6mRapid-Blink on \033[2mFaint on \r\n" ) ;
strcat (
szText,
"\033[0;6mRapid-Blink on ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;7mRevrse Video on ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;8mConcealed on ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[30mBlack Foreground ABCDEFGH" ) ;
strcat (
szText,
"\033[31mRed Foreground ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[32mGreen Foreground ABCDEFGH" ) ;
strcat (
szText,
"\033[33mYellow Foreground ABCDEF\r\n" ) ;
strcat (
szText,
"\033[34mBlue Foreground ABCDEFGH" ) ;
strcat (
szText,
"\033[35mMagenta Foreground ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[36mCyan Foreground ABCDEFGH" ) ;
strcat (
szText,
"\033[37mWhite Foreground ABCDEF\r\n" ) ;
strcat (
szText,
"\033[40mBlack Background ABCDEFGH" ) ;
strcat (
szText,
"\033[41mRed Background ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[42mGreen Background ABCDEFGH" ) ;
strcat (
szText,
"\033[43mYellow Background ABCDEF\r\n" ) ;
strcat (
szText,
"\033[44mBlue Background ABCDEFGH" ) ;
strcat (
szText,
"\033[45mMagenta Background ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[46mCyan Background ABCDEFGH" ) ;
strcat (
szText,
"\033[47mWhite Background ABCDEF\r\n" ) ;
strcat (
szText,
"\033[48mSubscript ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[49mSuperscript ABCDEFGH\r\n" ) ;
strcat (
szText,
"\033[0;1mBold onXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n" ) ;
strcat (
szText,
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n" ) ;
strcat (
szText,
"\033[A\033[0;2m Some faint text\r\n" ) ;
strcat (
szText,
"\033[34mUnderline \033[0;7mRevrse Video on \r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( LONGSLEEP ) ;
strcpy (
szText,
"\033[2J\033[0m\033[B\r\n" ) ;
strcat (
szText,
"\033[=7hTest line wrap ON BbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"AaBbCcDdEeFfGgI Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIiAaBbCcDdEeF Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"\033[=7lTest line wrap OFF bCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"AaBbCcDdEeFfGgI Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIiAaBbCcDdEeF Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
strcpy (
szText,
"\033[=7hTest line wrap ON BbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi"
"AaBbCcDdEeFfGgIiAaBbCcDdEeFfGgIi Last\r\n" ) ;
usVioStatus = VioWrtTTY ( szText, strlen ( szText ), 0 ) ;
usMnoStatus = MnoWrtTTY ( szText, strlen ( szText ), 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestAnsiEsc function. */
/*------------------------------------------------------------*/
/* Test Mno Wrt TTY. */
/*------------------------------------------------------------*/
VOID TestMnoWrtTTY ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow = 0 ;
USHORT usColumn = 0 ;
usVioStatus = VioWrtTTY ( "001 Test of VioWrtTTY", 21, 10 ) ;
usMnoStatus = MnoWrtTTY ( "001 Test of VioWrtTTY", 21, 10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"001 TestMnoWrtTTY bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usRow = 10 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY ( "002 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "002 Test of VioWrtTTY", 21, 0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"002 TestMnoWrtTTY bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 12 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY ( "003 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "003 Test of VioWrtTTY", 21, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 24 ;
usColumn = 59 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY ( "004 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "004 Test of VioWrtTTY", 21, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY ( "005 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "005 Test of VioWrtTTY", 21, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 24 ;
usColumn = 50 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY ( "006 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "006 Test of VioWrtTTY", 21, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY ( "007 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "007 Test of VioWrtTTY", 21, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 0 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY (
"0 1 2 3 ",
40,
0 ) ;
usVioStatus = VioWrtTTY (
"4 5 6 7 ",
40,
0 ) ;
usVioStatus = VioWrtTTY (
"0123.5678.0123.5678.0123.5678.0123.5678.",
40,
0 ) ;
usVioStatus = VioWrtTTY (
"0123.5678.0123.5678.0123.5678.0123.5678.",
40,
0 ) ;
usMnoStatus = MnoWrtTTY (
"0 1 2 3 ",
40,
0 ) ;
usMnoStatus = MnoWrtTTY (
"4 5 6 7 ",
40,
0 ) ;
usMnoStatus = MnoWrtTTY (
"0123.5678.0123.5678.0123.5678.0123.5678.",
40,
0 ) ;
usMnoStatus = MnoWrtTTY (
"0123.5678.0123.5678.0123.5678.0123.5678.",
40,
0 ) ;
usRow = 3 ;
usColumn = 0 ;
usVioStatus = VioWrtTTY ( "008 Test Backspace", 18, 0 ) ;
usMnoStatus = MnoWrtTTY ( "008 Test Backspace", 18, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY ( "\b\b\b\b\b", 5, 0 ) ;
usMnoStatus = MnoWrtTTY ( "\b\b\b\b\b", 5, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY ( "009 Test Backspace", 18, 0 ) ;
usMnoStatus = MnoWrtTTY ( "009 Test Backspace", 18, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 4 ;
usColumn = 4 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY (
"\b\b\b\b\b010 Test Backspace",
23,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\b\b\b\b\b010 Test Backspace",
23,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 2 ;
usColumn = 4 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY (
"\ta\tab\tabc\tabcd\tabcde\tabcdef\tabcdefg 011 Test Tab",
48,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\ta\tab\tabc\tabcd\tabcde\tabcdef\tabcdefg 011 Test Tab",
48,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 5 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY (
"\na\nab\nabc\nabcd\nabcde\nabcdef\nabcdefg 012 Test Newline",
52,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\na\nab\nabc\nabcd\nabcde\nabcdef\nabcdefg 012 Test Newline",
52,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 23 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY (
"\na\nab\nabc\nabcd\nabcde\nabcdef\nabcdefg 013 Test Newline",
52,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\na\nab\nabc\nabcd\nabcde\nabcdef\nabcdefg 013 Test Newline",
52,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 10 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY (
"014 Test Newline\r",
17,
0 ) ;
usMnoStatus = MnoWrtTTY (
"014 Test Newline\r",
17,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY (
"\r\na\r\nab\r\nabc\r\nabcd\r\nabcde\r\n"
"abcdef\r\nabcdefg 015 Test Return\r",
59,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\r\na\r\nab\r\nabc\r\nabcd\r\nabcde\r\n"
"abcdef\r\nabcdefg 015 Test Return\r",
59,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 24 ;
usColumn = 0 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY (
"\a\r\n016 Test Bell\r\n\a \a\r\n",
23,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\a\r\n016 Test Bell\r\n\a \a\r\n",
23,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY (
"\a\r\n017 Test Bell\r\n\a \a\r\n",
23,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\a\r\n017 Test Bell\r\n\a \a\r\n",
23,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usVioStatus = VioWrtTTY (
"\a \a \a \a \a \a \a \a \a \a \a \r\n"
"018 Test Bell\r\n\a \a\r\n",
48,
0 ) ;
usMnoStatus = MnoWrtTTY (
"\a \a \a \a \a \a \a \a \a \a \a \r\n"
"018 Test Bell\r\n\a \a\r\n",
48,
0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
usRow = 12 ;
usColumn = 64 ;
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
usVioStatus = VioWrtTTY ( "019 Test of VioWrtTTY", 21, 0 ) ;
usMnoStatus = MnoWrtTTY ( "019 Test of VioWrtTTY", 21, 0 ) ;
CompareCharacterBufs () ;
CompareVideoBufs () ;
DosSleep ( SHORTSLEEP ) ;
} /* End of TestMnoWrtTTY function. */
/*------------------------------------------------------------*/
/* Test Mno Set Cur Pos. */
/*------------------------------------------------------------*/
VOID TestMnoSetCurPos ()
{
USHORT usMnoStatus = 0 ;
USHORT usVioStatus = 0 ;
USHORT usRow ;
USHORT usColumn ;
usVioStatus = VioSetCurPos (
25,
0,
0 ) ;
usMnoStatus = MnoSetCurPos (
25,
0,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"001 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioSetCurPos (
0,
81,
0 ) ;
usMnoStatus = MnoSetCurPos (
0,
81,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"002 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usVioStatus = VioSetCurPos (
0,
0,
10 ) ;
usMnoStatus = MnoSetCurPos (
0,
0,
10 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"003 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
usRow = 0 ;
for ( usColumn = 0 ; usColumn < 80 ; usColumn++ )
{
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"004 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
DosSleep ( SHORTSLEEP ) ;
}
usColumn = 79 ;
for ( usRow = 0 ; usRow < 25 ; usRow++ )
{
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"005 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
DosSleep ( SHORTSLEEP ) ;
}
usRow = 24 ;
for ( usColumn = 79 ; usColumn > 0 ; usColumn-- )
{
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"006 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
DosSleep ( SHORTSLEEP ) ;
}
usColumn = 0 ;
for ( usRow = 24 ; usRow > 0 ; usRow-- )
{
usVioStatus = VioSetCurPos (
usRow,
usColumn,
0 ) ;
usMnoStatus = MnoSetCurPos (
usRow,
usColumn,
0 ) ;
if ( usVioStatus != usMnoStatus )
{
fprintf (
stderr,
"007 TestMnoSetCurPos bad return, Vio=%d Mno=%d",
usVioStatus,
usMnoStatus ) ;
exit ( 1 ) ;
}
}
} /* End of TestMnoSetCurPos function. */