You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
falk-werner_webfuse/test-src/unit/webfuse/filesystem/test_openflags.cpp

25 lines
677 B

#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
)
);