mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
fa78e23533
* added API stub of static_filesystem * added callback functions * added basic directory listing * resize filesystem if necessary * added path stub * adds imlementation and tests of path * adds mock of wpf_request * adds test implementation and some matchers * added matcher of readdir results * fixes default directory test * adds implementation of static_filesystem_add and add_text * added implementation of read * adds implementation of filesystem_read * corrects naming of some functions * removes Flawfinder comments, since Flawfinder is disabled
35 lines
706 B
C++
35 lines
706 B
C++
#ifndef WF_JSON_MATCHER_HPP
|
|
#define FW_JSON_MATCHER_HPP
|
|
|
|
#include <gtest/gtest.h>
|
|
#include <jansson.h>
|
|
|
|
namespace webfuse_test
|
|
{
|
|
|
|
MATCHER_P(JsonMatcher, expected_str, "")
|
|
{
|
|
std::cout << "--- JsonMatcher ---" << std::endl;
|
|
bool matches = false;
|
|
json_t * expected = json_loads(expected_str, 0, nullptr);
|
|
if (nullptr != expected)
|
|
{
|
|
matches = (1 == json_equal(expected, arg));
|
|
if (!matches)
|
|
{
|
|
char * actual = json_dumps(arg, 0);
|
|
std::cout << actual << std::endl;
|
|
*result_listener << "where arg is " << actual;
|
|
free(actual);
|
|
}
|
|
|
|
json_decref(expected);
|
|
}
|
|
|
|
return true; //matches;
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|