[ObjC] Remove the need for descriptor.proto in tests.

Add a test message to one of the objc test proto files for the one case that was
using what was in descriptor.proto.
pull/10446/head
Thomas Van Lenten 3 years ago
parent d979267a7f
commit 43b8721457
  1. 4
      objectivec/DevTools/compile_testing_protos.sh
  2. 4
      objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj
  3. 4
      objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj
  4. 4
      objectivec/ProtocolBuffers_tvOS.xcodeproj/project.pbxproj
  5. 6
      objectivec/Tests/GPBARCUnittestProtos.m
  6. 42
      objectivec/Tests/GPBCompileTest24.m
  7. 10
      objectivec/Tests/GPBDescriptorTests.m
  8. 6
      objectivec/Tests/GPBUnittestProtos.m
  9. 7
      objectivec/Tests/unittest_objc_options.proto

@ -41,10 +41,6 @@ CORE_PROTO_FILES=(
src/google/protobuf/unittest_preserve_unknown_enum.proto
src/google/protobuf/map_proto2_unittest.proto
src/google/protobuf/map_unittest.proto
# The unittest_custom_options.proto extends the messages in descriptor.proto
# so we build it in to test extending in general. The library doesn't provide
# a descriptor as it doesn't use the classes/enums.
src/google/protobuf/descriptor.proto
)
# -----------------------------------------------------------------------------

