vhotspur / pcut Goto Github PK
View Code? Open in Web Editor NEWPlain C unit testing framework
Plain C unit testing framework
Pcut creates temporary files in the current directory with its homebrew code, either in generic.c or helenos.c. On HelenOS if / is full or if the test is run with WD set to a non-writable directory (e.g. /loc), PCUT will fail to create temporary file for every test.
Suggestion: How about tmpfile() on HelenOS and tmpnam() on generic?
int test_foo;
PCUT_TEST(foo)
{
...
}
fails to compile because foo is mangled to test_foo. Perhaps test case identifiers should be mangled to something that the programmer is less likely to use accidentally, such as _test_xxx or _pcut_xxx, for example.
I'm gonna just be lazy and link the offending commit :)
Both of these tests checks how PCUT behaves when test is unexpectedly aborted (e.g. during NULL pointer dereference). To achieve this, they intentionally access *p
where p == NULL
. However, this is undefined behaviour and Clang optimizations causes that the dereference returns 0
(while GCC-compiled program ends with SEGFAULT
). See What Every C Programmer Should Know About Undefined Behavior for more details. Note that this happens only with -O3
: with -O0
the compiled program behaves the same as GCC-compiled one does.
Fixing ought to be easy: the tests shall explicitly call abort()
or its equivalent.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.