mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
made it single threaded (still buggy)
This commit is contained in:
7
test-src/test_fuse_req.cc
Normal file
7
test-src/test_fuse_req.cc
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "wsfs/fuse_wrapper.h"
|
||||
|
||||
TEST(libfuse, fuse_req_t_size)
|
||||
{
|
||||
ASSERT_EQ(sizeof(void*), sizeof(fuse_req_t));
|
||||
}
|
||||
@@ -2,20 +2,20 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
extern "C" {
|
||||
#include "wsfs/response_parser.h"
|
||||
#include "wsfs/jsonrpc/response.h"
|
||||
}
|
||||
|
||||
static void wsfs_response_parse_str(
|
||||
char const * buffer,
|
||||
struct wsfs_response * response)
|
||||
struct wsfs_jsonrpc_response * response)
|
||||
{
|
||||
size_t length = strlen(buffer);
|
||||
wsfs_response_parse(buffer, length, response);
|
||||
wsfs_jsonrpc_response_init(response, buffer, length);
|
||||
}
|
||||
|
||||
TEST(response_parser, test)
|
||||
{
|
||||
struct wsfs_response response;
|
||||
struct wsfs_jsonrpc_response response;
|
||||
|
||||
// invalid json
|
||||
wsfs_response_parse_str("", &response);
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wsfs/server.h"
|
||||
#include "wsfs/server_config.h"
|
||||
|
||||
|
||||
TEST(server, create_dispose)
|
||||
{
|
||||
wsfs_server_config config = {nullptr, nullptr, nullptr, nullptr, 0};
|
||||
wsfs_server * server = wsfs_server_create(&config);
|
||||
mkdir("test", 0700);
|
||||
|
||||
struct wsfs_server_config config = {strdup("test"), nullptr, nullptr, nullptr, nullptr, 0};
|
||||
struct wsfs_server * server = wsfs_server_create(&config);
|
||||
ASSERT_NE(nullptr, server);
|
||||
|
||||
wsfs_server_dispose(server);
|
||||
wsfs_server_config_cleanup(&config);
|
||||
|
||||
rmdir("test");
|
||||
}
|
||||
Reference in New Issue
Block a user