~verterok/ubuntu/lucid/protobuf/2.4.0a-backport

« back to all changes in this revision

Viewing changes to src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-05-31 14:41:47 UTC
  • mfrom: (2.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110531144147-s41g5fozgvyo462l
Tags: 2.4.0a-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix linking with -lpthread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
  }
80
80
};
81
81
 
82
 
class MockOutputDirectory : public OutputDirectory {
 
82
class MockGeneratorContext : public GeneratorContext {
83
83
 public:
84
 
  MockOutputDirectory() {}
85
 
  ~MockOutputDirectory() {
 
84
  MockGeneratorContext() {}
 
85
  ~MockGeneratorContext() {
86
86
    STLDeleteValues(&files_);
87
87
  }
88
88
 
102
102
         "to your CL.";
103
103
  }
104
104
 
105
 
  // implements OutputDirectory --------------------------------------
 
105
  // implements GeneratorContext --------------------------------------
106
106
 
107
107
  virtual io::ZeroCopyOutputStream* Open(const string& filename) {
108
108
    string** map_slot = &files_[filename];
130
130
  ASSERT_TRUE(plugin_proto_file != NULL);
131
131
 
132
132
  CppGenerator generator;
133
 
  MockOutputDirectory output_directory;
 
133
  MockGeneratorContext context;
134
134
  string error;
135
135
  string parameter;
136
136
  parameter = "dllexport_decl=LIBPROTOBUF_EXPORT";
137
137
  ASSERT_TRUE(generator.Generate(proto_file, parameter,
138
 
                                 &output_directory, &error));
 
138
                                 &context, &error));
139
139
  parameter = "dllexport_decl=LIBPROTOC_EXPORT";
140
140
  ASSERT_TRUE(generator.Generate(plugin_proto_file, parameter,
141
 
                                 &output_directory, &error));
 
141
                                 &context, &error));
142
142
 
143
 
  output_directory.ExpectFileMatches("google/protobuf/descriptor.pb.h",
144
 
                                     "google/protobuf/descriptor.pb.h");
145
 
  output_directory.ExpectFileMatches("google/protobuf/descriptor.pb.cc",
146
 
                                     "google/protobuf/descriptor.pb.cc");
147
 
  output_directory.ExpectFileMatches("google/protobuf/compiler/plugin.pb.h",
148
 
                                     "google/protobuf/compiler/plugin.pb.h");
149
 
  output_directory.ExpectFileMatches("google/protobuf/compiler/plugin.pb.cc",
150
 
                                     "google/protobuf/compiler/plugin.pb.cc");
 
143
  context.ExpectFileMatches("google/protobuf/descriptor.pb.h",
 
144
                            "google/protobuf/descriptor.pb.h");
 
145
  context.ExpectFileMatches("google/protobuf/descriptor.pb.cc",
 
146
                            "google/protobuf/descriptor.pb.cc");
 
147
  context.ExpectFileMatches("google/protobuf/compiler/plugin.pb.h",
 
148
                            "google/protobuf/compiler/plugin.pb.h");
 
149
  context.ExpectFileMatches("google/protobuf/compiler/plugin.pb.cc",
 
150
                            "google/protobuf/compiler/plugin.pb.cc");
151
151
}
152
152
 
153
153
}  // namespace