mirror of
https://github.com/falk-werner/webfuse
synced 2026-10-21 20:03:52 +00:00
sepated unit and integration tests
This commit is contained in:
24
test-src/unit/webfuse/filesystem/test_openflags.cpp
Normal file
24
test-src/unit/webfuse/filesystem/test_openflags.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "webfuse/filesystem/openflags.hpp"
|
||||
#include <gtest/gtest.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
using webfuse::openflags;
|
||||
|
||||
class openflags_test: public testing::TestWithParam<int> { };
|
||||
|
||||
TEST_P(openflags_test, conversion)
|
||||
{
|
||||
int const expected = GetParam();
|
||||
auto flags = openflags::from_int(expected);
|
||||
ASSERT_EQ(expected, flags.to_int());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(openflags_values, openflags_test,
|
||||
testing::Values<>(
|
||||
O_RDONLY, O_WRONLY, O_RDWR, O_CLOEXEC, O_CREAT,
|
||||
O_DIRECT, O_DIRECTORY, O_EXCL, O_NOCTTY, O_NOFOLLOW,
|
||||
O_TRUNC, O_ASYNC, O_LARGEFILE, O_NOATIME, O_NONBLOCK,
|
||||
O_NDELAY, O_SYNC,
|
||||
O_WRONLY | O_CREAT | O_TRUNC
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user