Adds suffix 'd' to gtest's libs on Windows. Also fixes gtest_unittest on non-English Windows. By balazs.dan@gmail.com.

This commit is contained in:
shiqian 2008-09-13 00:49:59 +00:00
parent 36865d8d35
commit ee39a89deb
3 changed files with 14 additions and 59 deletions

View File

@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="$(OutDir)/gtest.lib"/> OutputFile="$(OutDir)/gtestd.lib"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool

View File

@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="$(OutDir)/$(ProjectName).lib"/> OutputFile="$(OutDir)/$(ProjectName)d.lib"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool

View File

@ -2720,85 +2720,40 @@ TEST(HRESULTAssertionTest, EXPECT_HRESULT_SUCCEEDED) {
EXPECT_HRESULT_SUCCEEDED(S_OK); EXPECT_HRESULT_SUCCEEDED(S_OK);
EXPECT_HRESULT_SUCCEEDED(S_FALSE); EXPECT_HRESULT_SUCCEEDED(S_FALSE);
#ifdef _WIN32_WCE
const char* expected =
"Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
" Actual: 0x8000FFFF";
#else // Windows proper
const char* expected =
"Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
" Actual: 0x8000FFFF Catastrophic failure";
#endif // _WIN32_WCE
EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()), EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()),
expected); "Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
" Actual: 0x8000FFFF");
} }
TEST(HRESULTAssertionTest, ASSERT_HRESULT_SUCCEEDED) { TEST(HRESULTAssertionTest, ASSERT_HRESULT_SUCCEEDED) {
ASSERT_HRESULT_SUCCEEDED(S_OK); ASSERT_HRESULT_SUCCEEDED(S_OK);
ASSERT_HRESULT_SUCCEEDED(S_FALSE); ASSERT_HRESULT_SUCCEEDED(S_FALSE);
#ifdef _WIN32_WCE
const char* expected =
"Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
" Actual: 0x8000FFFF";
#else // Windows proper
const char* expected =
"Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
" Actual: 0x8000FFFF Catastrophic failure";
#endif // _WIN32_WCE
EXPECT_FATAL_FAILURE(ASSERT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()), EXPECT_FATAL_FAILURE(ASSERT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()),
expected); "Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
" Actual: 0x8000FFFF");
} }
TEST(HRESULTAssertionTest, EXPECT_HRESULT_FAILED) { TEST(HRESULTAssertionTest, EXPECT_HRESULT_FAILED) {
EXPECT_HRESULT_FAILED(E_UNEXPECTED); EXPECT_HRESULT_FAILED(E_UNEXPECTED);
#ifdef _WIN32_WCE
const char* expected_success =
"Expected: (OkHRESULTSuccess()) fails.\n"
" Actual: 0x00000000";
const char* expected_incorrect_function =
"Expected: (FalseHRESULTSuccess()) fails.\n"
" Actual: 0x00000001";
#else // Windows proper
const char* expected_success =
"Expected: (OkHRESULTSuccess()) fails.\n"
" Actual: 0x00000000 The operation completed successfully";
const char* expected_incorrect_function =
"Expected: (FalseHRESULTSuccess()) fails.\n"
" Actual: 0x00000001 Incorrect function.";
#endif // _WIN32_WCE
EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(OkHRESULTSuccess()), EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(OkHRESULTSuccess()),
expected_success); "Expected: (OkHRESULTSuccess()) fails.\n"
" Actual: 0x00000000");
EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(FalseHRESULTSuccess()), EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(FalseHRESULTSuccess()),
expected_incorrect_function); "Expected: (FalseHRESULTSuccess()) fails.\n"
" Actual: 0x00000001");
} }
TEST(HRESULTAssertionTest, ASSERT_HRESULT_FAILED) { TEST(HRESULTAssertionTest, ASSERT_HRESULT_FAILED) {
ASSERT_HRESULT_FAILED(E_UNEXPECTED); ASSERT_HRESULT_FAILED(E_UNEXPECTED);
#ifdef _WIN32_WCE
const char* expected_success =
"Expected: (OkHRESULTSuccess()) fails.\n"
" Actual: 0x00000000";
const char* expected_incorrect_function =
"Expected: (FalseHRESULTSuccess()) fails.\n"
" Actual: 0x00000001";
#else // Windows proper
const char* expected_success =
"Expected: (OkHRESULTSuccess()) fails.\n"
" Actual: 0x00000000 The operation completed successfully";
const char* expected_incorrect_function =
"Expected: (FalseHRESULTSuccess()) fails.\n"
" Actual: 0x00000001 Incorrect function.";
#endif // _WIN32_WCE
EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(OkHRESULTSuccess()), EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(OkHRESULTSuccess()),
expected_success); "Expected: (OkHRESULTSuccess()) fails.\n"
" Actual: 0x00000000");
EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(FalseHRESULTSuccess()), EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(FalseHRESULTSuccess()),
expected_incorrect_function); "Expected: (FalseHRESULTSuccess()) fails.\n"
" Actual: 0x00000001");
} }
// Tests that streaming to the HRESULT macros works. // Tests that streaming to the HRESULT macros works.