diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-30 00:04:34 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-30 00:04:34 +0000 |
commit | 3570a68f27c4d69748e5da2d4e6332e0482c24a2 (patch) | |
tree | 3bf2a1e43ad07b7ad969704102014bd7e47f06e7 /chrome/common | |
parent | 4522cfd1ec9feba623eee66116e2aeda4081198e (diff) | |
download | chromium_src-3570a68f27c4d69748e5da2d4e6332e0482c24a2.zip chromium_src-3570a68f27c4d69748e5da2d4e6332e0482c24a2.tar.gz chromium_src-3570a68f27c4d69748e5da2d4e6332e0482c24a2.tar.bz2 |
Fix the order when setting the last error code. On XP, it was reset by the GetProcAddress() call.
TBR=nsylvain
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/win_util_unittest.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/common/win_util_unittest.cc b/chrome/common/win_util_unittest.cc index 7da5fa1..8df32e1 100644 --- a/chrome/common/win_util_unittest.cc +++ b/chrome/common/win_util_unittest.cc @@ -44,13 +44,14 @@ class WinUtilTest: public testing::Test { TEST_F(WinUtilTest, FormatMessage) { + unsigned language = GetSystemLanguage(); + ASSERT_TRUE(language); + const int kAccessDeniedErrorCode = 5; SetLastError(kAccessDeniedErrorCode); ASSERT_EQ(GetLastError(), kAccessDeniedErrorCode); std::wstring value; - unsigned language = GetSystemLanguage(); - ASSERT_TRUE(language); if (language == LANG_ENGLISH) { // This test would fail on non-English system. TrimWhitespace(win_util::FormatLastWin32Error(), TRIM_ALL, &value); |