aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/importer_unittest.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-12-11 17:09:20 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-12-11 17:10:28 -0800
commite841bac4fcf47f809e089a70d5f84ac37b3883df (patch)
treed25dc5fc814db182c04c5f276ff1a609c5965a5a /src/google/protobuf/compiler/importer_unittest.cc
parent99a6a95c751a28a3cc33dd2384959179f83f682c (diff)
Down-integrate from internal code base.
Diffstat (limited to 'src/google/protobuf/compiler/importer_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/importer_unittest.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/importer_unittest.cc b/src/google/protobuf/compiler/importer_unittest.cc
index 33c9328f..be19aa2e 100644
--- a/src/google/protobuf/compiler/importer_unittest.cc
+++ b/src/google/protobuf/compiler/importer_unittest.cc
@@ -71,6 +71,7 @@ class MockErrorCollector : public MultiFileErrorCollector {
~MockErrorCollector() {}
string text_;
+ string warning_text_;
// implements ErrorCollector ---------------------------------------
void AddError(const string& filename, int line, int column,
@@ -78,6 +79,12 @@ class MockErrorCollector : public MultiFileErrorCollector {
strings::SubstituteAndAppend(&text_, "$0:$1:$2: $3\n",
filename, line, column, message);
}
+
+ void AddWarning(const string& filename, int line, int column,
+ const string& message) {
+ strings::SubstituteAndAppend(&warning_text_, "$0:$1:$2: $3\n",
+ filename, line, column, message);
+ }
};
// -------------------------------------------------------------------
@@ -123,6 +130,7 @@ class ImporterTest : public testing::Test {
// Return the collected error text
string error() const { return error_collector_.text_; }
+ string warning() const { return error_collector_.warning_text_; }
MockErrorCollector error_collector_;
MockSourceTree source_tree_;