2019-01-30 21:28:50 +00:00
|
|
|
#include <gtest/gtest.h>
|
2019-02-09 02:08:02 +00:00
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2020-06-28 13:51:34 +00:00
|
|
|
#include "webfuse/server.h"
|
|
|
|
#include "webfuse/server_config.h"
|
2019-02-09 02:08:02 +00:00
|
|
|
|
2020-03-21 08:11:18 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
struct wf_mountpoint *
|
|
|
|
create_mountpoint(
|
|
|
|
char const * filesystem,
|
|
|
|
void * user_data)
|
|
|
|
{
|
|
|
|
(void) filesystem;
|
|
|
|
(void) user_data;
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2019-01-30 21:28:50 +00:00
|
|
|
|
|
|
|
TEST(server, create_dispose)
|
|
|
|
{
|
2019-02-09 02:08:02 +00:00
|
|
|
mkdir("test", 0700);
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
struct wf_server_config * config = wf_server_config_create();
|
2020-03-21 08:11:18 +00:00
|
|
|
wf_server_config_set_mountpoint_factory(config, &create_mountpoint, nullptr);
|
2019-03-26 22:04:53 +00:00
|
|
|
struct wf_server * server = wf_server_create(config);
|
2019-01-30 21:28:50 +00:00
|
|
|
ASSERT_NE(nullptr, server);
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
wf_server_dispose(server);
|
|
|
|
wf_server_config_dispose(config);
|
2019-02-09 02:08:02 +00:00
|
|
|
|
|
|
|
rmdir("test");
|
2019-01-30 21:28:50 +00:00
|
|
|
}
|