Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Jan 11, 2018
1 parent 1b7b954 commit 9f755bd
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/MagnumExternal/Optional/Test/StdOptionalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
DEALINGS IN THE SOFTWARE.
*/

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4996)
#endif
#include <memory>
#include <Corrade/Containers/Optional.h>
#include <Corrade/TestSuite/Tester.h>
Expand All @@ -42,15 +49,7 @@ StdOptionalTest::StdOptionalTest() {
addTests({&StdOptionalTest::conversion});
}

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void StdOptionalTest::conversion() {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4996)
#endif
Debug{} << "Using C++ version" << CORRADE_CXX_STANDARD;
#ifdef _MAGNUM_HAS_STD_OPTIONAL
Debug{} << "Using a conversion to std::optional, C++17 should be present";
Expand All @@ -73,14 +72,13 @@ void StdOptionalTest::conversion() {
Containers::Optional<std::unique_ptr<int>> c{std::unique_ptr<int>{new int{7}}};
std::optional<std::unique_ptr<int>> sc = std::move(c);
CORRADE_COMPARE(**sc, 7);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

}}

CORRADE_TEST_MAIN(Magnum::Test::StdOptionalTest)
#ifdef __GNUC__
#pragma GCC diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#endif

0 comments on commit 9f755bd

Please sign in to comment.