win: Partial fixes for client_test after CrashReportDatabase added

- Dependency on compat required for sys/types.h inclusion for ssize_t.
- Test impl of stat to avoid #error
- FileHandle isn't int on Windows.

client_test no longer links though, as it's still lacking an
implementation of CrashReportDatabase of course.

R=rsesek@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/875043004
This commit is contained in:
Scott Graham 2015-01-26 13:56:20 -08:00
parent 7c9bd944ae
commit 7cd1639990
2 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,7 @@
'target_name': 'client',
'type': 'static_library',
'dependencies': [
'../compat/compat.gyp:compat',
'../third_party/mini_chromium/mini_chromium/base/base.gyp:base',
'../util/util.gyp:util',
],
@ -46,6 +47,7 @@
'type': 'executable',
'dependencies': [
'client',
'../compat/compat.gyp:compat',
'../third_party/gtest/gtest.gyp:gtest',
'../third_party/gtest/gtest.gyp:gtest_main',
'../third_party/mini_chromium/mini_chromium/base/base.gyp:base',

View File

@ -28,6 +28,9 @@ bool FileExistsAtPath(const base::FilePath& path) {
#if defined(OS_POSIX)
struct stat st;
return lstat(path.value().c_str(), &st) == 0;
#elif defined(OS_WIN)
struct _stat st;
return _wstat(path.value().c_str(), &st);
#else
#error "Not implemented"
#endif
@ -37,7 +40,11 @@ void CreateFile(const base::FilePath& path) {
FileHandle handle = LoggingOpenFileForWrite(path,
FileWriteMode::kCreateOrFail,
FilePermissions::kWorldReadable);
#if defined(OS_POSIX)
ASSERT_GE(handle, 0);
#elif defined(OS_WIN)
ASSERT_NE(handle, nullptr);
#endif
ASSERT_TRUE(
LoggingWriteFile(handle, path.value().c_str(), path.value().length()));
ASSERT_TRUE(LoggingCloseFile(handle));