MinUnit – A minimal unit testing framework for C (2002)
1–10 of 56 posts
Re: MinUnit – A minimal unit testing framework for C (2002)
#2Re: MinUnit – A minimal unit testing framework for C (2002)
#3So, the revelation is that a unit test is an if statement, and if you wrap that into a macro you can call it a framework.
Re: MinUnit – A minimal unit testing framework for C (2002)
#4Apologies, its been a while since I've touched C/C++
Re: MinUnit – A minimal unit testing framework for C (2002)
#5Whats up with the do/while loops? Does that just make the return syntactically valid? Apologies, its been a while since I've touched C/C++
Re: MinUnit – A minimal unit testing framework for C (2002)
#6Whats up with the do/while loops? Does that just make the return syntactically valid? Apologies, its been a while since I've touched C/C++
Re: MinUnit – A minimal unit testing framework for C (2002)
#7So, the revelation is that a unit test is an if statement, and if you wrap that into a macro you can call it a framework.
For many novice engineers this is a huge revelation.
it(“should be confusing”, function() { ... })
Re: MinUnit – A minimal unit testing framework for C (2002)
#8 $ curl -s --head http://www.jera.com/techinfo/jtns/jtn002.html | grep ^Last
Last-Modified: Fri, 06 Sep 2002 07:16:46 GMTRe: MinUnit – A minimal unit testing framework for C (2002)
#9 #include
Usage: void test_foo() {
assert(foo() == 4 /* foo should be 4 */);
}
Output would be something like Assertion failed at "foo() == 4 /* foo should be 4 */"
If you run the application in a debugger like GDB, you can see the frame when the abort trap is called.Re: MinUnit – A minimal unit testing framework for C (2002)
#10Earlier quoted context omitted.
For many novice engineers this is a huge revelation.
Really? Is it perhaps because of those libraries that do their best to make test call sites look like weird pseudo-English. Stuff like having a library function named it(): it(“should be confusing”, function() { ... })
The only reason I see the usefulness of additional syntax just for tests is the case to have non-technical people writing tests. From my experience, this is a terrible idea.