Commit Graph

201 Commits

Author SHA1 Message Date
Thomas Van Lenten
e998b8ff66 Add compile test sources for to test include order.
To ensure all headers aren't dependent on other things being imported
before/after them, make a source that just imports each header and add
it to the unittesting target, that way we ensure it can be included on
its own with ordering issues.

Also do this testing with a few generated headers that aren't part of
the library to help ensure the different generated imports needed are
complete.
2018-04-02 09:54:29 -04:00
Thomas Van Lenten
bca797dac9 Trim imports for bundled generated protos.
To avoid a cycle between headers, have the WKTs use minimal imports instead
of using the helper to get everything from the library.

Fixes https://github.com/google/protobuf/issues/4301
Fixes https://github.com/google/protobuf/issues/4403
2018-04-02 09:54:29 -04:00
Adam Cozzette
ed4321d1cb
Merge pull request #4387 from acozzette/down-integrate
Integrated internal changes from Google
2018-03-20 16:14:32 -07:00
Adam Cozzette
b1216d95db Updated checked-in generated code 2018-03-14 11:17:06 -07:00
Felix Jendrusch
1da9ffe394 Check return value on write of raw pointer 2018-03-08 16:20:37 +01:00
Felix Jendrusch
38508e9bbb Add test for failing write of raw pointer to output stream 2018-03-08 16:20:05 +01:00
Thomas Van Lenten
07f023188e Fix up the docs to mention the WKTs generated files also.
Fixes #4277
2018-02-07 10:41:21 -05:00
Thomas Van Lenten
cf016a42e6 Work around strange error with atomic and swift under Xcode 8.3.3.
Haven't been able to make a repo case, but this should "fix" the problem
by avoid it completely.

- Move readOnlySemaphore_ into the .m file so it isn't exposed in any
  header.
- Move GPBGetObjectIvarWithField() also to go with the new limited
  visibility on the readOnlySemaphore_.
2018-01-31 16:57:53 -05:00
Thomas Van Lenten
d570d48648 Don't assume c-strings are 4 byte aligned.
The Undefined Behavior sanitizer flags one part of the unittests for this.
For default values for `bytes` we write a length on the front of a c-string
in the static data, apparently the compiler/linker doesn't always make this
4 byte aligned, so it get flagged for undefined/degraded performance. Avoid
this by using memcpy instead.
2018-01-31 15:40:22 -05:00
Thomas Van Lenten
d83837ded5 Fix to use "nil" instead of "NULL" for objc objects. 2018-01-31 14:24:51 -05:00
Thomas Van Lenten
81aeed082e Work around the static analyzer false report. 2018-01-31 14:24:51 -05:00
Thomas Van Lenten
953adb16ff Add casts to removed undefined behaviors around shifts.
Fixes #4246
Fixes #4247
2018-01-31 12:36:54 -05:00
Thomas Van Lenten
3e1587fd4b Add an explicit import of stdatomic.h.
The generated code for enums needs atomics support, so generate the
import instead of relying on it via transitive imports. This will
make future changes to this likely likely to break generated code
and runtime support are mixed.

