Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Creating a co-operative framework for testing

by ruoso (Curate)
on Oct 26, 2006 at 09:51 UTC ( #580723=note: print w/replies, xml ) Need Help??


in reply to Re: Creating a co-operative framework for testing
in thread Creating a co-operative framework for testing

BTW, for C code, I also use this _test.h file... which is very helpful to me...

#ifndef LOADED_TEST_H #define LOADED_TEST_H #include <stdio.h> #include <unistd.h> #define plan(numtests) printf("1..%i\n",(numtests)); #define ok(bool,testname) printf("%s - %s\n",(bool)?"ok":"not ok",test +name); #define pass(testname) printf("ok - %s\n",testname); #define fail(testname) printf("not ok - %s\n",testname); #define skip(testname,reason) printf("ok - %s # Skipped: %s\n",testnam +e,reason); #define is_int(got,expected,testname) printf("%s - %s (expected:%i, go +t:%i)\n",((got)==(expected))?"ok":"not ok",testname,expected,got); #define is_short(got,expected,testname) printf("%s - %s (expected:%hhu +, got:%hhu)\n",((got)==(expected))?"ok":"not ok",testname,expected,go +t); #define is_flt(got,expected,testname) printf("%s - %s (expected:%f, go +t:%f)\n",((got)==(expected))?"ok":"not ok",testname,expected,got); #define is_str(got,expected,testname) printf("%s - %s (expected:%s, go +t:%s)\n",(strcmp((got),(expected))==0)?"ok":"not ok",testname,expecte +d,got); #endif
daniel

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://580723]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2019-10-19 22:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?