1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
pgbackrest/test/lib/pgBackRestTest/Common
David Steele 76b88a3cd5 Add UNCONSTIFY() macro.
Allows casting const-ness away from an expression, but doesn't allow changing the type. Enforcement of the latter currently only works for gcc-like compilers.

Note that it is not safe to cast const-ness away if the result will ever be modified (it would be undefined behavior). Doing so can cause compiler mis-optimizations or runtime crashes (by modifying read-only memory). It is only safe to use when the result will not be modified, but API design or language restrictions prevent you from declaring that (e.g. because a function returns both const and non-const variables).

Note that this only works in function scope, not for global variables (it would be nice, but not trivial, to improve that).

UNCONSTIFY() requires static assert which is a feature in its own right.
2020-04-02 16:58:38 -04:00
..
Io Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
BuildTest.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
CodeCountTest.pm Update code classification and remove XS definition. 2020-03-14 18:30:24 -04:00
ContainerTest.pm Move docker files to test/result. 2020-03-14 15:40:37 -04:00
CoverageTest.pm More improvements to custom coverage report. 2020-03-23 12:17:34 -04:00
DbVersion.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
DefineTest.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
ExecuteTest.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
FileTest.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
HostGroupTest.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
HostTest.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
JobTest.pm Add UNCONSTIFY() macro. 2020-04-02 16:58:38 -04:00
ListTest.pm Add --no-performance to test.pl to suppress performance tests. 2020-03-26 20:36:09 -04:00
LogTest.pm Add SocketClient object. 2020-03-31 12:43:29 -04:00
RunTest.pm Move pgBackRest::Version module to pgBackRestDoc::ProjectInfo. 2020-03-10 17:57:02 -04:00
Storage.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
StorageBase.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
StoragePosix.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
StoragePosixRead.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
StoragePosixWrite.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00
StorageRepo.pm Move pgBackRest::Version module to pgBackRestDoc::ProjectInfo. 2020-03-10 17:57:02 -04:00
VmTest.pm Enable coverage testing on Fedora 30. 2020-03-20 13:49:23 -04:00
Wait.pm Rename BackRestDoc Perl module to pgBackRestDoc. 2020-03-10 15:41:56 -04:00