P
Analyzed 3 months ago
PCUT is a very simple framework for unit testing of C code. Unlike many other frameworks where you need to specify manually which functions belong to a particular test, PCUT provides several smart macros that hides this and lets you focus on the most important part of testing only: that is, coding
... [More]
the test cases.
Tests for the standard atoi() function may look like this:
#include < pcut/pcut.h >
#include < stdlib.h >
PCUT_INIT
PCUT_TEST(atoi_zero) {
PCUT_ASSERT_INT_EQUALS(0, atoi("0"));
}
PCUT_TEST(atoi_positive) {
PCUT_ASSERT_INT_EQUALS(42, atoi("42"));
}
PCUT_TEST(atoi_negative) {
PCUT_ASSERT_INT_EQUALS(-273, atoi("-273"));
}
PCUT_MAIN() [Less]
3.43K
lines of code
1
current contributors
7 months
since last commit
0
users on Open Hub