@ -61,7 +61,6 @@
F40EE4BF206BF8B90071091A /* GPBCompileTest21.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE486206BF8AF0071091A /* GPBCompileTest21.m */; };
F40EE4C0206BF8B90071091A /* GPBCompileTest22.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE48A206BF8B00071091A /* GPBCompileTest22.m */; };
F40EE4C1206BF8B90071091A /* GPBCompileTest23.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE487206BF8B00071091A /* GPBCompileTest23.m */; };
F40EE50B206C06640071091A /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE508206C06440071091A /* GPBCompileTest24.m */; };
F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F41C175C1833D3310064ED4D /* GPBPerfTests.m */; };
F4353D1D1AB8822D005A6198 /* GPBDescriptorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */; };
F4353D231ABB1537005A6198 /* GPBDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D211ABB1537005A6198 /* GPBDictionary.m */; };
@ -204,7 +203,6 @@
F40EE491206BF8B10071091A /* GPBCompileTest03.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest03.m; sourceTree = "<group>"; };
F40EE492206BF8B10071091A /* GPBCompileTest06.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest06.m; sourceTree = "<group>"; };
F40EE493206BF8B20071091A /* GPBCompileTest11.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest11.m; sourceTree = "<group>"; };
F40EE508206C06440071091A /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; };
F41C175C1833D3310064ED4D /* GPBPerfTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBPerfTests.m; sourceTree = "<group>"; };
F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDescriptorTests.m; sourceTree = "<group>"; };
F4353D201ABB1537005A6198 /* GPBDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBDictionary.h; sourceTree = "<group>"; };
@ -469,7 +467,6 @@
F40EE486206BF8AF0071091A /* GPBCompileTest21.m */,
F40EE48A206BF8B00071091A /* GPBCompileTest22.m */,
F40EE487206BF8B00071091A /* GPBCompileTest23.m */,
F40EE508206C06440071091A /* GPBCompileTest24.m */,
5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */,
F4353D1C1AB8822D005A6198 /* GPBDescriptorTests.m */,
F4C4B9E21E1D974F00D3B61D /* GPBDictionaryTests.m */,
@ -741,7 +738,6 @@
buildActionMask = 2147483647;
files = (
8BBEA4A9147C727D00C4ADB7 /* GPBCodedInputStreamTests.m in Sources */,
F40EE50B206C06640071091A /* GPBCompileTest24.m in Sources */,
F40EE4BE206BF8B90071091A /* GPBCompileTest20.m in Sources */,
F401DC331A8E5C0200FCC765 /* GPBArrayTests.m in Sources */,
F40EE4B4206BF8B90071091A /* GPBCompileTest10.m in Sources */,

@ -61,7 +61,6 @@
F40EE504206BF91E0071091A /* GPBCompileTest21.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CB206BF9170071091A /* GPBCompileTest21.m */; };
F40EE505206BF91E0071091A /* GPBCompileTest22.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CF206BF9170071091A /* GPBCompileTest22.m */; };
F40EE506206BF91E0071091A /* GPBCompileTest23.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CC206BF9170071091A /* GPBCompileTest23.m */; };
F40EE511206C068D0071091A /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE50E206C06880071091A /* GPBCompileTest24.m */; };
F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F41C175C1833D3310064ED4D /* GPBPerfTests.m */; };
F4353D1F1AB88243005A6198 /* GPBDescriptorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */; };
F4353D271ABB156F005A6198 /* GPBDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D251ABB156F005A6198 /* GPBDictionary.m */; };
@ -205,7 +204,6 @@
F40EE4D6206BF9190071091A /* GPBCompileTest03.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest03.m; sourceTree = "<group>"; };
F40EE4D7206BF9190071091A /* GPBCompileTest06.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest06.m; sourceTree = "<group>"; };
F40EE4D8206BF9190071091A /* GPBCompileTest11.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest11.m; sourceTree = "<group>"; };
F40EE50E206C06880071091A /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; };
F41C175C1833D3310064ED4D /* GPBPerfTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBPerfTests.m; sourceTree = "<group>"; };
F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDescriptorTests.m; sourceTree = "<group>"; };
F4353D241ABB156F005A6198 /* GPBDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBDictionary.h; sourceTree = "<group>"; };
@ -475,7 +473,6 @@
F40EE4CB206BF9170071091A /* GPBCompileTest21.m */,
F40EE4CF206BF9170071091A /* GPBCompileTest22.m */,
F40EE4CC206BF9170071091A /* GPBCompileTest23.m */,
F40EE50E206C06880071091A /* GPBCompileTest24.m */,
5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */,
F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */,
F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */,
@ -748,7 +745,6 @@
buildActionMask = 2147483647;
files = (
8BBEA4A9147C727D00C4ADB7 /* GPBCodedInputStreamTests.m in Sources */,
F40EE511206C068D0071091A /* GPBCompileTest24.m in Sources */,
F40EE503206BF91E0071091A /* GPBCompileTest20.m in Sources */,
F401DC351A8E5C6F00FCC765 /* GPBArrayTests.m in Sources */,
F40EE4F9206BF91E0071091A /* GPBCompileTest10.m in Sources */,

@ -61,7 +61,6 @@
F40EE504206BF91E0071091A /* GPBCompileTest21.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CB206BF9170071091A /* GPBCompileTest21.m */; };
F40EE505206BF91E0071091A /* GPBCompileTest22.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CF206BF9170071091A /* GPBCompileTest22.m */; };
F40EE506206BF91E0071091A /* GPBCompileTest23.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE4CC206BF9170071091A /* GPBCompileTest23.m */; };
F40EE511206C068D0071091A /* GPBCompileTest24.m in Sources */ = {isa = PBXBuildFile; fileRef = F40EE50E206C06880071091A /* GPBCompileTest24.m */; };
F41C175D1833D3310064ED4D /* GPBPerfTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F41C175C1833D3310064ED4D /* GPBPerfTests.m */; };
F4353D1F1AB88243005A6198 /* GPBDescriptorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */; };
F4353D271ABB156F005A6198 /* GPBDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = F4353D251ABB156F005A6198 /* GPBDictionary.m */; };
@ -205,7 +204,6 @@
F40EE4D6206BF9190071091A /* GPBCompileTest03.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest03.m; sourceTree = "<group>"; };
F40EE4D7206BF9190071091A /* GPBCompileTest06.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest06.m; sourceTree = "<group>"; };
F40EE4D8206BF9190071091A /* GPBCompileTest11.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest11.m; sourceTree = "<group>"; };
F40EE50E206C06880071091A /* GPBCompileTest24.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBCompileTest24.m; sourceTree = "<group>"; };
F41C175C1833D3310064ED4D /* GPBPerfTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBPerfTests.m; sourceTree = "<group>"; };
F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPBDescriptorTests.m; sourceTree = "<group>"; };
F4353D241ABB156F005A6198 /* GPBDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPBDictionary.h; sourceTree = "<group>"; };
@ -475,7 +473,6 @@
F40EE4CB206BF9170071091A /* GPBCompileTest21.m */,
F40EE4CF206BF9170071091A /* GPBCompileTest22.m */,
F40EE4CC206BF9170071091A /* GPBCompileTest23.m */,
F40EE50E206C06880071091A /* GPBCompileTest24.m */,
5102DABB1891A052002037B6 /* GPBConcurrencyTests.m */,
F4353D1E1AB88243005A6198 /* GPBDescriptorTests.m */,
F4C4B9E51E1D97BB00D3B61D /* GPBDictionaryTests.m */,
@ -748,7 +745,6 @@
buildActionMask = 2147483647;
files = (
8BBEA4A9147C727D00C4ADB7 /* GPBCodedInputStreamTests.m in Sources */,
F40EE511206C068D0071091A /* GPBCompileTest24.m in Sources */,
F40EE503206BF91E0071091A /* GPBCompileTest20.m in Sources */,
F401DC351A8E5C6F00FCC765 /* GPBArrayTests.m in Sources */,
F40EE4F9206BF91E0071091A /* GPBCompileTest10.m in Sources */,

@ -34,11 +34,6 @@
// Makes sure all the generated headers compile with ARC on.
// The unittest_custom_options.proto extends the messages in descriptor.proto
// so we build it in to test extending in general. The library doesn't provide
// a descriptor as it doesn't use the classes/enums.
#import "google/protobuf/Descriptor.pbobjc.h"
#import "google/protobuf/Unittest.pbobjc.h"
#import "google/protobuf/UnittestCycle.pbobjc.h"
#import "google/protobuf/UnittestDeprecated.pbobjc.h"
@ -48,6 +43,7 @@
#import "google/protobuf/UnittestImportPublicLite.pbobjc.h"
#import "google/protobuf/UnittestMset.pbobjc.h"
#import "google/protobuf/UnittestObjc.pbobjc.h"
#import "google/protobuf/UnittestObjcOptions.pbobjc.h"
#import "google/protobuf/UnittestObjcStartup.pbobjc.h"
#import "google/protobuf/UnittestPreserveUnknownEnum.pbobjc.h"
#import "google/protobuf/UnittestRuntimeProto2.pbobjc.h"

@ -1,42 +0,0 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This is a test including a single header to ensure things build. This
// is NOT a public header of the library, but uses a file that defines
// proto2 syntax messages that are extendable, so it can need more things
// that the proto3 syntax WKTs bundled with the library.
#import "google/protobuf/Descriptor.pbobjc.h"
// Something in the body of this file so the compiler/linker won't complain
// about an empty .o file.
__attribute__((visibility("default"))) char dummy_symbol_24 = 0;

@ -35,7 +35,7 @@
#import "GPBDescriptor_PackagePrivate.h"
#import "google/protobuf/Unittest.pbobjc.h"
#import "google/protobuf/UnittestObjc.pbobjc.h"
#import "google/protobuf/Descriptor.pbobjc.h"
#import "google/protobuf/UnittestObjcOptions.pbobjc.h"
@interface DescriptorTests : GPBTestCase
@end
@ -57,10 +57,10 @@
XCTAssertEqualObjects(nestedMessageDesc.fullName, @"protobuf_unittest.TestAllTypes.NestedMessage");
// Prefixes removed.
GPBDescriptor *descDesc = [GPBDescriptorProto descriptor];
XCTAssertEqualObjects(descDesc.fullName, @"google.protobuf.DescriptorProto");
GPBDescriptor *descExtRngDesc = [GPBDescriptorProto_ExtensionRange descriptor];
XCTAssertEqualObjects(descExtRngDesc.fullName, @"google.protobuf.DescriptorProto.ExtensionRange");
GPBDescriptor *descDesc = [GPBTESTPrefixedParentMessage descriptor];
XCTAssertEqualObjects(descDesc.fullName, @"protobuf_objc_unittest.PrefixedParentMessage");
GPBDescriptor *descExtRngDesc = [GPBTESTPrefixedParentMessage_Child descriptor];
XCTAssertEqualObjects(descExtRngDesc.fullName, @"protobuf_objc_unittest.PrefixedParentMessage.Child");
// Things that get "_Class" added.
GPBDescriptor *pointDesc = [Point_Class descriptor];

@ -31,11 +31,6 @@
// Collects all the compiled protos into one file and compiles them to make sure
// the compiler is generating valid code.
// The unittest_custom_options.proto extends the messages in descriptor.proto
// so we build it in to test extending in general. The library doesn't provide
// a descriptor as it doesn't use the classes/enums.
#import "google/protobuf/Descriptor.pbobjc.m"
#import "google/protobuf/AnyTest.pbobjc.m"
#import "google/protobuf/MapProto2Unittest.pbobjc.m"
#import "google/protobuf/MapUnittest.pbobjc.m"
@ -49,6 +44,7 @@
#import "google/protobuf/UnittestMset.pbobjc.m"
#import "google/protobuf/UnittestMsetWireFormat.pbobjc.m"
#import "google/protobuf/UnittestObjc.pbobjc.m"
#import "google/protobuf/UnittestObjcOptions.pbobjc.m"
#import "google/protobuf/UnittestObjcStartup.pbobjc.m"
#import "google/protobuf/UnittestPreserveUnknownEnum.pbobjc.m"
#import "google/protobuf/UnittestRuntimeProto2.pbobjc.m"

@ -59,3 +59,10 @@ message GPBTESTshouldGetAPrefixMessage {
// Verify that classes named the same as prefixes are prefixed.
message GPBTEST {
}
// Gets that lookup deals with prefix.
message PrefixedParentMessage {
message Child {
}
}

Loading…
Cancel
Save