Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,44 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#include <coco.h>
|
||||
#include <stdarg.h>
|
||||
#include <vcc/printer.h>
|
||||
|
||||
static int sendArgs(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
int count = vcc_printer_vprintf(format, args);
|
||||
va_end(args);
|
||||
return count;
|
||||
}
|
||||
|
||||
/* A custom console hook receives A and must preserve B, X, Y and U. */
|
||||
static asm void ignoreConsoleCharacter(void)
|
||||
{
|
||||
asm { rts }
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const byte *device = (const byte *)0x006F; /* BASIC DEVNUM */
|
||||
ConsoleOutHook savedHook;
|
||||
int count, invalid, nullFormat, empty, previousDevicePreserved;
|
||||
cls(1);
|
||||
setOutputDevice(DEV_CASSETTE);
|
||||
savedHook = setConsoleOutHook(ignoreConsoleCharacter);
|
||||
count = sendArgs("%04u %-4s %c %%\n", 9U, "IO", 'X');
|
||||
invalid = vcc_printer_printf("PREFIX%f");
|
||||
nullFormat = vcc_printer_printf(NULL);
|
||||
empty = vcc_printer_printf("");
|
||||
previousDevicePreserved = *device == (byte)DEV_CASSETTE;
|
||||
ConsoleOutHook active = setConsoleOutHook(savedHook);
|
||||
setOutputDevice(DEV_SCREEN);
|
||||
if (count != 14 || invalid >= 0 || nullFormat >= 0 || empty != 0 || !previousDevicePreserved ||
|
||||
active != ignoreConsoleCharacter)
|
||||
{
|
||||
printf("FAIL LINE %u COUNT %d\n", (unsigned)__LINE__, count);
|
||||
return 1;
|
||||
}
|
||||
printf("PRINTER CHECKS PASSED\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user