Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
d21c142e
Commit
d21c142e
authored
Apr 07, 2010
by
vladlosev
Browse files
C++ Builder compatibility patch by Josh Kelley.
parent
1e908873
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
25 deletions
+38
-25
codegear/gtest.groupproj
codegear/gtest.groupproj
+12
-12
codegear/gtest_unittest.cbproj
codegear/gtest_unittest.cbproj
+8
-8
include/gtest/internal/gtest-string.h
include/gtest/internal/gtest-string.h
+5
-0
test/gtest_unittest.cc
test/gtest_unittest.cc
+13
-5
No files found.
codegear/gtest.groupproj
View file @
d21c142e
...
@@ -23,15 +23,6 @@
...
@@ -23,15 +23,6 @@
<Target Name="gtest:Make">
<Target Name="gtest:Make">
<MSBuild Projects="gtest.cbproj" Targets="Make" />
<MSBuild Projects="gtest.cbproj" Targets="Make" />
</Target>
</Target>
<Target Name="gtest_unittest">
<MSBuild Projects="gtest_unittest.cbproj" Targets="" />
</Target>
<Target Name="gtest_unittest:Clean">
<MSBuild Projects="gtest_unittest.cbproj" Targets="Clean" />
</Target>
<Target Name="gtest_unittest:Make">
<MSBuild Projects="gtest_unittest.cbproj" Targets="Make" />
</Target>
<Target Name="gtest_main">
<Target Name="gtest_main">
<MSBuild Projects="gtest_main.cbproj" Targets="" />
<MSBuild Projects="gtest_main.cbproj" Targets="" />
</Target>
</Target>
...
@@ -41,14 +32,23 @@
...
@@ -41,14 +32,23 @@
<Target Name="gtest_main:Make">
<Target Name="gtest_main:Make">
<MSBuild Projects="gtest_main.cbproj" Targets="Make" />
<MSBuild Projects="gtest_main.cbproj" Targets="Make" />
</Target>
</Target>
<Target Name="gtest_unittest">
<MSBuild Projects="gtest_unittest.cbproj" Targets="" />
</Target>
<Target Name="gtest_unittest:Clean">
<MSBuild Projects="gtest_unittest.cbproj" Targets="Clean" />
</Target>
<Target Name="gtest_unittest:Make">
<MSBuild Projects="gtest_unittest.cbproj" Targets="Make" />
</Target>
<Target Name="Build">
<Target Name="Build">
<CallTarget Targets="gtest;gtest_
unittest;gtest_main
" />
<CallTarget Targets="gtest;gtest_
main;gtest_unittest
" />
</Target>
</Target>
<Target Name="Clean">
<Target Name="Clean">
<CallTarget Targets="gtest:Clean;gtest_
unittest
:Clean;gtest_
main
:Clean" />
<CallTarget Targets="gtest:Clean;gtest_
main
:Clean;gtest_
unittest
:Clean" />
</Target>
</Target>
<Target Name="Make">
<Target Name="Make">
<CallTarget Targets="gtest:Make;gtest_
unittest
:Make;gtest_
main
:Make" />
<CallTarget Targets="gtest:Make;gtest_
main
:Make;gtest_
unittest
:Make" />
</Target>
</Target>
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
</Project>
</Project>
\ No newline at end of file
codegear/gtest_unittest.cbproj
View file @
d21c142e
...
@@ -18,27 +18,27 @@
...
@@ -18,27 +18,27 @@
<CfgParent>
Base
</CfgParent>
<CfgParent>
Base
</CfgParent>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Base)'!=''"
>
<PropertyGroup
Condition=
"'$(Base)'!=''"
>
<BCC_OptimizeForSpeed>
true
</BCC_OptimizeForSpeed>
<OutputExt>
exe
</OutputExt>
<OutputExt>
exe
</OutputExt>
<
D
CC_
CBuilderOutput>
JPHNE
</
D
CC_
CBuilderOutput
>
<
B
CC_
OptimizeForSpeed>
true
</
B
CC_
OptimizeForSpeed
>
<Defines>
NO_STRICT
</Defines>
<Defines>
NO_STRICT
</Defines>
<DCC_CBuilderOutput>
JPHNE
</DCC_CBuilderOutput>
<DynamicRTL>
true
</DynamicRTL>
<DynamicRTL>
true
</DynamicRTL>
<UsePackages>
true
</UsePackages>
<ILINK_ObjectSearchPath>
..\test
</ILINK_ObjectSearchPath>
<ILINK_ObjectSearchPath>
..\test
</ILINK_ObjectSearchPath>
<
NoVCL>
true
</NoVCL
>
<
UsePackages>
true
</UsePackages
>
<ProjectType>
CppConsoleApplication
</ProjectType>
<ProjectType>
CppConsoleApplication
</ProjectType>
<NoVCL>
true
</NoVCL>
<BCC_CPPCompileAlways>
true
</BCC_CPPCompileAlways>
<BCC_CPPCompileAlways>
true
</BCC_CPPCompileAlways>
<PackageImports>
rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;
dclZipForged11.bpi;vclZipForged11.bpi;
Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi
</PackageImports>
<PackageImports>
rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi
</PackageImports>
<BCC_wpar>
false
</BCC_wpar>
<BCC_wpar>
false
</BCC_wpar>
<IncludePath>
$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test;..
</IncludePath>
<IncludePath>
$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test;..
</IncludePath>
<ILINK_LibraryPath>
$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test
</ILINK_LibraryPath>
<ILINK_LibraryPath>
$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test
</ILINK_LibraryPath>
<Multithreaded>
true
</Multithreaded>
<Multithreaded>
true
</Multithreaded>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Cfg_1)'!=''"
>
<PropertyGroup
Condition=
"'$(Cfg_1)'!=''"
>
<DCC_Optimize>
false
</DCC_Optimize>
<BCC_OptimizeForSpeed>
false
</BCC_OptimizeForSpeed>
<BCC_OptimizeForSpeed>
false
</BCC_OptimizeForSpeed>
<D
efines>
_DEBUG;$(Defines)
</Defines
>
<D
CC_Optimize>
false
</DCC_Optimize
>
<DCC_DebugInfoInExe>
true
</DCC_DebugInfoInExe>
<DCC_DebugInfoInExe>
true
</DCC_DebugInfoInExe>
<Defines>
_DEBUG;$(Defines)
</Defines>
<ILINK_FullDebugInfo>
true
</ILINK_FullDebugInfo>
<ILINK_FullDebugInfo>
true
</ILINK_FullDebugInfo>
<BCC_InlineFunctionExpansion>
false
</BCC_InlineFunctionExpansion>
<BCC_InlineFunctionExpansion>
false
</BCC_InlineFunctionExpansion>
<ILINK_DisableIncrementalLinking>
true
</ILINK_DisableIncrementalLinking>
<ILINK_DisableIncrementalLinking>
true
</ILINK_DisableIncrementalLinking>
...
@@ -48,8 +48,8 @@
...
@@ -48,8 +48,8 @@
<IntermediateOutputDir>
Debug
</IntermediateOutputDir>
<IntermediateOutputDir>
Debug
</IntermediateOutputDir>
<TASM_DisplaySourceLines>
true
</TASM_DisplaySourceLines>
<TASM_DisplaySourceLines>
true
</TASM_DisplaySourceLines>
<BCC_StackFrames>
true
</BCC_StackFrames>
<BCC_StackFrames>
true
</BCC_StackFrames>
<ILINK_LibraryPath>
$(BDS)\lib\debug;$(ILINK_LibraryPath)
</ILINK_LibraryPath>
<BCC_DisableOptimizations>
true
</BCC_DisableOptimizations>
<BCC_DisableOptimizations>
true
</BCC_DisableOptimizations>
<ILINK_LibraryPath>
$(BDS)\lib\debug;$(ILINK_LibraryPath)
</ILINK_LibraryPath>
<TASM_Debugging>
Full
</TASM_Debugging>
<TASM_Debugging>
Full
</TASM_Debugging>
<BCC_SourceDebuggingOn>
true
</BCC_SourceDebuggingOn>
<BCC_SourceDebuggingOn>
true
</BCC_SourceDebuggingOn>
</PropertyGroup>
</PropertyGroup>
...
...
include/gtest/internal/gtest-string.h
View file @
d21c142e
...
@@ -41,6 +41,11 @@
...
@@ -41,6 +41,11 @@
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
#ifdef __BORLANDC__
// string.h is not guaranteed to provide strcpy on C++ Builder.
#include <mem.h>
#endif
#include <string.h>
#include <string.h>
#include <gtest/internal/gtest-port.h>
#include <gtest/internal/gtest-port.h>
...
...
test/gtest_unittest.cc
View file @
d21c142e
...
@@ -323,7 +323,7 @@ TEST(NullLiteralTest, IsFalseForNonNullLiterals) {
...
@@ -323,7 +323,7 @@ TEST(NullLiteralTest, IsFalseForNonNullLiterals) {
}
}
#ifdef __BORLANDC__
#ifdef __BORLANDC__
// Restores warnings after previous "#pragma option push" supressed them
// Restores warnings after previous "#pragma option push" sup
p
ressed them
.
#pragma option pop
#pragma option pop
#endif
#endif
...
@@ -1353,7 +1353,7 @@ void DoesNotAbortHelper(bool* aborted) {
...
@@ -1353,7 +1353,7 @@ void DoesNotAbortHelper(bool* aborted) {
}
}
#ifdef __BORLANDC__
#ifdef __BORLANDC__
// Restores warnings after previous "#pragma option push" supressed them
// Restores warnings after previous "#pragma option push" sup
p
ressed them
.
#pragma option pop
#pragma option pop
#endif
#endif
...
@@ -1371,7 +1371,7 @@ static int global_var = 0;
...
@@ -1371,7 +1371,7 @@ static int global_var = 0;
#define GTEST_USE_UNPROTECTED_COMMA_ global_var++, global_var++
#define GTEST_USE_UNPROTECTED_COMMA_ global_var++, global_var++
TEST_F
(
ExpectFatalFailureTest
,
AcceptsMacroThatExpandsToUnprotectedComma
)
{
TEST_F
(
ExpectFatalFailureTest
,
AcceptsMacroThatExpandsToUnprotectedComma
)
{
#if
n
def __BORLANDC__
#if
!
def
ined(__BORLANDC__) ||
__BORLANDC__
>= 0x600
// ICE's in C++Builder 2007.
// ICE's in C++Builder 2007.
EXPECT_FATAL_FAILURE
({
EXPECT_FATAL_FAILURE
({
GTEST_USE_UNPROTECTED_COMMA_
;
GTEST_USE_UNPROTECTED_COMMA_
;
...
@@ -3490,10 +3490,13 @@ TEST(AssertionTest, ASSERT_TRUE) {
...
@@ -3490,10 +3490,13 @@ TEST(AssertionTest, ASSERT_TRUE) {
// Tests ASSERT_TRUE(predicate) for predicates returning AssertionResult.
// Tests ASSERT_TRUE(predicate) for predicates returning AssertionResult.
TEST
(
AssertionTest
,
AssertTrueWithAssertionResult
)
{
TEST
(
AssertionTest
,
AssertTrueWithAssertionResult
)
{
ASSERT_TRUE
(
ResultIsEven
(
2
));
ASSERT_TRUE
(
ResultIsEven
(
2
));
#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x600
// ICE's in C++Builder 2007.
EXPECT_FATAL_FAILURE
(
ASSERT_TRUE
(
ResultIsEven
(
3
)),
EXPECT_FATAL_FAILURE
(
ASSERT_TRUE
(
ResultIsEven
(
3
)),
"Value of: ResultIsEven(3)
\n
"
"Value of: ResultIsEven(3)
\n
"
" Actual: false (3 is odd)
\n
"
" Actual: false (3 is odd)
\n
"
"Expected: true"
);
"Expected: true"
);
#endif
ASSERT_TRUE
(
ResultIsEvenNoExplanation
(
2
));
ASSERT_TRUE
(
ResultIsEvenNoExplanation
(
2
));
EXPECT_FATAL_FAILURE
(
ASSERT_TRUE
(
ResultIsEvenNoExplanation
(
3
)),
EXPECT_FATAL_FAILURE
(
ASSERT_TRUE
(
ResultIsEvenNoExplanation
(
3
)),
"Value of: ResultIsEvenNoExplanation(3)
\n
"
"Value of: ResultIsEvenNoExplanation(3)
\n
"
...
@@ -3513,10 +3516,13 @@ TEST(AssertionTest, ASSERT_FALSE) {
...
@@ -3513,10 +3516,13 @@ TEST(AssertionTest, ASSERT_FALSE) {
// Tests ASSERT_FALSE(predicate) for predicates returning AssertionResult.
// Tests ASSERT_FALSE(predicate) for predicates returning AssertionResult.
TEST
(
AssertionTest
,
AssertFalseWithAssertionResult
)
{
TEST
(
AssertionTest
,
AssertFalseWithAssertionResult
)
{
ASSERT_FALSE
(
ResultIsEven
(
3
));
ASSERT_FALSE
(
ResultIsEven
(
3
));
#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x600
// ICE's in C++Builder 2007.
EXPECT_FATAL_FAILURE
(
ASSERT_FALSE
(
ResultIsEven
(
2
)),
EXPECT_FATAL_FAILURE
(
ASSERT_FALSE
(
ResultIsEven
(
2
)),
"Value of: ResultIsEven(2)
\n
"
"Value of: ResultIsEven(2)
\n
"
" Actual: true (2 is even)
\n
"
" Actual: true (2 is even)
\n
"
"Expected: false"
);
"Expected: false"
);
#endif
ASSERT_FALSE
(
ResultIsEvenNoExplanation
(
3
));
ASSERT_FALSE
(
ResultIsEvenNoExplanation
(
3
));
EXPECT_FATAL_FAILURE
(
ASSERT_FALSE
(
ResultIsEvenNoExplanation
(
2
)),
EXPECT_FATAL_FAILURE
(
ASSERT_FALSE
(
ResultIsEvenNoExplanation
(
2
)),
"Value of: ResultIsEvenNoExplanation(2)
\n
"
"Value of: ResultIsEvenNoExplanation(2)
\n
"
...
@@ -3628,13 +3634,15 @@ void ThrowNothing() {}
...
@@ -3628,13 +3634,15 @@ void ThrowNothing() {}
// Tests ASSERT_THROW.
// Tests ASSERT_THROW.
TEST
(
AssertionTest
,
ASSERT_THROW
)
{
TEST
(
AssertionTest
,
ASSERT_THROW
)
{
ASSERT_THROW
(
ThrowAnInteger
(),
int
);
ASSERT_THROW
(
ThrowAnInteger
(),
int
);
#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x600 || defined(_DEBUG)
// ICE's in C++Builder 2007 (Release build).
#ifndef __BORLANDC__
// ICE's in C++Builder 2007 and 2009.
EXPECT_FATAL_FAILURE
(
EXPECT_FATAL_FAILURE
(
ASSERT_THROW
(
ThrowAnInteger
(),
bool
),
ASSERT_THROW
(
ThrowAnInteger
(),
bool
),
"Expected: ThrowAnInteger() throws an exception of type bool.
\n
"
"Expected: ThrowAnInteger() throws an exception of type bool.
\n
"
" Actual: it throws a different type."
);
" Actual: it throws a different type."
);
#endif
#endif
EXPECT_FATAL_FAILURE
(
EXPECT_FATAL_FAILURE
(
ASSERT_THROW
(
ThrowNothing
(),
bool
),
ASSERT_THROW
(
ThrowNothing
(),
bool
),
"Expected: ThrowNothing() throws an exception of type bool.
\n
"
"Expected: ThrowNothing() throws an exception of type bool.
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment