Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
5c11b412
Commit
5c11b412
authored
Oct 03, 2019
by
Benjamin Peterson
Committed by
Adam Cozzette
Oct 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the grammar of the unused import message.
parent
a32c2d03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
command_line_interface_unittest.cc
...ogle/protobuf/compiler/command_line_interface_unittest.cc
+2
-2
descriptor.cc
src/google/protobuf/descriptor.cc
+1
-1
descriptor_unittest.cc
src/google/protobuf/descriptor_unittest.cc
+2
-2
No files found.
src/google/protobuf/compiler/command_line_interface_unittest.cc
View file @
5c11b412
...
...
@@ -884,7 +884,7 @@ TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafFirst) {
Run
(
"protocol_compiler --test_out=$tmpdir "
"--proto_path=$tmpdir bar.proto foo.proto"
);
ExpectWarningSubstring
(
"bar.proto:2:1: warning: Import unused.proto
but not
used."
);
"bar.proto:2:1: warning: Import unused.proto
is un
used."
);
}
TEST_F
(
CommandLineInterfaceTest
,
ReportsTransitiveMisingImports_LeafLast
)
{
...
...
@@ -905,7 +905,7 @@ TEST_F(CommandLineInterfaceTest, ReportsTransitiveMisingImports_LeafLast) {
Run
(
"protocol_compiler --test_out=$tmpdir "
"--proto_path=$tmpdir foo.proto bar.proto"
);
ExpectWarningSubstring
(
"bar.proto:2:1: warning: Import unused.proto
but not
used."
);
"bar.proto:2:1: warning: Import unused.proto
is un
used."
);
}
TEST_F
(
CommandLineInterfaceTest
,
CreateDirectory
)
{
...
...
src/google/protobuf/descriptor.cc
View file @
5c11b412
...
...
@@ -7125,7 +7125,7 @@ void DescriptorBuilder::LogUnusedDependency(const FileDescriptorProto& proto,
unused_dependency_
.
begin
();
it
!=
unused_dependency_
.
end
();
++
it
)
{
// Log warnings for unused imported files.
std
::
string
error_message
=
"Import "
+
(
*
it
)
->
name
()
+
"
but not
used."
;
std
::
string
error_message
=
"Import "
+
(
*
it
)
->
name
()
+
"
is un
used."
;
AddWarning
((
*
it
)
->
name
(),
proto
,
DescriptorPool
::
ErrorCollector
::
IMPORT
,
error_message
);
}
...
...
src/google/protobuf/descriptor_unittest.cc
View file @
5c11b412
...
...
@@ -3479,7 +3479,7 @@ TEST(CustomOptions, UnusedImportWarning) {
EXPECT_EQ
(
"custom_options_import.proto: "
"google/protobuf/unittest_custom_options.proto: IMPORT: Import "
"google/protobuf/unittest_custom_options.proto
but not
used.
\n
"
,
"google/protobuf/unittest_custom_options.proto
is un
used.
\n
"
,
error_collector
.
warning_text_
);
EXPECT_EQ
(
""
,
error_collector
.
text_
);
}
...
...
@@ -5795,7 +5795,7 @@ TEST_F(ValidationErrorTest, UnusedImportWarning) {
" field { name:
\"
base
\"
number:1 label:LABEL_OPTIONAL "
"type_name:
\"
Base
\"
}"
"}"
,
"forward.proto: bar.proto: IMPORT: Import bar.proto
but not
used.
\n
"
);
"forward.proto: bar.proto: IMPORT: Import bar.proto
is un
used.
\n
"
);
}
namespace
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment