Fix tests and fuzzing
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
/* Create topic tree */
|
||||
uWS::TopicTree<std::string> topicTree([](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
uWS::TopicTree<std::string, std::string_view> topicTree([](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
|
||||
/* Depending on what publishing we do below (with or without empty strings),
|
||||
* this assumption can hold true or not. For now it should hold true */
|
||||
|
||||
+6
-6
@@ -13,11 +13,11 @@
|
||||
void testCorrectness() {
|
||||
std::cout << "TestCorrectness" << std::endl;
|
||||
|
||||
uWS::TopicTree<std::string> *topicTree;
|
||||
uWS::TopicTree<std::string, std::string_view> *topicTree;
|
||||
std::map<void *, std::string> expectedResult;
|
||||
std::map<void *, std::string> actualResult;
|
||||
|
||||
topicTree = new uWS::TopicTree<std::string>([&topicTree, &actualResult](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
topicTree = new uWS::TopicTree<std::string, std::string_view>([&topicTree, &actualResult](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
|
||||
actualResult[s] += message;
|
||||
|
||||
@@ -88,11 +88,11 @@ void testCorrectness() {
|
||||
void testBugReport() {
|
||||
std::cout << "TestBugReport" << std::endl;
|
||||
|
||||
uWS::TopicTree<std::string> *topicTree;
|
||||
uWS::TopicTree<std::string, std::string_view> *topicTree;
|
||||
std::map<void *, std::string> expectedResult;
|
||||
std::map<void *, std::string> actualResult;
|
||||
|
||||
topicTree = new uWS::TopicTree<std::string>([&topicTree, &actualResult](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
topicTree = new uWS::TopicTree<std::string, std::string_view>([&topicTree, &actualResult](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
|
||||
actualResult[s] += message;
|
||||
|
||||
@@ -149,11 +149,11 @@ void testBugReport() {
|
||||
void testReorderingv19() {
|
||||
std::cout << "TestReorderingv19" << std::endl;
|
||||
|
||||
uWS::TopicTree<std::string> *topicTree;
|
||||
uWS::TopicTree<std::string, std::string_view> *topicTree;
|
||||
std::map<void *, std::string> expectedResult;
|
||||
std::map<void *, std::string> actualResult;
|
||||
|
||||
topicTree = new uWS::TopicTree<std::string>([&topicTree, &actualResult](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
topicTree = new uWS::TopicTree<std::string, std::string_view>([&topicTree, &actualResult](uWS::Subscriber *s, std::string &message, auto flags) {
|
||||
|
||||
actualResult[s] += message;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user