KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_atomic_save.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <drawing_sheet/ds_data_model.h>
#include <ki_exception.h>
#include <kiplatform/io.h>
#include <richio.h>
#include <wx/dir.h>
#include <wx/ffile.h>
#include <wx/filefn.h>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include <wx/stopwatch.h>
#include <cstdio>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (PrettifiedFormatter_HappyPath)
 
 BOOST_AUTO_TEST_CASE (PrettifiedFormatter_UnwindingPreservesOriginal)
 
 BOOST_AUTO_TEST_CASE (PrettifiedFormatter_DestructorCommitsWithoutExplicitFinish)
 
 BOOST_AUTO_TEST_CASE (FileFormatter_UnwindingPreservesOriginal)
 
 BOOST_AUTO_TEST_CASE (AtomicWriteFile_HappyPath)
 
 BOOST_AUTO_TEST_CASE (AtomicWriteFile_OverwritePreservesOriginalOnFailure)
 
 BOOST_AUTO_TEST_CASE (PrettifiedFormatter_ExplicitFinishThrowsOnCommitFailure)
 
 BOOST_AUTO_TEST_CASE (FileFormatter_ExplicitFinishThrowsOnCommitFailure)
 
 BOOST_AUTO_TEST_CASE (DrawingSheetSave_PropagatesCommitFailure)
 
 BOOST_AUTO_TEST_CASE (PrettifiedFormatter_DestructorCommitFailureLeavesTargetIntact)
 
 BOOST_AUTO_TEST_CASE (PrettifiedFormatter_CreatesNewTarget)
 
 BOOST_AUTO_TEST_CASE (AtomicWriteFile_PreservesPosixMode)
 
 BOOST_AUTO_TEST_CASE (AtomicWriteFile_FollowsSymlinkTarget)
 
 BOOST_AUTO_TEST_CASE (AtomicWriteFile_FailedRenameRestoresTargetMode)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/14]

BOOST_AUTO_TEST_CASE ( AtomicWriteFile_FailedRenameRestoresTargetMode )

Definition at line 409 of file test_atomic_save.cpp.

References KIPLATFORM::IO::AtomicWriteFile(), and BOOST_REQUIRE().

◆ BOOST_AUTO_TEST_CASE() [2/14]

BOOST_AUTO_TEST_CASE ( AtomicWriteFile_FollowsSymlinkTarget )

Definition at line 379 of file test_atomic_save.cpp.

References KIPLATFORM::IO::AtomicWriteFile(), and BOOST_REQUIRE().

◆ BOOST_AUTO_TEST_CASE() [3/14]

BOOST_AUTO_TEST_CASE ( AtomicWriteFile_HappyPath )

Definition at line 194 of file test_atomic_save.cpp.

References KIPLATFORM::IO::AtomicWriteFile(), and BOOST_REQUIRE().

◆ BOOST_AUTO_TEST_CASE() [4/14]

BOOST_AUTO_TEST_CASE ( AtomicWriteFile_OverwritePreservesOriginalOnFailure )

Definition at line 211 of file test_atomic_save.cpp.

References KIPLATFORM::IO::AtomicWriteFile(), and BOOST_REQUIRE().

◆ BOOST_AUTO_TEST_CASE() [5/14]

BOOST_AUTO_TEST_CASE ( AtomicWriteFile_PreservesPosixMode )

Definition at line 352 of file test_atomic_save.cpp.

References KIPLATFORM::IO::AtomicWriteFile(), and BOOST_REQUIRE().

◆ BOOST_AUTO_TEST_CASE() [6/14]

BOOST_AUTO_TEST_CASE ( DrawingSheetSave_PropagatesCommitFailure )

Definition at line 290 of file test_atomic_save.cpp.

References BOOST_REQUIRE(), DS_DATA_MODEL::GetTheInstance(), and model.

◆ BOOST_AUTO_TEST_CASE() [7/14]

BOOST_AUTO_TEST_CASE ( FileFormatter_ExplicitFinishThrowsOnCommitFailure )

◆ BOOST_AUTO_TEST_CASE() [8/14]

BOOST_AUTO_TEST_CASE ( FileFormatter_UnwindingPreservesOriginal )

Definition at line 170 of file test_atomic_save.cpp.

References BOOST_REQUIRE(), and OUTPUTFORMATTER::Print().

◆ BOOST_AUTO_TEST_CASE() [9/14]

BOOST_AUTO_TEST_CASE ( PrettifiedFormatter_CreatesNewTarget )

◆ BOOST_AUTO_TEST_CASE() [10/14]

BOOST_AUTO_TEST_CASE ( PrettifiedFormatter_DestructorCommitFailureLeavesTargetIntact )

Definition at line 308 of file test_atomic_save.cpp.

References BOOST_REQUIRE(), and OUTPUTFORMATTER::Print().

◆ BOOST_AUTO_TEST_CASE() [11/14]

BOOST_AUTO_TEST_CASE ( PrettifiedFormatter_DestructorCommitsWithoutExplicitFinish )

Definition at line 150 of file test_atomic_save.cpp.

References actual, BOOST_REQUIRE(), and OUTPUTFORMATTER::Print().

◆ BOOST_AUTO_TEST_CASE() [12/14]

BOOST_AUTO_TEST_CASE ( PrettifiedFormatter_ExplicitFinishThrowsOnCommitFailure )

◆ BOOST_AUTO_TEST_CASE() [13/14]

BOOST_AUTO_TEST_CASE ( PrettifiedFormatter_HappyPath )

◆ BOOST_AUTO_TEST_CASE() [14/14]

BOOST_AUTO_TEST_CASE ( PrettifiedFormatter_UnwindingPreservesOriginal )

Definition at line 122 of file test_atomic_save.cpp.

References BOOST_REQUIRE(), and OUTPUTFORMATTER::Print().