MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / loadInputTexts

Method loadInputTexts

native/events/Preference.cpp:660–680  ·  view source on GitHub ↗

Load texts for input from specified file of designed text or file of fuzzing text

Source from the content-addressed store, hash-verified

658
659///Load texts for input from specified file of designed text or file of fuzzing text
660 void Preference::loadInputTexts() {
661 // load specified designed text by tester
662 std::string content = fastbotx::Preference::loadFileContent(InputTextConfigFilePath);
663 if (!content.empty()) {
664 std::vector<std::string> texts;
665 splitString(content, texts, '\n');
666 this->_inputTexts.assign(texts.begin(), texts.end());
667 }
668 // load fuzzing texts
669 std::string fuzzContent = fastbotx::Preference::loadFileContent(FuzzingTextsFilePath);
670 if (!fuzzContent.empty()) {
671 std::vector<std::string> fuzzTexts;
672 splitString(fuzzContent, fuzzTexts, '\n');
673 for (auto &line: fuzzTexts) {
674 if (line.empty() || line[0] ==
675 '#') // if a new line starts with #, means it is a comment. Overlook this line.
676 continue;
677 this->_fuzzingTexts.push_back(line);
678 }
679 }
680 }
681
682 void Preference::loadTreePruning() {
683 std::string fileContent = fastbotx::Preference::loadFileContent(TreePruningFilePath);

Callers

nothing calls this directly

Calls 5

splitStringFunction · 0.85
emptyMethod · 0.80
push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected