early-access version 3088

This commit is contained in:
pineappleEA
2022-11-05 15:35:56 +01:00
parent 4e4fc25ce3
commit b601909c6d
35519 changed files with 5996896 additions and 860 deletions

View File

@@ -0,0 +1,60 @@
// Copyright 2021 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/system/detail/snprintf.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
{
char buffer[ 64 ];
boost::system::detail::snprintf( buffer, sizeof(buffer), "...%s...%d...", "xy", 151 );
BOOST_TEST_CSTR_EQ( buffer, "...xy...151..." );
}
{
char buffer[ 64 ];
boost::system::detail::snprintf( buffer, sizeof(buffer), "...%s...%d...", "xy", 151 );
BOOST_TEST_CSTR_EQ( buffer, "...xy...151..." );
}
{
char buffer[ 15 ];
boost::system::detail::snprintf( buffer, sizeof(buffer), "...%s...%d...", "xy", 151 );
BOOST_TEST_CSTR_EQ( buffer, "...xy...151..." );
}
{
char buffer[ 14 ];
boost::system::detail::snprintf( buffer, sizeof(buffer), "...%s...%d...", "xy", 151 );
BOOST_TEST_CSTR_EQ( buffer, "...xy...151.." );
}
{
char buffer[ 5 ];
boost::system::detail::snprintf( buffer, sizeof(buffer), "...%s...%d...", "xy", 151 );
BOOST_TEST_CSTR_EQ( buffer, "...x" );
}
{
char buffer[ 1 ];
boost::system::detail::snprintf( buffer, sizeof(buffer), "...%s...%d...", "xy", 151 );
BOOST_TEST_CSTR_EQ( buffer, "" );
}
{
char buffer[ 1 ] = { 'Q' };
boost::system::detail::snprintf( buffer, 0, "...%s...%d...", "xy", 151 );
BOOST_TEST_EQ( buffer[0], 'Q' );
}
return boost::report_errors();
}