20#include <boost/test/unit_test.hpp>
25#include <wx/filename.h>
29#include <wx/scopeguard.h>
49 file = tempFile.
Path();
53 const wxString nested =
directory + wxS(
"/nested/child" );
54 BOOST_REQUIRE( wxFileName::Mkdir( nested, wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) );
55 wxFFile content( wxFileName( nested, wxS(
"content" ) ).GetFullPath(), wxS(
"w" ) );
67 const mode_t previousMask = umask( 0 );
68 wxON_BLOCK_EXIT1( umask, previousMask );
80 for(
const wxString&
path : { first.
Path(), second.
Path() } )
96 wxFFile content( existing.
Path(), wxS(
"w" ) );
108 wxFFile content( existing.
Path(), wxS(
"r" ) );
121 const wxString sentinel = wxFileName( outside.
Path(), wxS(
"sentinel" ) ).GetFullPath();
124 wxFFile content( sentinel, wxS(
"w" ) );
126 BOOST_REQUIRE( content.Write( wxS(
"keep this directory" ) ) );
129 wxString scratchPath;
134 scratchPath = scratch.
Path();
135 const wxString
link = wxFileName( scratchPath, wxS(
"outside" ) ).GetFullPath();
139 BOOST_CHECK( !wxFileName::DirExists( scratchPath ) );
141 wxFFile content( sentinel, wxS(
"r" ) );
A temporary file or directory that is removed when the object goes out of scope.
bool MakeDirectory(const wxString &aPrefix, int aPermissions=wxS_DIR_DEFAULT)
Create an empty directory with a unique name after aPrefix.
bool MakeFile(const wxString &aPrefix)
Create an empty file with a unique name after aPrefix.
const wxString & Path() const
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(RemovesWhatItCreated)