diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-14 01:57:40 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-14 01:57:40 +0300 |
commit | 0e439fb2d229808a8d879bfefcf371099b522479 (patch) | |
tree | f2fc08d91f11cfae1dbd618be317b8d041f48903 /test/handle.cpp | |
parent | initial commit (diff) | |
download | winapi-common-0e439fb2d229808a8d879bfefcf371099b522479.tar.gz winapi-common-0e439fb2d229808a8d879bfefcf371099b522479.zip |
add Handle class
It's derived from various projects of mine.
Diffstat (limited to 'test/handle.cpp')
-rw-r--r-- | test/handle.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/handle.cpp b/test/handle.cpp new file mode 100644 index 0000000..32b5bc1 --- /dev/null +++ b/test/handle.cpp @@ -0,0 +1,25 @@ +// 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/handle.hpp> + +#include <boost/test/unit_test.hpp> + +#include <windows.h> + +BOOST_AUTO_TEST_SUITE(handle_tests) + +BOOST_AUTO_TEST_CASE(null) { + { + winapi::Handle h{NULL}; + } + BOOST_TEST(true, "NULL handle closed successfully"); + { + winapi::Handle h{INVALID_HANDLE_VALUE}; + } + BOOST_TEST(true, "INVALID_HANDLE_VALUE handle closed successfully"); +} + +BOOST_AUTO_TEST_SUITE_END() |