aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/unit_tests/error.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-15 01:10:15 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-15 01:10:15 +0300
commit933654fbae37b3726cfa449d187759fe06f8fcc7 (patch)
tree8d961c269665d77a814a8e2cbbd415997b3d2897 /test/unit_tests/error.cpp
parentcmd_line.cpp: move implementation from cmd_line.hpp (diff)
downloadwinapi-common-933654fbae37b3726cfa449d187759fe06f8fcc7.tar.gz
winapi-common-933654fbae37b3726cfa449d187759fe06f8fcc7.zip
test/ -> test/unit_tests/
Diffstat (limited to 'test/unit_tests/error.cpp')
-rw-r--r--test/unit_tests/error.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit_tests/error.cpp b/test/unit_tests/error.cpp
new file mode 100644
index 0000000..f70d95d
--- /dev/null
+++ b/test/unit_tests/error.cpp
@@ -0,0 +1,23 @@
+// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
+// This file is part of the "winapi-common" project.
+// For details, see https://github.com/egor-tensin/winapi-common.
+// Distributed under the MIT License.
+
+#include <winapi/error.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <windows.h>
+
+#include <string>
+
+BOOST_AUTO_TEST_SUITE(error_tests)
+
+BOOST_AUTO_TEST_CASE(file_not_found) {
+ const std::string actual{winapi::error::windows(ERROR_FILE_NOT_FOUND, "CreateFileW").what()};
+ BOOST_TEST(actual ==
+ "Function CreateFileW failed with error code 2: The system cannot find the file "
+ "specified.");
+}
+
+BOOST_AUTO_TEST_SUITE_END()