4#include "../../../catch2/catch.hpp"
9#define MX_NO_ERROR_REPORTS
19TEST_CASE(
"Create and destroy fftwEnvironment, no threads, environment set",
"[math::ft]" )
21 int rv = setenv(
"MXFFTW_WISDOM",
"/tmp/.fftw", 1 );
29 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.float" );
30 remove( fname.c_str() );
42 REQUIRE( ex ==
true );
49 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.double" );
50 remove( fname.c_str() );
62 REQUIRE( ex ==
true );
65 SECTION(
"long double" )
69 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.long_double" );
70 remove( fname.c_str() );
82 REQUIRE( ex ==
true );
92 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.quad" );
93 remove( fname.c_str() );
105 REQUIRE( ex ==
true );
116TEST_CASE(
"Create and destroy fftwEnvironment, no threads, environment not set",
"[math::ft]" )
118 int rv = setenv(
"MXFFTW_WISDOM",
"", 1 );
126 REQUIRE( fname ==
"./.fftw_wisdom.float" );
127 remove( fname.c_str() );
138 REQUIRE( ex ==
true );
145 REQUIRE( fname ==
"./.fftw_wisdom.double" );
146 remove( fname.c_str() );
157 REQUIRE( ex ==
true );
160 SECTION(
"long double" )
164 REQUIRE( fname ==
"./.fftw_wisdom.long_double" );
165 remove( fname.c_str() );
176 REQUIRE( ex ==
true );
186 REQUIRE( fname ==
"./.fftw_wisdom.quad" );
187 remove( fname.c_str() );
198 REQUIRE( ex ==
true );
209TEST_CASE(
"Create and destroy fftwEnvironment, with threads, environment set",
"[math::ft]" )
211 int rv = setenv(
"MXFFTW_WISDOM",
"/tmp/.fftw", 1 );
219 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.float" );
220 remove( fname.c_str() );
232 REQUIRE( ex ==
true );
239 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.double" );
240 remove( fname.c_str() );
252 REQUIRE( ex ==
true );
255 SECTION(
"long double" )
259 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.long_double" );
260 remove( fname.c_str() );
272 REQUIRE( ex ==
true );
282 REQUIRE( fname ==
"/tmp/.fftw/fftw_wisdom.quad" );
283 remove( fname.c_str() );
295 REQUIRE( ex ==
true );
306TEST_CASE(
"Create and destroy fftwEnvironment, with threads, environment not set",
"[math::ft]" )
308 int rv = setenv(
"MXFFTW_WISDOM",
"", 1 );
316 REQUIRE( fname ==
"./.fftw_wisdom.float" );
317 remove( fname.c_str() );
328 REQUIRE( ex ==
true );
335 REQUIRE( fname ==
"./.fftw_wisdom.double" );
336 remove( fname.c_str() );
347 REQUIRE( ex ==
true );
350 SECTION(
"long double" )
354 REQUIRE( fname ==
"./.fftw_wisdom.long_double" );
355 remove( fname.c_str() );
366 REQUIRE( ex ==
true );
376 REQUIRE( fname ==
"./.fftw_wisdom.quad" );
377 remove( fname.c_str() );
388 REQUIRE( ex ==
true );
Declares and defines the fftwEnvironment manager.
Declares and defines templatized wrappers for the fftw library.
Declarations of utilities for working with files.
error_t
The mxlib error codes.
@ noerror
No error has occurred.
TEST_CASE("Create and destroy fftwEnvironment, no threads, environment set", "[math::ft]")
Create and destroy fftwEnvironment, no threads, environment set.
std::string fftw_wisdom_filename()
Create the mxlib standard wisdom filename for the type.
bool exists(const std::string &path, mx::error_t &errc)
Check if a path exists.
error_t createDirectories(const std::string &path)
Create a directory or directories.
Manage the FFTW environment and wisdom using RAII.