diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-06-30 11:16:40 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-06-30 11:16:40 +0300 |
commit | 0bbb5f29806e0b3389c3e109c89161f377bb2263 (patch) | |
tree | f5725211aa27a113fcf39dd71cd9b160677e4420 /test/tests/file_handle_create_close | |
parent | 76ad25a7509c8b16e6073a51733023428969d20e (diff) |
Fixed bad printing of flags, and cause of test failure.
Diffstat (limited to 'test/tests/file_handle_create_close')
-rw-r--r-- | test/tests/file_handle_create_close/runner.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/tests/file_handle_create_close/runner.cpp b/test/tests/file_handle_create_close/runner.cpp index 4f9f6d45..ef85c9f9 100644 --- a/test/tests/file_handle_create_close/runner.cpp +++ b/test/tests/file_handle_create_close/runner.cpp @@ -36,16 +36,23 @@ template <class U> inline void file_handle_create_close_creation(U &&f) { // Initialiser list of output value expected for the input parameters, plus any precondition/postcondition parameters // Does the mode parameter have the expected side effects? - { make_errored_result<void>(ENOENT), { file_handle::mode::none, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, { make_ready_result<void>(), { file_handle::mode::none, file_handle::creation::if_needed, file_handle::flag::none }, { "existing1" }, { "existing1" }}, - { make_errored_result<void>(ENOENT), { file_handle::mode::attr_read, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, { make_ready_result<void>(), { file_handle::mode::attr_read, file_handle::creation::if_needed, file_handle::flag::none }, { "existing1" }, { "existing1" }}, - { make_errored_result<void>(ENOENT), { file_handle::mode::attr_write, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, { make_ready_result<void>(), { file_handle::mode::attr_write, file_handle::creation::if_needed, file_handle::flag::none }, { "existing1" }, { "existing1" }}, { make_ready_result<void>(), { file_handle::mode::write, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "existing0" }}, { make_ready_result<void>(), { file_handle::mode::write, file_handle::creation::if_needed, file_handle::flag::none }, { "existing1" }, { "existing1" }}, { make_ready_result<void>(), { file_handle::mode::append, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "existing0" }}, { make_ready_result<void>(), { file_handle::mode::append, file_handle::creation::if_needed, file_handle::flag::none }, { "existing1" }, { "existing1" }}, +#ifdef _WIN32 + // Interestingly Windows lets you create a new file which has no access at all. Go figure. + { make_ready_result<void>(), { file_handle::mode::none, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "existing0" }}, + { make_ready_result<void>(), { file_handle::mode::attr_read, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "existing0" }}, + { make_ready_result<void>(), { file_handle::mode::attr_write, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "existing0" }}, +#else + { make_errored_result<void>(EACCES), { file_handle::mode::none, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, + { make_errored_result<void>(EACCES), { file_handle::mode::attr_read, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, + { make_errored_result<void>(EACCES), { file_handle::mode::attr_write, file_handle::creation::if_needed, file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, +#endif // Does the creation parameter have the expected side effects? { make_errored_result<void>(ENOENT), { file_handle::mode::write, file_handle::creation::open_existing , file_handle::flag::none }, { "non-existing" }, { "non-existing" }}, |