本文整理汇总了C++中Tokens::setMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ Tokens::setMessage方法的具体用法?C++ Tokens::setMessage怎么用?C++ Tokens::setMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokens
的用法示例。
在下文中一共展示了Tokens::setMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: warnIfNotEmpty
TestResults* warnIfNotEmpty (const std::string & student_file, const std::string & expected_file) {
//std::cout << "in warn if not empty" << std::endl;
// std::cout << "the file '" << student_file << "'" << std::endl;
// the instructor file should be empty
assert (expected_file == "");
Tokens* answer = new Tokens();
if (student_file != "") {
answer->setMessage("WARNING: This should be empty");
//std::cout << "in warn if not empty -- student file not empty" << std::endl;
}
return answer;
}
示例2: errorIfEmpty
TestResults* errorIfEmpty ( const std::string & student_file, const std::string & expected_file) {
std::cout << "in error if empty" << std::endl;
std::cout << "the file '" << student_file << "'" << std::endl;
// the instructor file should be empty
assert (expected_file == "");
Tokens* answer = new Tokens();
if (student_file == "") {
answer->setMessage("ERROR: This should be non empty");
std::cout << "in error if empty -- student file empty" << std::endl;
answer->setGrade(0);
}
return answer;
}