mirror of
https://github.com/boostorg/io.git
synced 2025-06-25 03:51:36 +02:00
Merge branch 'develop'
This commit is contained in:
@ -1,16 +1,15 @@
|
||||
# Copyright 2018 Mike Dev
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||
# (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
cmake_minimum_required( VERSION 3.5 )
|
||||
project( BoostIO LANGUAGES CXX )
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
add_library( boost_io INTERFACE )
|
||||
add_library( Boost::io ALIAS boost_io )
|
||||
project(BoostIO LANGUAGES CXX)
|
||||
|
||||
target_include_directories( boost_io INTERFACE include )
|
||||
add_library(boost_io INTERFACE)
|
||||
add_library(Boost::io ALIAS boost_io)
|
||||
|
||||
target_link_libraries( boost_io
|
||||
INTERFACE
|
||||
Boost::config
|
||||
)
|
||||
target_include_directories(boost_io INTERFACE include)
|
||||
|
||||
target_link_libraries(boost_io INTERFACE Boost::config)
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
import testing ;
|
||||
|
||||
project : requirements <warnings>pedantic <warnings-as-errors>on ;
|
||||
|
||||
run ios_state_unit_test.cpp ;
|
||||
run ios_state_test.cpp ;
|
||||
run quoted_test.cpp ;
|
||||
|
@ -75,7 +75,7 @@ void saver_tests_1(int index,
|
||||
BOOST_TEST(69L == output.iword(index));
|
||||
try {
|
||||
boost::io::ios_exception_saver ies(output);
|
||||
boost::io::ios_iostate_saver iis(output);
|
||||
boost::io::ios_iostate_saver ias(output);
|
||||
output.exceptions(std::ios_base::eofbit | std::ios_base::badbit);
|
||||
output.setstate(std::ios_base::eofbit);
|
||||
BOOST_ERROR("previous line should have thrown");
|
||||
@ -114,7 +114,7 @@ void saver_tests_2(int index,
|
||||
BOOST_TEST(69L == output.iword(index));
|
||||
try {
|
||||
boost::io::ios_exception_saver ies(output, std::ios_base::eofbit);
|
||||
boost::io::ios_iostate_saver iis(output,
|
||||
boost::io::ios_iostate_saver ias(output,
|
||||
output.rdstate() | std::ios_base::eofbit );
|
||||
BOOST_ERROR("previous line should have thrown");
|
||||
#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB))
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
};
|
||||
|
||||
void
|
||||
ios_flags_saver_unit_test(int index)
|
||||
ios_flags_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(std::ios_base::skipws | std::ios_base::dec, ss.flags());
|
||||
@ -69,7 +69,7 @@ ios_flags_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_precision_saver_unit_test(int index)
|
||||
ios_precision_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(6, ss.precision());
|
||||
@ -90,7 +90,7 @@ ios_precision_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_width_saver_unit_test(int index)
|
||||
ios_width_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(0, ss.width());
|
||||
@ -111,7 +111,7 @@ ios_width_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_iostate_saver_unit_test(int index)
|
||||
ios_iostate_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(std::ios_base::goodbit, ss.rdstate());
|
||||
@ -146,7 +146,7 @@ ios_iostate_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_exception_saver_unit_test(int index)
|
||||
ios_exception_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(std::ios_base::goodbit, ss.exceptions());
|
||||
@ -182,7 +182,7 @@ ios_exception_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_tie_saver_unit_test(int index)
|
||||
ios_tie_saver_unit_test()
|
||||
{
|
||||
BOOST_TEST(NULL == std::cout.tie());
|
||||
{
|
||||
@ -202,7 +202,7 @@ ios_tie_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_rdbuf_saver_unit_test(int index)
|
||||
ios_rdbuf_saver_unit_test()
|
||||
{
|
||||
std::iostream s(NULL);
|
||||
BOOST_TEST(NULL == s.rdbuf());
|
||||
@ -225,7 +225,7 @@ ios_rdbuf_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_fill_saver_unit_test(int index)
|
||||
ios_fill_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(' ', ss.fill());
|
||||
@ -246,7 +246,7 @@ ios_fill_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_locale_saver_unit_test(int index)
|
||||
ios_locale_saver_unit_test()
|
||||
{
|
||||
typedef std::numpunct<char> npc_type;
|
||||
std::stringstream ss;
|
||||
@ -325,7 +325,7 @@ ios_pword_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_base_all_saver_unit_test(int index)
|
||||
ios_base_all_saver_unit_test()
|
||||
{
|
||||
std::stringstream ss;
|
||||
BOOST_TEST_EQ(std::ios_base::skipws | std::ios_base::dec, ss.flags());
|
||||
@ -349,7 +349,7 @@ ios_base_all_saver_unit_test(int index)
|
||||
}
|
||||
|
||||
void
|
||||
ios_all_saver_unit_test(int index)
|
||||
ios_all_saver_unit_test()
|
||||
{
|
||||
typedef std::numpunct<char> npc_type;
|
||||
std::stringbuf sb;
|
||||
@ -443,19 +443,19 @@ ios_word_saver_unit_test(int index)
|
||||
int main()
|
||||
{
|
||||
int index = std::ios_base::xalloc();
|
||||
ios_flags_saver_unit_test(index);
|
||||
ios_precision_saver_unit_test(index);
|
||||
ios_width_saver_unit_test(index);
|
||||
ios_iostate_saver_unit_test(index);
|
||||
ios_exception_saver_unit_test(index);
|
||||
ios_tie_saver_unit_test(index);
|
||||
ios_rdbuf_saver_unit_test(index);
|
||||
ios_fill_saver_unit_test(index);
|
||||
ios_locale_saver_unit_test(index);
|
||||
ios_flags_saver_unit_test();
|
||||
ios_precision_saver_unit_test();
|
||||
ios_width_saver_unit_test();
|
||||
ios_iostate_saver_unit_test();
|
||||
ios_exception_saver_unit_test();
|
||||
ios_tie_saver_unit_test();
|
||||
ios_rdbuf_saver_unit_test();
|
||||
ios_fill_saver_unit_test();
|
||||
ios_locale_saver_unit_test();
|
||||
ios_iword_saver_unit_test(index);
|
||||
ios_pword_saver_unit_test(index);
|
||||
ios_base_all_saver_unit_test(index);
|
||||
ios_all_saver_unit_test(index);
|
||||
ios_base_all_saver_unit_test();
|
||||
ios_all_saver_unit_test();
|
||||
ios_word_saver_unit_test(index);
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ Copyright 2019 Glen Joseph Fernandes
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/io/ostream_joiner.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <sstream>
|
||||
|
||||
int main()
|
||||
|
@ -5,56 +5,57 @@ Copyright 2019 Glen Joseph Fernandes
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/io/ostream_joiner.hpp>
|
||||
#include <boost/core/is_same.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <sstream>
|
||||
|
||||
void test_char_type()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(char,
|
||||
boost::io::ostream_joiner<const char*>::char_type);
|
||||
BOOST_TEST((boost::core::is_same<char,
|
||||
boost::io::ostream_joiner<const char*>::char_type>::value));
|
||||
}
|
||||
|
||||
void test_traits_type()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(std::char_traits<char>,
|
||||
boost::io::ostream_joiner<const char*>::traits_type);
|
||||
BOOST_TEST((boost::core::is_same<std::char_traits<char>,
|
||||
boost::io::ostream_joiner<const char*>::traits_type>::value));
|
||||
}
|
||||
|
||||
void test_ostream_type()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(std::ostream,
|
||||
boost::io::ostream_joiner<const char*>::ostream_type);
|
||||
BOOST_TEST((boost::core::is_same<std::ostream,
|
||||
boost::io::ostream_joiner<const char*>::ostream_type>::value));
|
||||
}
|
||||
|
||||
void test_iterator_category()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(std::output_iterator_tag,
|
||||
boost::io::ostream_joiner<const char*>::iterator_category);
|
||||
BOOST_TEST((boost::core::is_same<std::output_iterator_tag,
|
||||
boost::io::ostream_joiner<const char*>::iterator_category>::value));
|
||||
}
|
||||
|
||||
void test_value_type()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(void,
|
||||
boost::io::ostream_joiner<const char*>::value_type);
|
||||
BOOST_TEST((boost::core::is_same<void,
|
||||
boost::io::ostream_joiner<const char*>::value_type>::value));
|
||||
}
|
||||
|
||||
void test_difference_type()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(void,
|
||||
boost::io::ostream_joiner<const char*>::difference_type);
|
||||
BOOST_TEST((boost::core::is_same<void,
|
||||
boost::io::ostream_joiner<const char*>::difference_type>::value));
|
||||
}
|
||||
|
||||
void test_pointer()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(void,
|
||||
boost::io::ostream_joiner<const char*>::pointer);
|
||||
BOOST_TEST((boost::core::is_same<void,
|
||||
boost::io::ostream_joiner<const char*>::pointer>::value));
|
||||
}
|
||||
|
||||
void test_reference()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(void,
|
||||
boost::io::ostream_joiner<const char*>::reference);
|
||||
BOOST_TEST((boost::core::is_same<void,
|
||||
boost::io::ostream_joiner<const char*>::reference>::value));
|
||||
}
|
||||
|
||||
void test_construct()
|
||||
|
@ -5,8 +5,8 @@ Copyright 2019 Glen Joseph Fernandes
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/io/ostream_put.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
|
Reference in New Issue
Block a user