Commit 05c1e1c0 authored by Matthieu Schaller's avatar Matthieu Schaller

Make the unit tests ignore FPEs if we can't activate them on this platform. Do...

Make the unit tests ignore FPEs if we can't activate them on this platform. Do not run the dump and logger tests if the file allocation POSIX functions don't exist.
parent ec354705
......@@ -469,8 +469,10 @@ int main(int argc, char *argv[]) {
unsigned long long cpufreq = 0;
clocks_set_cpufreq(cpufreq);
/* Choke on FP-exceptions */
/* Choke on FP-exceptions */
#ifdef HAVE_FE_ENABLE_EXCEPT
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#endif
/* Get some randomness going */
srand(0);
......
......@@ -316,8 +316,10 @@ int main(int argc, char *argv[]) {
unsigned long long cpufreq = 0;
clocks_set_cpufreq(cpufreq);
/* Choke on FP-exceptions */
/* Choke on FP-exceptions */
#ifdef HAVE_FE_ENABLE_EXCEPT
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#endif
/* Get some randomness going */
srand(0);
......
......@@ -393,8 +393,10 @@ int main(int argc, char *argv[]) {
unsigned long long cpufreq = 0;
clocks_set_cpufreq(cpufreq);
/* Choke on FP-exceptions */
/* Choke on FP-exceptions */
#ifdef HAVE_FE_ENABLE_EXCEPT
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#endif
/* Generate a RNG seed from time. */
unsigned int seed = time(NULL);
......
......@@ -20,6 +20,8 @@
/* Config parameters. */
#include "../config.h"
#ifdef HAVE_POSIX_FALLOCATE /* Are we on a sensible platform? */
/* Some standard headers. */
#include <errno.h>
#include <fcntl.h>
......@@ -85,3 +87,9 @@ int main(int argc, char *argv[]) {
/* Return a happy number. */
return 0;
}
#else
int main() { return 0; }
#endif /* HAVE_POSIX_FALLOCATE */
......@@ -20,6 +20,8 @@
/* Config parameters. */
#include "../config.h"
#ifdef HAVE_POSIX_FALLOCATE /* Are we on a sensible platform? */
/* Some standard headers. */
#include <stdio.h>
#include <stdlib.h>
......@@ -245,3 +247,9 @@ int main(int argc, char *argv[]) {
printf("PASS\n");
return 0;
}
#else
int main() { return 0; }
#endif /* HAVE_POSIX_FALLOCATE */
......@@ -391,8 +391,10 @@ int main(int argc, char *argv[]) {
unsigned long long cpufreq = 0;
clocks_set_cpufreq(cpufreq);
/* Choke on FP-exceptions */
/* Choke on FP-exceptions */
#ifdef HAVE_FE_ENABLE_EXCEPT
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#endif
/* Get some randomness going */
srand(0);
......
......@@ -28,8 +28,10 @@
int main(int argc, char *argv[]) {
/* Choke if need be */
/* Choke on FPEs */
#ifdef HAVE_FE_ENABLE_EXCEPT
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#endif
#if defined(SHADOWFAX_SPH)
/* Initialize the Voronoi simulation box */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment