X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fregression%2Fcompare9.c;h=4fe81f873f59831feac0350c70acfcce456a5395;hb=8e14f2362d6ec562a6d0cf433bb56d09f717b333;hp=6e4fa3c5a8c59935cb73b9e270b4898b397f7b5e;hpb=8bad3436d92f6b13ffc24583e3688e23021a62be;p=fw%2Fsdcc diff --git a/src/regression/compare9.c b/src/regression/compare9.c index 6e4fa3c5..4fe81f87 100644 --- a/src/regression/compare9.c +++ b/src/regression/compare9.c @@ -1,3 +1,5 @@ +#include "gpsim_assert.h" +#include "pic16f877.h" // Signed comparisons of the form: (variable<=LIT) // // This regression test exercises all of the boundary @@ -6,9 +8,7 @@ // and each one has an astonishing capability of failing // a boundary condition. -unsigned char success = 0; unsigned char failures = 0; -unsigned char dummy = 0; unsigned char result = 0; int int0 = 0; @@ -16,13 +16,22 @@ int int1 = 0; signed char char0 = 0; signed char char1 = 0; +/* *** NOTE *** This particular test takes quite a while to run + * ~ 10,000,000 instruction cycles. (2.5 seconds on a 20Mhz PIC). + * The WDT will reset the CPU if it's enabled. So disable it... +*/ + +typedef unsigned int word; + +//word at 0x2007 CONFIG = wdt_off & pwrte_on; + void -done () +done() { - dummy++; + ASSERT(MANGLE(failures) == 0); + PASSED(); } - void c_char_lte_lit1(unsigned char expected_result) { result = 0; @@ -289,6 +298,5 @@ main (void) int_compare1(); int_compare2(); - success = failures; done (); }