added (maybe) missed header

This commit is contained in:
Michele Caini 2016-11-07 11:03:31 +01:00
parent 7c854c8c3e
commit 2838f6e239
2 changed files with 12 additions and 11 deletions

View File

@ -1,9 +1,5 @@
#pragma once
#ifdef _WIN32
#include <ciso646>
#endif
#include <new>
#include <memory>
#include <utility>
@ -12,6 +8,10 @@
#include <uv.h>
#include "emitter.hpp"
#ifdef _WIN32
#include <ciso646>
#endif
namespace uvw {

View File

@ -1,6 +1,10 @@
#include <gtest/gtest.h>
#include <uvw.hpp>
#ifdef _WIN32
#include <fcntl.h>
#endif
TEST(FileReq, OpenAndClose) {
const std::string filename = std::string{TARGET_FS_DIR} + std::string{"/test.fs"};
@ -22,13 +26,11 @@ TEST(FileReq, OpenAndClose) {
});
#ifdef _WIN32
auto flags = _O_RDWR | _O_CREAT;
request->open(filename, _O_RDWR | _O_CREAT, 0644);
#else
auto flags = O_RDWR | O_CREAT;
request->open(filename, O_RDWR | O_CREAT, 0644);
#endif
request->open(filename, flags, 0644);
loop->run();
ASSERT_FALSE(checkErrorEvent);
@ -43,12 +45,11 @@ TEST(FileReq, OpenAndCloseSync) {
auto request = loop->resource<uvw::FileReq>();
#ifdef _WIN32
auto flags = _O_RDWR | _O_CREAT;
ASSERT_TRUE(request->openSync(filename, _O_RDWR | _O_CREAT, 0644));
#else
auto flags = O_RDWR | O_CREAT;
ASSERT_TRUE(request->openSync(filename, O_RDWR | O_CREAT, 0644));
#endif
ASSERT_TRUE(request->openSync(filename, flags, 0644));
ASSERT_TRUE(request->closeSync());
loop->run();