blob: 297a97f46a45bfeea1685d24b56afac429d811fb [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/winhttp/net_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace winhttp {
TEST(WinHttpUtil, HRESULTFromLastError) {
::SetLastError(ERROR_ACCESS_DENIED);
EXPECT_EQ(E_ACCESSDENIED, HRESULTFromLastError());
::SetLastError(ERROR_SUCCESS);
EXPECT_EQ(E_FAIL, HRESULTFromLastError());
}
} // namespace winhttp