Chris Leishman [Sat, 26 Aug 2017 05:26:56 +0000 (22:26 -0700)]
Fix invalid prototype for tcase_name(void)
The existing prototype in check.h is `const char* tcase_name()`. This
causes issues on platforms that use strict prototype checking, e.g. the
latest clang compiler with -Wstrict-prototypes ('this function
declaration is not a prototype [-Werror,-Wstrict-prototypes]').
bel2125 [Fri, 25 Aug 2017 18:29:18 +0000 (20:29 +0200)]
Remove dependency to stdbool.h
While this header is standard in C99, it does not exist in C89/C90.
Microsoft Visual Studio added this header only in version 2013.
Still common common compilers Visual Studio 2010 and 2012 (and all earlier)
do not support it.
Here we do not really have a benefit as compared to just using 'int'
instead of 'bool', so this dependency can easily be avoided to support
Visual Studio 2010 (see also https://github.com/libcheck/check/issues/125).
This program should be similar to what someone else could
use from Check. Removing this header will help determine
if anything in check.h is undefined.
Branden Archer [Sat, 13 May 2017 01:43:37 +0000 (21:43 -0400)]
Update 'no messaging setup' message
It was found that if a ck_assert() or ck_abort() call was made when not running a test
with srunner_run() that the current process would attempt to report a test
failure to the process which started the test, of which none exists. As a result,
finding no pipe file setup, the process aborts. This is all due to an API usage
mistake, as ck_assert* and ck_abort() should not be called outside of a
test or setup/teardown function.
To make it more clear that if one hits this it is a API usage issue, changing the
failure message which is reported.
Branden Archer [Wed, 10 May 2017 02:29:19 +0000 (22:29 -0400)]
Bail on error if cannot create pipe file
There have been cases where a test will fail with "No messaging setup". This is believed to be
a permissions issue, where the test process is unable to create a file in the folder selected
for temporary files. To make this error more explicit, if creating a temporary file fails bail.
Nicholas Humfrey [Sun, 15 Jan 2017 23:19:03 +0000 (23:19 +0000)]
Fix for "invalid suffix on literal" error in clang
Invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
Branden Archer [Fri, 23 Dec 2016 04:01:21 +0000 (23:01 -0500)]
Disable SIGFPE tests for Cygwin until fixed
The test_fpe and test_mark_point tests currently fail on Cygwin.
Instead of the test process receiving a SIGFPE it instead fails
with a SIGSEGV. The reason is not yet know. However, attempting a
simple program that installs a SIGFPE handler then does a
raise(SIGFPE) does result in the handler being called.
This tests need to be enabled again once the reason for the failures
is resolved.
Branden Archer [Thu, 22 Dec 2016 19:13:18 +0000 (14:13 -0500)]
Remove usage of "lg" in printf format
MinGW on Windows does not "lg". The reason is that MinGW mixes
GCC and the MSVC runtime. For GCC a long double is either
96-bit or 128-bit type for long double on x86 or x64 targets
(see http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html).
However, MSVC uses a 64-bit type
(see http://msdn.microsoft.com/en-us/library/9cx8xs15.aspx).
That means for MSVC "double" and "long double" are the same.
Because of this mismatch, the "l" in "lg", which is safely ignored
on Linux and BSD systems is not safely ignored in MSVC systems
where GCC is used to compile. This issue does not arise when using
VS compiler on Windows.
Branden Archer [Sun, 18 Dec 2016 16:47:46 +0000 (11:47 -0500)]
Change how a tmp dir is found
It was found that on Windows the TMPDIR environment variable was
honored, but for Linux/et al it was not. This resulted in files ending
up in the build directory (the present directory when the tests
were run). As the test may not have permission to write in the build
directory, attempt to honor the P_tmpdir macro or TMPDIR environment
variable.