1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

chore: re-enabled unit tests

This commit is contained in:
Falk Werner
2020-07-12 13:06:00 +02:00
parent df52f1b753
commit 7d4f6a3d55
10 changed files with 190 additions and 220 deletions

View File

@@ -0,0 +1,22 @@
#include "webfuse_provider/test_util/json_doc.hpp"
namespace webfuse_test
{
JsonDoc::JsonDoc(std::string const & json)
: contents(json)
{
doc = wfp_impl_json_parse(const_cast<char*>(contents.data()));
}
JsonDoc::~JsonDoc()
{
wfp_impl_json_dispose(doc);
}
wfp_json const * JsonDoc::root()
{
return wfp_impl_json_root(doc);
}
}

View File

@@ -0,0 +1,25 @@
#ifndef WFP_TEST_UTIL_JSON_DOC_HPP
#define WFP_TEST_UTIL_JSON_DOC_HPP
#include "webfuse_provider/impl/json/parser.h"
#include "webfuse_provider/impl/json/node.h"
#include <string>
namespace webfuse_test
{
class JsonDoc
{
public:
JsonDoc(std::string const & json);
~JsonDoc();
wfp_json const * root();
private:
std::string contents;
wfp_json_doc * doc;
};
}
#endif