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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.