// // Copyright (c) 2020 Alexander Grund // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include #include #include "test.hpp" #include #include #ifdef __has_include #if __has_include() #include #endif #endif #ifdef __cpp_lib_string_view #include #define BOOST_NOWIDE_TEST_STD_STRINGVIEW #endif // Exclude apple as support there is target level specific -.- #if defined(__cpp_lib_filesystem) && !defined(__APPLE__) #include #define BOOST_NOWIDE_TEST_SFS_PATH #endif #ifdef BOOST_NOWIDE_TEST_BFS_PATH #include #endif using boost::nowide::detail::is_string_container; static_assert(is_string_container::value, "!"); static_assert(is_string_container::value, "!"); static_assert(is_string_container::value, "!"); static_assert(is_string_container::value, "!"); static_assert(!is_string_container::value, "!"); static_assert(!is_string_container::value, "!"); using boost::nowide::detail::get_data_width; static_assert(get_data_width::value == sizeof(char), "!"); static_assert(get_data_width::value == sizeof(wchar_t), "!"); static_assert(get_data_width::value == sizeof(char16_t), "!"); static_assert(get_data_width::value == sizeof(char32_t), "!"); void test_main(int, char**, char**) { #ifdef BOOST_NOWIDE_TEST_STD_STRINGVIEW std::cout << "Testing string_view" << std::endl; static_assert(is_string_container::value, "!"); static_assert(is_string_container::value, "!"); static_assert(is_string_container::value, "!"); static_assert(is_string_container::value, "!"); #endif #ifdef BOOST_NOWIDE_TEST_SFS_PATH std::cout << "Testing std::filesystem::path" << std::endl; static_assert(boost::nowide::detail::is_path::value, "!"); #endif #ifdef BOOST_NOWIDE_TEST_BFS_PATH std::cout << "Testing boost::filesystem::path" << std::endl; static_assert(boost::nowide::detail::is_path::value, "!"); #endif }