summaryrefslogtreecommitdiff
path: root/support/dktools/test-dk4maaus.c
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
committerNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
commit1f457376b478257b88d4a857f5ec1b6155442dd7 (patch)
tree2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/test-dk4maaus.c
parentac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff)
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/test-dk4maaus.c')
-rw-r--r--support/dktools/test-dk4maaus.c110
1 files changed, 0 insertions, 110 deletions
diff --git a/support/dktools/test-dk4maaus.c b/support/dktools/test-dk4maaus.c
deleted file mode 100644
index 91003dd3f8..0000000000
--- a/support/dktools/test-dk4maaus.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: test-dk4maaus.ctr
-*/
-
-/** @file test-dk4maaus.c The test-dk4maaus module.
-*/
-
-
-#line 1 "test-dk4maaus.ctr"
-
-#include "dk4conf.h"
-
-#include <stdio.h>
-
-#include "dk4error.h"
-#include "dk4maaus.h"
-
-
-
-#line 10 "test-dk4maaus.ctr"
-
-
-static
-void
-show_error(dk4_er_t *erp)
-{
- if (DK4_E_NONE != erp->ec) {
- switch(erp->ec) {
- case DK4_E_MATH_OVERFLOW: {
- printf(" overflow");
- } break;
- case DK4_E_MATH_DIVZERO: {
- printf(" divzero");
- } break;
- default: {
- printf(" %u", erp->ec);
- } break;
- }
- }
-}
-
-
-
-int main(void)
-{
- char buffer[128]; /* Input line buffer */
- dk4_er_t er; /* Error report */
- unsigned i1; /* First operand */
- unsigned i2; /* Second operand */
- int exc; /* Exit code */
- int cc; /* Flag: Can continue */
- unsigned short c1; /* First operand as char */
- unsigned short c2; /* Second operand as char */
- unsigned short c3; /* Result as char */
-
-
-
-#line 46 "test-dk4maaus.ctr"
-
-
-#line 47 "test-dk4maaus.ctr"
- exc = 0;
- cc = 1;
- while((1 == cc) && (fgets(buffer, sizeof(buffer), stdin))) {
- if (sscanf(buffer, "%u %u", &i1, &i2) == 2) {
- c1 = i1;
- c2 = i2;
- printf("%u %u\n", (unsigned)c1, (unsigned)c2);
- dk4error_init(&er);
- c3 = dk4ma_ushort_add(c1, c2, &er);
- printf("\t+ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_sub(c1, c2, &er);
- printf("\t- %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_mul(c1, c2, &er);
- printf("\t* %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
-
- dk4error_init(&er);
- c3 = dk4ma_ushort_div(c1, c2, &er);
- printf("\t/ %u", (unsigned)c3);
- show_error(&er);
- printf("\n");
- } else {
- exc = 1;
- fprintf(stderr, "test-dk4maac:ERROR: Invalid input line!\n");
- fflush(stderr);
- cc = 0;
- }
- }
-
-
-#line 85 "test-dk4maaus.ctr"
-
-
-#line 86 "test-dk4maaus.ctr"
- return exc;
-}
-