wxThread::ExitCode wxGISProcess::Entry() { // IMPORTANT: // this function gets executed in the secondary thread context! // here we do our long task, periodically calling TestDestroy(): //wxTextInputStream (wxInputStream &stream, const wxString &sep=" \t", const wxMBConv &conv=wxConvAuto()) wxInputStream &InStream = *GetInputStream(); wxTextInputStream InputStr(InStream, wxT(" \t"), *wxConvCurrent); while(!GetThread()->TestDestroy()) { if(InStream.Eof()) break; if(InStream.IsOk() && InStream.CanRead()) { wxString line = InputStr.ReadLine(); ProcessInput(line); } wxThread::Sleep(READ_LINE_DELAY); } // TestDestroy() returned true (which means the main thread asked us // to terminate as soon as possible) or we ended the long task... return (wxThread::ExitCode)wxTHREAD_NO_ERROR; }
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size) { std::string InputStr(reinterpret_cast<const char*>(Data), Size); std::string MagicStr("Hello\r\nWorld\r\n"); if (InputStr == MagicStr) { std::cout << "BINGO!"; } return 0; }