Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wookay/ccat
Unit testing for C
https://github.com/wookay/ccat
Last synced: 2 days ago
JSON representation
Unit testing for C
- Host: GitHub
- URL: https://github.com/wookay/ccat
- Owner: wookay
- Created: 2011-08-01T06:50:50.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-08-04T12:01:27.000Z (over 13 years ago)
- Last Synced: 2024-04-29T23:53:16.632Z (7 months ago)
- Language: C
- Homepage:
- Size: 102 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ccat
====unit testing for C.
```c
#include "ccat.h"void test_numbers() {
assert_true(1 == 1);
assert_true(3.14 == 3.14);
}void test_strings() {
assert_true(string_equal("abc", "abc"));
assert_true(string_equal("abcdef", "abcdef"));
assert_true(string_equal("abcdef", "abcdefg"));
}int main() {
unittest_setup();
unittest_run(test_numbers);
unittest_run(test_strings);unittest_report();
}
```$ gcc test_ccat.c ../ccat/UnitTest.c -I../ccat -o test_ccat.out
$ ./test_ccat.out
Started
....
Assertion failed in test_ccat.c:14
string_equal("abcdef", "abcdefg")Finished in 0.00011 seconds.
2 tests, 4 assertions, 1 failures, 0 errors