mirror of
https://github.com/falk-werner/webfuse
synced 2024-10-27 20:34:10 +00:00
39 lines
756 B
C++
39 lines
756 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <cstdlib>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
|
|
#include "webfuse/adapter/server.h"
|
|
#include "webfuse/adapter/server_config.h"
|
|
|
|
namespace
|
|
{
|
|
struct wf_mountpoint *
|
|
create_mountpoint(
|
|
char const * filesystem,
|
|
void * user_data)
|
|
{
|
|
(void) filesystem;
|
|
(void) user_data;
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
}
|
|
|
|
TEST(server, create_dispose)
|
|
{
|
|
mkdir("test", 0700);
|
|
|
|
struct wf_server_config * config = wf_server_config_create();
|
|
wf_server_config_set_mountpoint_factory(config, &create_mountpoint, nullptr);
|
|
struct wf_server * server = wf_server_create(config);
|
|
ASSERT_NE(nullptr, server);
|
|
|
|
wf_server_dispose(server);
|
|
wf_server_config_dispose(config);
|
|
|
|
rmdir("test");
|
|
} |