aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/unit_tests/handle.cpp
blob: 4f642ab777611a83cb8da2a097fb28b86a71fd16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2020 Egor Tensin <egor@tensin.name>
// 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};
        h.close();
        BOOST_TEST(true, "NULL handle closed successfully");
    }
    {
        winapi::Handle h{INVALID_HANDLE_VALUE};
        h.close();
        BOOST_TEST(true, "INVALID_HANDLE_VALUE handle closed successfully");
    }
}

BOOST_AUTO_TEST_SUITE_END()