Followup to https://github.com/google/protobuf/pull/4184.
2018-01-25 12:18:39 -05:00
Thomas Van Lenten
6fd2ae7e45 Bring back import of OSAtomic.
Followup to https://github.com/google/protobuf/pull/4184, keep the
import to not break any existing generated code that isn't regenerated
when they update to the newer protobuf code.
2018-01-25 12:18:39 -05:00
Jonathan Dierksen
a721bf6d29 Migrate away from deprecated OSAtomic APIs. (#4184)
* Migrate away from deprecated OSAtomic APIs.
2018-01-22 16:26:39 -05:00
Thomas Van Lenten
4588e6e2b9 Force a copy when saving the NSData that came from another. 2018-01-03 13:12:29 -05:00
Thomas Van Lenten
156161dfcd Properly copy maps with string keys but pod values.
Add tests to cover all the common special casing in the runtime code to
ensure things come out correctly.
2018-01-03 11:46:03 -05:00
kvukic
8529f2aee3 Resolved issue #3510. Malformed errorr messages replaced with meaningful description 2017-12-29 11:33:47 -05:00
Thomas Van Lenten
860d693cf7 Add Xcode 9.2 to the testing support
Fixes #4060
2017-12-18 10:36:40 -05:00
Feng Xiao
75eceb8424 Update generated code. 2017-12-12 14:57:34 -08:00
Adam Cozzette
0ba8eea655 Merge branch 'master' into down-integrate 2017-12-01 10:05:19 -08:00
Adam Cozzette
92a7e778e7 Integrated internal changes from Google 2017-12-01 10:05:10 -08:00
Thomas Van Lenten
baed06e694 Small code reorder to maybe make #3893 happy.
Use the ivar for the -open, so hopefully it lines up with the -close
in dealloc and isn't seen as an unbalanced "open".
2017-11-17 12:32:22 -05:00
Thomas Van Lenten
6700f41c4b Travis config cleanups and move ObjC to Xcode 9.1.
Stop having travis build the test matrix and make it explicit so extra
settings are only on the test that need the, this helps make the travis
UI a little cleaner (linux hosted stuff doesn't list an Xcode version),
as well as avoid unneeded requirements limiting the travis pool something
can run on.

Small improvements to objectivec/DevTools/full_mac_build.sh to avoid some
repeated scripting and hopefully make things more reliable work with Xcode
9.x.

Don't mark the iOS tests as able to fail, hopefully with the new settings
they are stable and won't give false signals.

Simplify the case for xcode versions and fixup xcode 9.[0-1].
2017-11-16 21:46:46 -05:00
dmaclach
2b3aa1c294 Add Setter/Getter type verification. (#3880)
Add runtime asserts (that can be disabled in release) that verify
that the types being get/set for messages using the C Api match
the type in the descriptor for the field being get/set.
2017-11-16 08:26:46 -05:00
dmaclach
8537f1e6d5 Fix up warnings from Xcode 9.1 (#3887)
Fix up warnings from Xcode 9.1
2017-11-16 08:24:17 -05:00
Sergio Campama
02129f0a87 Fixes 32bit tests. 2017-11-15 13:14:41 -05:00
Thomas Van Lenten
7417755e40
Merge pull request #3883 from dmaclach/map_optimizations
Reduce size of GPBDictionary by getting rid of class creation methods
2017-11-15 11:52:57 -05:00
Dave MacLachlan
8ae6844cf4 codereview cleanup 2017-11-15 08:49:59 -08:00
Thomas Van Lenten
6552c5af3f
Merge pull request #3884 from dmaclach/unsafe
Simplify getter/setter method implementations
2017-11-15 11:45:32 -05:00
Dave MacLachlan
4ba30923fa code review cleanup 2017-11-15 08:41:29 -08:00
Dave MacLachlan
949596ea32 Simplify getter/setter method implementations
Remove unnecessary retain/releases for GPBFieldDescriptors when
creating implementations with blocks. The descriptors do not need
to be memory managed because they are essentially global constructs
that are guaranteed to be around the lifetime of the app.
2017-11-14 15:58:22 -08:00
Dave MacLachlan
9d7f313372 Reduce size of GPBDictionary by getting rid of class creation methods 2017-11-14 15:37:28 -08:00
Dave MacLachlan
37a6672c31 Remove unreferenced 'GPBMessageSignatureProtocol' class.
Remove unreferenced 'GPBMessageSignatureProtocol' class that is just taking up
space in the Objective C runtime information by hanging the protocol it needs to
declare off of GPBRootObject instead.

Small binary size reduction, but more importantly a removal of a class that
appears to be unused when statically analyzed.
2017-11-14 15:16:04 -08:00
Thomas Van Lenten
1f57e540ac When comparing message, require them to have the same descriptor.
This will cover someone subclassing the message, and also handles
something crazy like someone comparing to a raw NSObject.
2017-11-03 12:49:28 -04:00
xuwei-k
05b56d01c1 update joda-time javadoc url 2017-10-30 17:48:54 +09:00
Sergio Campama
b1f954e639 Improves coverage of GPBCodedInputStream 2017-10-24 10:44:41 -04:00
Jisi Liu
ecf2957106 Update descriptor protos 2017-10-18 14:21:22 -07:00
Thomas Van Lenten
a274c67caf Build out more complete code coverage in the tests. 2017-10-03 11:54:44 -04:00
Thomas Van Lenten
9477123538 Let Xcode 9 update project/scheme settings. 2017-10-03 09:56:02 -04:00
Thomas Van Lenten
4207066c35 Merge pull request #3710 from thomasvl/xcode9
Add Xcode 9 support to the helper script.
2017-10-02 20:14:50 -04:00
Thomas Van Lenten
b586e646a4 Add Xcode 9 support to the helper script. 2017-10-02 20:13:59 -04:00
Thomas Van Lenten
3f2dcaebe3 ObjC: Fix merging of length delimited unknown fields.
- Add a test to cover this and tweak the test to not use two merge
  paths to be sure things are as expected.
2017-10-02 19:56:25 -04:00
Jisi Liu
139775ccc0 Merge remote-tracking branch 'origin/3.4.x' into mergemaster 2017-08-18 16:25:35 -07:00
cclauss
6f4c9b07e4 print() function for Python 3 2017-08-18 01:25:00 +02:00
Thomas Van Lenten
ba81c59cf5 Fix up Xcode 8.3.x support.
- Xcode 8.3.3 bumped the simulators to 10.3.1, so 10.3 fails.  Just use
  the "latest" naming instead to avoid issues.
- Also switch to just testing an old 32bit build and new 64bit build as
  there isn't any code in protobuf that should care about form facts.
  (Looks like the iPad Pro simulator names aren't always constantly, on
  some developer machines they are "iPad Pro (9.7 inch)" while on others
  they are "iPad Pro (9.7-inch)"; so just avoid using them.)
2017-08-07 12:55:46 -04:00
Jisi Liu
3af881c7e2 Merge master into 3.4.x 2017-07-18 16:26:16 -07:00
Jisi Liu
86975301f1 Update csharp and php descriptor 2017-07-18 15:44:24 -07:00
Thomas Van Lenten
b30dee3ea6 Expose the initializer for unknown fields. 2017-07-05 11:16:34 -04:00
Thomas Van Lenten
db45687a38 If we fail to get a descriptor just super the method resolving.
This should never happen, but if someone is swizzling or do other
hooking of methods, anything is possible, so this seems slighty
safer than they returning NO.
2017-06-22 10:18:00 -04:00