1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/test-src/webfuse/filesystem/test_userid.cpp

28 lines
409 B
C++
Raw Normal View History

2022-11-13 13:17:47 +00:00
#include "webfuse/filesystem/userid.hpp"
#include <gtest/gtest.h>
using webfuse::user_id;
TEST(user_id, invalid)
{
user_id invalid_user;
ASSERT_EQ(user_id::invalid, invalid_user);
}
TEST(user_id, to_uid)
{
user_id user(42);
uid_t id = user.to_uid();
ASSERT_EQ(42, id);
}
TEST(user_id, from_uid)
{
uid_t id = 23;
auto user = user_id::from_uid(id);
ASSERT_EQ(23, user);
}