added (maybe) missed header
This commit is contained in:
parent
7c854c8c3e
commit
2838f6e239
@ -1,9 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <ciso646>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -12,6 +8,10 @@
|
|||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include "emitter.hpp"
|
#include "emitter.hpp"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <ciso646>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace uvw {
|
namespace uvw {
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <uvw.hpp>
|
#include <uvw.hpp>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
TEST(FileReq, OpenAndClose) {
|
TEST(FileReq, OpenAndClose) {
|
||||||
const std::string filename = std::string{TARGET_FS_DIR} + std::string{"/test.fs"};
|
const std::string filename = std::string{TARGET_FS_DIR} + std::string{"/test.fs"};
|
||||||
@ -22,13 +26,11 @@ TEST(FileReq, OpenAndClose) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
auto flags = _O_RDWR | _O_CREAT;
|
request->open(filename, _O_RDWR | _O_CREAT, 0644);
|
||||||
#else
|
#else
|
||||||
auto flags = O_RDWR | O_CREAT;
|
request->open(filename, O_RDWR | O_CREAT, 0644);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
request->open(filename, flags, 0644);
|
|
||||||
|
|
||||||
loop->run();
|
loop->run();
|
||||||
|
|
||||||
ASSERT_FALSE(checkErrorEvent);
|
ASSERT_FALSE(checkErrorEvent);
|
||||||
@ -43,12 +45,11 @@ TEST(FileReq, OpenAndCloseSync) {
|
|||||||
auto request = loop->resource<uvw::FileReq>();
|
auto request = loop->resource<uvw::FileReq>();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
auto flags = _O_RDWR | _O_CREAT;
|
ASSERT_TRUE(request->openSync(filename, _O_RDWR | _O_CREAT, 0644));
|
||||||
#else
|
#else
|
||||||
auto flags = O_RDWR | O_CREAT;
|
ASSERT_TRUE(request->openSync(filename, O_RDWR | O_CREAT, 0644));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ASSERT_TRUE(request->openSync(filename, flags, 0644));
|
|
||||||
ASSERT_TRUE(request->closeSync());
|
ASSERT_TRUE(request->closeSync());
|
||||||
|
|
||||||
loop->run();
|
loop->run();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user