Skip to content

Commit

Permalink
add techempower test types
Browse files Browse the repository at this point in the history
  • Loading branch information
hggq committed Jan 5, 2024
1 parent 4a5f7d5 commit d000482
Show file tree
Hide file tree
Showing 25 changed files with 15,858 additions and 6 deletions.
22 changes: 22 additions & 0 deletions common/autocontrolmethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "testrestfulpath.h"
#include "testdownloadauth.h"
#include "testmodelfromjson.h"
#include "techempower.h"
#include "teststrip_html.h"
#include "teststr_join.h"
#include "testrand.h"
Expand Down Expand Up @@ -77,6 +78,27 @@ namespace http
temp.regfun = testmodelfromjson;
methodcallback.emplace("mfromjson",temp);
temp.pre = nullptr;
temp.regfun = techempowerplaintext;
methodcallback.emplace("plaintext",temp);
temp.pre = nullptr;
temp.regfun = techempowerjson;
methodcallback.emplace("json",temp);
temp.pre = nullptr;
temp.regfun = techempowerdb;
methodcallback.emplace("db",temp);
temp.pre = nullptr;
temp.regfun = techempowerqueries;
methodcallback.emplace("queries",temp);
temp.pre = nullptr;
temp.regfun = techempowerfortunes;
methodcallback.emplace("fortunes",temp);
temp.pre = nullptr;
temp.regfun = techempowerupdates;
methodcallback.emplace("updates",temp);
temp.pre = nullptr;
temp.regfun = techempowercached_queries;
methodcallback.emplace("cached-queries",temp);
temp.pre = nullptr;
temp.regfun = teststrip_html;
methodcallback.emplace("teststrip_html",temp);
temp.pre = nullptr;
Expand Down
17 changes: 17 additions & 0 deletions common/json_reflect_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
#include <vector>
#include <map>

#include "ipdata/ip_data_obj.h"
#include "types/topics_type.h"
#include "types/techempower_json.h"
#include "markdown/markdown2html.h"
#include "department/department_type.h"
#include "img/editorupload_type.h"
#include "img/upload_images.h"
Expand Down Expand Up @@ -37,6 +40,20 @@ unsigned int json_decode(topics_tree_outjson_t &json_reflectobj,const std::strin
unsigned int json_decode(std::vector<topics_tree_outjson_t> &json_reflectobj,const std::string &_json_data,unsigned int _offset=0);
}

namespace http
{


std::string json_encode(const techempower_outjson_t &json_reflectobj);


std::string json_encode(const std::vector<techempower_outjson_t> &json_reflectobj);

unsigned int json_decode(techempower_outjson_t &json_reflectobj,const std::string &_json_data,unsigned int _offset=0);

unsigned int json_decode(std::vector<techempower_outjson_t> &json_reflectobj,const std::string &_json_data,unsigned int _offset=0);
}

namespace psy
{

Expand Down
2 changes: 1 addition & 1 deletion common/reghttpmethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void _inithttpmethodregto(std::map<std::string, regmethold_t> &methodcallback)

temp.regfun = [](std::shared_ptr<httppeer> peer) -> std::string
{
peer->output = "hello world!";
peer->output = "Hello, World!";
return "";
};
methodcallback.emplace("helloworld", temp);
Expand Down
Loading

0 comments on commit d000482

Please sign in to comment.