Test that assigning to boost::throws() crashes

This commit is contained in:
Peter Dimov
2018-01-28 17:29:13 +02:00
parent 0b48bb8166
commit aec8d9056d
2 changed files with 29 additions and 0 deletions

View File

@ -125,6 +125,7 @@ else
[ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : <link>static : single_instance_lib_static ]
[ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : <link>shared : single_instance_lib_shared ]
[ system-run before_main_test.cpp ]
[ run-fail throws_assign_fail.cpp ]
;
# Quick (CI) test

View File

@ -0,0 +1,28 @@
// Copyright 2018 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
#include <boost/system/error_code.hpp>
using namespace boost::system;
static void f( error_code & ec )
{
ec = error_code();
}
#if defined(_WIN32)
# include <windows.h> // SetErrorMode
#endif
int main()
{
#if defined(_WIN32)
SetErrorMode( SetErrorMode( 0 ) | SEM_NOGPFAULTERRORBOX );
#endif
// this should crash
f( boost::throws() );
}