mirror of
https://github.com/boostorg/system.git
synced 2025-07-30 04:27:14 +02:00
Test that assigning to boost::throws() crashes
This commit is contained in:
@ -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>static : single_instance_lib_static ]
|
||||||
[ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : <link>shared : single_instance_lib_shared ]
|
[ run single_instance_test.cpp single_instance_lib1 single_instance_lib2 : : : <link>shared : single_instance_lib_shared ]
|
||||||
[ system-run before_main_test.cpp ]
|
[ system-run before_main_test.cpp ]
|
||||||
|
[ run-fail throws_assign_fail.cpp ]
|
||||||
;
|
;
|
||||||
|
|
||||||
# Quick (CI) test
|
# Quick (CI) test
|
||||||
|
28
test/throws_assign_fail.cpp
Normal file
28
test/throws_assign_fail.cpp
Normal 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() );
|
||||||
|
}
|
Reference in New Issue
Block a user