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:
22
test/webfuse_provider/test_util/json_doc.cc
Normal file
22
test/webfuse_provider/test_util/json_doc.cc
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
25
test/webfuse_provider/test_util/json_doc.hpp
Normal file
25
test/webfuse_provider/test_util/json_doc.hpp
Normal 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
|
||||
Reference in New Issue
Block a user