Roger Tawa | c0a1b9c | 2021-09-23 23:34:04 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "components/winhttp/net_util.h" |
| 6 | #include "testing/gtest/include/gtest/gtest.h" |
| 7 | |
| 8 | namespace winhttp { |
| 9 | |
| 10 | TEST(WinHttpUtil, HRESULTFromLastError) { |
| 11 | ::SetLastError(ERROR_ACCESS_DENIED); |
| 12 | EXPECT_EQ(E_ACCESSDENIED, HRESULTFromLastError()); |
| 13 | ::SetLastError(ERROR_SUCCESS); |
| 14 | EXPECT_EQ(E_FAIL, HRESULTFromLastError()); |
| 15 | } |
| 16 | |
| 17 | } // namespace winhttp |