berlin-ab / cexpect Goto Github PK
View Code? Open in Web Editor NEWcexpect - a library for creating test suites with extensible matchers
cexpect - a library for creating test suites with extensible matchers
[] It might be useful to try to guard against mutliple header file inclusion. E.g. include the content of each header file within #ifndef _FILENAME_H_ #define _FILENAME_H_ #endif
blocks
[] It is not great (although for example Postgres does it some) use sizeof(type)
in alloc functions. Especially if that type is char
then some critique might follow. It is a bit more accepted to write type *var = allocfunc(nelems * sizeof(*var));
[] exit(func(foo))
is not really great since you probably want to be explicit of the exit status regardless of platform and or shell running it. One of the ways to write this is along the lines of
if (func(foo))
exit(EXIT_FAILURE);
else
exit(EXIT_SUCCESS);
[] Also the main
function in the examples does not have a return value. Although the framework is expected to exit a return value will be asked from most compilers.
[] Use of sprintf
is generally discouraged in preference to the safer snprintf
which takes a size argument.
"%s", (expected_value ? "true" : "false")
the parenthesis means something else, and although most compilers will not complain and do the right thing, they can and should be omitted.Pulling from this list:
https://en.wikipedia.org/wiki/C_character_classification
Implement matchers in the form of:
expect(test, 'a', is_char_equal_to('a)); // passing
expect(test, 'b', is_char_equal_to('a)); // failing
I'd like to have TAP as an available option as a part of the core distribution.
See https://testanything.org/ for details of how to implement.
Given an empty list:
List * make_list()
When I make an expectation using a not
matcher and the is_list_empty()
matcher:
expect(test, list, not(is_list_empty()));
Then the test should fail.
Note: I'm not exactly sure what the expected and actual messages should be. This might require some pre-refactoring to do well.
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.