| 139 | } // unnamed namespace |
| 140 | |
| 141 | int cpp_main(int argc, char*[]) |
| 142 | { |
| 143 | if (argc > 1) cleanup = false; |
| 144 | |
| 145 | std::cout << "BOOST_FILESYSTEM_C_STR defined as \"" |
| 146 | << BOOST_STRINGIZE(BOOST_FILESYSTEM_C_STR) << "\"\n"; |
| 147 | |
| 148 | // test narrow characters |
| 149 | std::cout << "narrow character tests:\n"; |
| 150 | test("narrow_fstream_test"); |
| 151 | |
| 152 | |
| 153 | // So that tests are run with known encoding, use Boost UTF-8 codecvt |
| 154 | std::locale global_loc = std::locale(); |
| 155 | std::locale loc(global_loc, new fs::detail::utf8_codecvt_facet); |
| 156 | fs::path::imbue(loc); |
| 157 | |
| 158 | // test with some wide characters |
| 159 | // \u2780 is circled 1 against white background == e2 9e 80 in UTF-8 |
| 160 | // \u2781 is circled 2 against white background == e2 9e 81 in UTF-8 |
| 161 | // \u263A is a white smiling face |
| 162 | std::cout << "\nwide character tests:\n"; |
| 163 | std::wstring ws(L"wide_fstream_test_"); |
| 164 | ws += 0x2780; |
| 165 | ws += 0x263A; |
| 166 | test(ws); |
| 167 | |
| 168 | return ::boost::report_errors(); |
| 169 | } |