Ticket #12629: bug.cpp

File bug.cpp, 758 bytes (added by Michael Chadwick <josephholyheart@…>, 6 years ago)

bug.cpp file as requested by filesystem maintainers in filesystem bug report docs

Line 
1// filesystem/bug/bug.cpp
2
3#include <boost/detail/lightweight_test_report.hpp>
4#include <boost/filesystem.hpp>
5
6#include <windows.h> //for GetTempPath from Windows
7
8namespace fs = boost::filesystem;
9
10int test_main(int, char*[]) // note name
11{
12 std::basic_string<wchar_t> temp_path(262, '\0');
13 GetTempPathW(temp_path.size(), &temp_path.front());
14
15 const auto boost_temp_path = fs::temp_directory_path();
16
17 BOOST_TEST(temp_path == boost_temp_path.native());
18 BOOST_TEST(fs::exists(boost_temp_path));
19 BOOST_TEST(fs::is_directory(boost_temp_path));
20
21 return ::boost::report_errors(); // required
22}
23
24// Copyright Beman Dawes 2014
25// Distributed under the Boost Software License, Version 1.0.
26// www.boost.org/LICENSE_1_0.txt