diff --git a/test/error_code_test2.cpp b/test/error_code_test2.cpp index e423653..aca7a05 100644 --- a/test/error_code_test2.cpp +++ b/test/error_code_test2.cpp @@ -24,6 +24,9 @@ int main() BOOST_TEST_EQ( ec.to_string(), std::string( "system:0" ) ); + // when len is 0 buffer can be nullptr + ec.message( nullptr, 0 ); + { sys::error_code ec2( ec ); diff --git a/test/error_condition_test3.cpp b/test/error_condition_test3.cpp index fefecf3..2c83e10 100644 --- a/test/error_condition_test3.cpp +++ b/test/error_condition_test3.cpp @@ -24,6 +24,9 @@ int main() BOOST_TEST_EQ( en.to_string(), std::string( "cond:generic:0" ) ); + // when len is 0 buffer can be nullptr + en.message( nullptr, 0 ); + { sys::error_condition en2( en );