Preprocessor: Fix so the unit tests work again
This commit is contained in:
parent
bbc63b6b5b
commit
046db9b2bb
|
@ -201,7 +201,7 @@ std::string Preprocessor::removeComments(const std::string &str, const std::stri
|
|||
if (i == std::string::npos)
|
||||
break;
|
||||
|
||||
if (settings->_inlineSuppressions)
|
||||
if (settings && settings->_inlineSuppressions)
|
||||
{
|
||||
std::string comment(str, commentStart, i - commentStart);
|
||||
std::istringstream iss(comment);
|
||||
|
|
|
@ -72,6 +72,12 @@ public:
|
|||
/** Just read the code into a string. Perform simple cleanup of the code */
|
||||
static std::string read(std::istream &istr, const std::string &filename, Settings *settings);
|
||||
|
||||
/** Just read the code into a string. Perform simple cleanup of the code */
|
||||
static std::string read(std::istream &istr)
|
||||
{
|
||||
return read(istr, "", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get preprocessed code for a given configuration
|
||||
*/
|
||||
|
|
|
@ -793,7 +793,7 @@ private:
|
|||
// Preprocess => actual result..
|
||||
std::istringstream istr(filedata);
|
||||
std::map<std::string, std::string> actual;
|
||||
const Settings settings;
|
||||
Settings settings;
|
||||
Preprocessor preprocessor(&settings, this);
|
||||
preprocessor.preprocess(istr, actual, "file.c");
|
||||
|
||||
|
@ -811,7 +811,7 @@ private:
|
|||
// Preprocess => actual result..
|
||||
std::istringstream istr(filedata);
|
||||
std::map<std::string, std::string> actual;
|
||||
const Settings settings;
|
||||
Settings settings;
|
||||
Preprocessor preprocessor(&settings, this);
|
||||
preprocessor.preprocess(istr, actual, "file.c");
|
||||
|
||||
|
|
Loading…
Reference in New Issue