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_status.cpp

29 lines
850 B

#include "webfuse/filesystem/status.hpp"
#include <gtest/gtest.h>
#include <errno.h>
using webfuse::status;
class status_test: public testing::TestWithParam<int> { };
TEST_P(status_test, conversion)
{
int const expected = GetParam();
auto status = status::from_fusestatus(expected);
ASSERT_EQ(expected, status.to_fusestatus());
}
INSTANTIATE_TEST_CASE_P(status_values, status_test,
testing::Values(
0, 1, 2, 3, 42,
-E2BIG, -EACCES, -EBADF, -EBUSY, -EDESTADDRREQ,
-EDQUOT, -EEXIST, -EFAULT, -EFBIG, -EINTR,
-EINVAL, -EIO, -EISDIR, -ELOOP, -EMFILE,
-ENAMETOOLONG, -ENFILE, -ENODATA, -ENODEV,
-ENOENT, -ENOMEM, -ENOSPC, -ENOSYS, -ENOTDIR,
-ENOTEMPTY, -ENOTSUP, -ENXIO, -EOVERFLOW, -EPERM,
-EPIPE, -ERANGE, -EROFS, -EXDEV, -EWOULDBLOCK,
-EAGAIN, -12345
)
);