Article View: net.sources.bugs
Article #816debug.h diffs, test driver
From: Thomas J Keller
Date: Mon, 29 Sep 1986 21:03
Date: Mon, 29 Sep 1986 21:03
92 lines
2722 bytes
2722 bytes
My friend who tested the debug program didn't test it quite as thouroughly
as he thought he did. Here is a diff file to patch the error in the frpint
specification for the DCHAR macro.
Also included is a crude but effective test driver program for testing the
macro package.
This is *NOT* a shell archive.
--------------------------------- cut here ---------------------------------
43c43
< # define SPEC '%03o'
---
> # define SPEC "DBUG: %s: '%03o'\n"
45c45
< # define SPEC 0x%02x
---
> # define SPEC "DEBUG: %s: 0x%02x\n"
70c70
< fprintf(stderr, "DEBUG: %s SPEC\n", \
---
> fprintf(stderr, SPEC, \
----------------------------------- cut here -------------------------------
#include <stdio.h>
#include <errno.h>
#define DEBUG
#include "debug.h"
extern int errno;
main()
{
char a;
unsigned char b = '\077';
short int c = 27;
unsigned short d = 27;
int e = 27;
unsigned int f = 27;
long g = 27L;
unsigned long h = 27L;
float i = 1.654E3;
char k[15];
a = '\000';
DCHAR("testing DCHAR for null char", a);
a = '\040';
DCHAR("testing DCHAR for blank char", a);
a = '\073';
DCHAR("testing DCHAR for other values", a);
DSHORT("testing DSHORT", c);
DINT("testing DINT", e);
DLONG("testing DLONG", g);
DUCHAR("testing DUCHAR", b);
DUSHORT("testing DUSHORT", d);
DUINT("testing DUINT", f);
DULONG("testing DULONG", h);
DFLOAT("testing DFLOAT", i);
strcpy(k, "");
DSTRING("testing DSTRING for null string", k);
strcpy(k, "test string");
DSTRING("testing DSTRING for loaded string", k);
DMSG("testing DMSG");
DENTER("testing DENTER");
DEXIT("testing DEXIT");
DSTOP("testing DSTOP");
write(e,k,15);
DERROR("write(a,k,15)","testing DERROR");
printf("debug test complete\n");
}
--------------------------------- cut here ---------------------------------
--
Disclaimer: Disclaimer? DISCLAIMER!? I don't need no stinking DISCLAIMER!!!
tom keller "She's alive, ALIVE!"
{ihnp4, dual}!ptsfa!gilbbs!mc68020
(* we may not be big, but we're small! *)
Technical Details
Message-ID:
<1044@gilbbs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!think!nike!lll-crg!lll-lcc!qantel!ptsfa!gilbbs!mc68020Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!think!nike!lll-crg!lll-lcc!qantel!ptsfa!gilbbs!mc68020 From: mc68020@gilbbs.UUCP (Thomas J Keller) Newsgroups: net.sources.bugs Subject: debug.h diffs, test driver Message-ID: <1044@gilbbs.UUCP> Date: Mon, 29-Sep-86 17:03:20 EDT Article-I.D.: gilbbs.1044 Posted: Mon Sep 29 17:03:20 1986 Date-Received: Wed, 1-Oct-86 01:42:11 EDT Organization: Gil's Place, Santa Rosa CA Lines: 92 Keywords: minor bug, diffs, test driver