"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/google/protobuf/compiler/annotation_test_util.cc" between
protobuf-all-3.19.4.tar.gz and protobuf-all-3.20.1.tar.gz

About: Protocol Buffers (a.k.a., protobuf) are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data.

annotation_test_util.cc  (protobuf-all-3.19.4):annotation_test_util.cc  (protobuf-all-3.20.1)
skipping to change at line 61 skipping to change at line 61
namespace { namespace {
// A CodeGenerator that captures the FileDescriptor it's passed as a // A CodeGenerator that captures the FileDescriptor it's passed as a
// FileDescriptorProto. // FileDescriptorProto.
class DescriptorCapturingGenerator : public CodeGenerator { class DescriptorCapturingGenerator : public CodeGenerator {
public: public:
// Does not own file; file must outlive the Generator. // Does not own file; file must outlive the Generator.
explicit DescriptorCapturingGenerator(FileDescriptorProto* file) explicit DescriptorCapturingGenerator(FileDescriptorProto* file)
: file_(file) {} : file_(file) {}
virtual bool Generate(const FileDescriptor* file, bool Generate(const FileDescriptor* file, const std::string& parameter,
const std::string& parameter, GeneratorContext* context, GeneratorContext* context, std::string* error) const override {
std::string* error) const {
file->CopyTo(file_); file->CopyTo(file_);
return true; return true;
} }
private: private:
FileDescriptorProto* file_; FileDescriptorProto* file_;
}; };
} // namespace } // namespace
void AddFile(const std::string& filename, const std::string& data) { void AddFile(const std::string& filename, const std::string& data) {
skipping to change at line 131 skipping to change at line 130
} }
} }
} }
const GeneratedCodeInfo::Annotation* FindAnnotationOnPath( const GeneratedCodeInfo::Annotation* FindAnnotationOnPath(
const GeneratedCodeInfo& info, const std::string& source_file, const GeneratedCodeInfo& info, const std::string& source_file,
const std::vector<int>& path) { const std::vector<int>& path) {
std::vector<const GeneratedCodeInfo::Annotation*> annotations; std::vector<const GeneratedCodeInfo::Annotation*> annotations;
FindAnnotationsOnPath(info, source_file, path, &annotations); FindAnnotationsOnPath(info, source_file, path, &annotations);
if (annotations.empty()) { if (annotations.empty()) {
return NULL; return nullptr;
} }
return annotations[0]; return annotations[0];
} }
bool AtLeastOneAnnotationMatchesSubstring( bool AtLeastOneAnnotationMatchesSubstring(
const std::string& file_content, const std::string& file_content,
const std::vector<const GeneratedCodeInfo::Annotation*>& annotations, const std::vector<const GeneratedCodeInfo::Annotation*>& annotations,
const std::string& expected_text) { const std::string& expected_text) {
for (std::vector<const GeneratedCodeInfo::Annotation*>::const_iterator for (std::vector<const GeneratedCodeInfo::Annotation*>::const_iterator
i = annotations.begin(), i = annotations.begin(),
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)