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
f3c6efd8
Commit
f3c6efd8
authored
Mar 25, 2009
by
zhanyong.wan
Browse files
Makes gtest compile without warning with gcc 4.0.3 and -Wall -Wextra.
parent
2c0fc6d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
include/gtest/internal/gtest-param-util.h
include/gtest/internal/gtest-param-util.h
+2
-2
make/Makefile
make/Makefile
+1
-1
src/gtest-death-test.cc
src/gtest-death-test.cc
+1
-1
src/gtest-filepath.cc
src/gtest-filepath.cc
+7
-6
No files found.
include/gtest/internal/gtest-param-util.h
View file @
f3c6efd8
...
...
@@ -483,8 +483,8 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
// about a generator.
int
AddTestCaseInstantiation
(
const
char
*
instantiation_name
,
GeneratorCreationFunc
*
func
,
const
char
*
file
,
int
line
)
{
const
char
*
/*
file
*/
,
int
/*
line
*/
)
{
instantiations_
.
push_back
(
::
std
::
make_pair
(
instantiation_name
,
func
));
return
0
;
// Return value used only to run this method in namespace scope.
}
...
...
make/Makefile
View file @
f3c6efd8
...
...
@@ -23,7 +23,7 @@ USER_DIR = ../samples
CPPFLAGS
+=
-I
$(GTEST_DIR)
-I
$(GTEST_DIR)
/include
# Flags passed to the C++ compiler.
CXXFLAGS
+=
-g
CXXFLAGS
+=
-g
-Wall
-Wextra
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
...
...
src/gtest-death-test.cc
View file @
f3c6efd8
...
...
@@ -945,7 +945,7 @@ bool StackGrowsDown() {
// wrong.
static
pid_t
ExecDeathTestFork
(
char
*
const
*
argv
,
int
close_fd
)
{
ExecDeathTestArgs
args
=
{
argv
,
close_fd
};
pid_t
child_pid
;
pid_t
child_pid
=
-
1
;
#if GTEST_HAS_CLONE
const
bool
use_fork
=
GTEST_FLAG
(
death_test_use_fork
);
...
...
src/gtest-filepath.cc
View file @
f3c6efd8
...
...
@@ -33,6 +33,7 @@
#include <gtest/internal/gtest-port.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32_WCE
#include <windows.h>
...
...
@@ -166,20 +167,19 @@ FilePath FilePath::ConcatPaths(const FilePath& directory,
// Returns true if pathname describes something findable in the file-system,
// either a file, directory, or whatever.
bool
FilePath
::
FileOrDirectoryExists
()
const
{
#if GTEST_OS_WINDOWS
#ifdef _WIN32_WCE
LPCWSTR
unicode
=
String
::
AnsiToUtf16
(
pathname_
.
c_str
());
const
DWORD
attributes
=
GetFileAttributes
(
unicode
);
delete
[]
unicode
;
return
attributes
!=
kInvalidFileAttributes
;
#el
se
#el
if GTEST_OS_WINDOWS
struct
_stat
file_stat
=
{};
return
_stat
(
pathname_
.
c_str
(),
&
file_stat
)
==
0
;
#endif // _WIN32_WCE
#else
struct
stat
file_stat
=
{};
struct
stat
file_stat
;
memset
(
&
file_stat
,
0
,
sizeof
(
file_stat
));
return
stat
(
pathname_
.
c_str
(),
&
file_stat
)
==
0
;
#endif //
GTEST_OS_WINDOWS
#endif //
_WIN32_WCE
}
// Returns true if pathname describes a directory in the file-system
...
...
@@ -205,7 +205,8 @@ bool FilePath::DirectoryExists() const {
(
_S_IFDIR
&
file_stat
.
st_mode
)
!=
0
;
#endif // _WIN32_WCE
#else
struct
stat
file_stat
=
{};
struct
stat
file_stat
;
memset
(
&
file_stat
,
0
,
sizeof
(
file_stat
));
result
=
stat
(
pathname_
.
c_str
(),
&
file_stat
)
==
0
&&
S_ISDIR
(
file_stat
.
st_mode
);
#endif // GTEST_OS_WINDOWS
...
...
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