Skip to content

Commit

Permalink
Fix tests and fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Sep 28, 2021
1 parent 0ede7e5 commit 4980400
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fuzzing/TopicTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
12 changes: 6 additions & 6 deletions tests/TopicTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4980400

Please sign in to comment.