Commit Graph

53 Commits

Author SHA1 Message Date
Joshua Haberman
dce403a8b3 Sync from Piper @427369078
PROTOBUF_SYNC_PIPER
2022-02-08 20:53:31 -08:00
Rafi Kamal
58d4420e2d Down Integrate Internal Changes 2019-11-12 13:38:58 -08:00
Rafi Kamal
4f02f056b5 Down integrate to GitHub 2019-08-22 17:33:01 -07:00
Paul Yang
a9bb65643b
Add binary conformance test for default repeated fields (#6440)
* Add binary conformance test for default repeated fields

1) Both packed and unpacked encoding should be accepted for parsing.
2) Encode should follow the default way for the syntax.

* Uncomment test

* Remove is_primitive

* Add failed tests to failure lists.

* Add failed test to failure list

* Use binary format to specify expected value

Text format cannot distinguish whether repeated field is packed or not.

* Change method name from ToHexString to ToOctString

* Add failed test to failure list

* Add failed test to php's failure list

* Fix comments
2019-07-26 10:05:14 -07:00
Hao Nguyen
2f864fdfdf Down integrate to Github 2019-03-20 11:45:01 -07:00
Yilun Chong
d8c2501b43 down integration from internal 2019-02-22 18:13:33 +08:00
Yilun Chong
cb95a7f6a8
Down-integrate internal changes to github. (#5566)
* Down-integrate internal changes to github.

* fix csharp conformance test

* add comments in conformance.proto for text format

* fix comments

* fix comments, re-generated csharp file

* fix comments, re-generated csharp file
2019-01-11 11:40:52 -08:00
Yilun Chong
0adb74c2d3 Down-integrate internal changes to github. (#5555)
* Down-integrate internal changes to github.

* fix python conformance test

* fix csharp conformance test

* add back java map_lite_test.proto's optimize for option

* fix php conformance test
2019-01-08 15:06:30 -08:00
Paul Yang
cecba296b8
Down-integrate internal changes (#5467)
* Down-integrate internal changes

* Update generated code for php, objc and csharp.

* Add missing dependency in conformance_php
2018-12-14 16:05:03 -08:00
Paul Yang
5aeee3dc91
Add source dependency of test suite implementation to main function (#5069)
* Fix conformance running nothing issue

This change adds a source dependency of the test suite implementaion
class in the main function. For generality reason, the main function is
moved to the file of the test suite implemetation.  New test suite
implementation will need to implement the main function.
In order to make it easy for test suite implementation to implement the
main function, this change also refactor out the common code out of the
main function.

* Fix typo
2018-09-06 15:02:04 -07:00
Feng Xiao
6bbe197e9c Down-integrate from google3. 2018-08-08 17:00:41 -07:00
Paul Yang
26eeec93e4
Enable ignoring unknown in json parsing in php (#4839)
* Enable ignoring unknown in json parsing in php

* Update generated descriptor files

* Update failure list for other languages.

* Remove unnecessary php files
2018-07-09 14:29:23 -07: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
0400cca323 Integrated internal changes from Google 2018-03-13 16:37:29 -07:00
Jon Skeet
5140bae383 Add conformance test for null value in list JSON 2018-03-01 13:45:13 +00:00
Adam Cozzette
39a789e657 Removed using statements from common.h
These statements pulled a bunch of symbols from the std namespace into
the global namespace. This commit removes all of them except for
std::string, which is a bit trickier to remove.
2018-01-26 16:17:14 -08:00
Paul Yang
188f18044f
All integer types should accept null in json. (#3869) 2017-11-13 09:31:28 -08:00
Paul Yang
23adfeb003 Reserve unknown in Ruby (#3763)
* Reserve unknown in ruby

* Revert ruby tests. Wait for cpp impl for conformance test

* Add conformance test for preserving unknown

* Add unknown field conformance test to csharp failure list.

* Fix comments

* Fix comment

* Fix comments

* Fix typo

* Use stringsink_string directly

* Mark hd unused

* Remove unused encodeunknown_handlerfunc
2017-10-26 14:41:43 -07:00
Feng Xiao
cf1b29dec8 Merge pull request #2377 from mcos/chore/conformance-null-tests
Conformance Tests for Null Timestamp and Duration JSON Values
2017-09-19 22:35:27 -07:00
Jisi Liu
759245a49a Merge from master 2017-07-25 11:52:33 -07:00
Jisi Liu
3af881c7e2 Merge master into 3.4.x 2017-07-18 16:26:16 -07:00
Jisi Liu
09354db143 Merge from Google internal for 3.4 release 2017-07-18 15:38:30 -07:00
tanderson-google
126082c371 Add std:: namespace prefix to set and map (#3332)
* Remove using std::{set,map}
2017-07-09 20:31:50 -07:00
Joshua Haberman
1325588982 Updated upb to fix JSON conformance issues. (#3206)
* Fixed a bunch of Ruby conformance errors.

* Fixed some more Ruby conformance errors in JSON.
2017-06-19 15:13:24 -07:00
Thomas Van Lenten
dd19b876d4 Raise the number of digits used for floats.
About 1.5% of all IEEE754 single-precision numbers require nine
decimal digits to represent accurately.
2017-06-16 15:24:33 -04:00
Feng Xiao
d36c0c538a Down-integrate from google3. 2017-03-29 14:33:05 -07:00
Joshua Haberman
ffa71f8007 A few more cases for binary conformance tests. (#2500)
* A few more cases for binary conformance tests.

* over-encoded varints (encoded in more bytes than are necessary).
* truncated varints (>32 bits for 32-bit types).

* Fixed Python decoding bug with 32-bit varints.

* Fixed 1L -> 1LL for 32-bit platforms.
2017-01-06 16:58:21 -08:00
Joshua Haberman
2ff42dcf2c Added conformance testing for binary primitive types. (#2491)
This is basic and more tests will be added over time.
2016-12-13 16:31:02 -08:00
Julien Brianceau
e3da722b66 Fix #include in cc files 2016-12-09 09:34:07 +01:00
Joshua Haberman
f1ce60e7b4 Factored Conformance and Benchmark test messages into shared test schema. (#1971)
* Factored Conformance test messages into shared test schema.

* Updated benchmarks to use new proto3 message locations.

* Fixed include path.

* Conformance: fixed include of Python test messages.

* Make maven in Rakefile use --batch-mode.

* Revert changes to benchmarks.

On second thought I think a separate schema for
CPU benchmarking makes sense.

* Try regenerating C# protos for new test protos.

* Removed benchmark messages from test proto.

* Added Jon Skeet's fixes for C#.

* Removed duplicate/old test messages C# file.

* C# fixes for test schema move.

* Fixed C# to use the correct TestAllTypes message.

* Fixes for Objective C test schema move.

* Added missing EXTRA_DIST file.
2016-12-03 11:51:25 -05:00
Adam Cozzette
5a76e633ea Integrated internal changes from Google 2016-11-17 16:59:59 -08:00
Mark Costello
cb54caff01
Add tests to demonstrate json parsing for null Timestamp and Duration types 2016-11-16 15:00:54 -05:00
Bo Yang
e3f0689d05 Fix bugs for internal integration. 2016-10-10 11:23:36 -07:00
Bo Yang
cc8ca5b6a5 Integrate internal changes 2016-10-10 11:23:36 -07:00
Thomas Van Lenten
80f65d2df8 Add note about JSON tests maybe being wrong. (#1992)
Add note about JSON tests maybe being wrong.

- Add note about the JSON test maybe not being correct yet.
- Add test to checks the generated names for double underscores to be sure they
  are what is expected.
2016-08-23 08:19:45 -04:00
Thomas Van Lenten
7437774a27 More JSON tests
- String behaviors
- Testing only valid JSON is allowed
2016-08-22 12:07:33 -04:00
Thomas Van Lenten
e389165586 Add more JSON tests around underscores (#1963)
Add more JSON tests around underscores
2016-08-16 09:02:27 -04:00
Thomas Van Lenten
27c8962505 Add more types to the zero oneof cases.
Incase the different runtimes have different generation/implementations for
for the different primitive field types, cover a larger range of the proto
types in the oneof zero tests.
2016-08-11 13:15:01 -04:00
Thomas Van Lenten
ac3df39c22 Add conformance test for zero fields in oneofs. (#1939)
* Add conformance test for zero fields in oneofs.
* Add failures to the "expected" files.
2016-08-11 09:44:07 -04:00
Jon Skeet
00d5a7f099 Amend the conformance tests to only use Int64/Uint64 non-wrapped values which (#1164)
can reasonably be expected to be interoperable.

(The fact that not all Int64/Uint64 values *can* be exactly represented in
IEEE-754 and thus interoperably amongst JSON implementations is precisely the
reason for wrapping them when we serialize... it shouldn't be a surprise that
we can't round-trip in unwrapped form for all values.)
2016-07-31 11:40:51 +01:00
Josh Haberman
ef7894e2dc Make conformance tests more strict about the failure list.
The failure lists were falling out of date because the
tests would pass even if people forgot to remove failures
from the list.
2016-06-03 09:39:38 -07:00
Josh Haberman
e891c29f9b Allow conformance test runner to tolerate crashes, and re-enable conformance tests. 2016-01-11 16:15:46 -08:00
Thomas Van Lenten
df4e4d8717 Fix up the conformance tests
- Update all the new runner cases to handle a skip result as a skip and not a failure.
- Make ObjC use the new serialize_error result if it fails to generate the data.
2016-01-05 16:31:40 -05:00
Thomas Van Lenten
de3c56a0d1 Fix conformance test to only report skips in verbose mode.
commit e841bac4fc seems to have mis-merged the
change to reporting skipped tests.

I didn't check if there were other merge issues.
2016-01-05 15:00:51 -05:00
Feng Xiao
a0cecfd31a Make conformance tests build for C++ and Java.
Change-Id: Ibb3fe6f919cc7ca0df91da5e1697ba33d259e433
2015-12-16 13:38:10 -08:00
Feng Xiao
e841bac4fc Down-integrate from internal code base. 2015-12-11 17:10:28 -08:00
Josh Haberman
325392dd61 Conformance test implementation for Python. 2015-12-02 12:53:42 -08:00
Josh Haberman
b0500b37b2 Added support for Json and valid input to conformance tests.
This was enabled by the recent open-sourcing of JSON
support and MessageDifferencer.

MessageDifferencer allows the conformance suite to expand
because it allows us to write tests for payloads that parse
successfully.  To verify the testee's output payload, we
need to parse it back into a message and compare the message
instances.  Comparing output bytes vs. a golden message is
*not* valid, because protobufs do not have a canonical
encoding (especially in the presence of maps, which have
no prescribed serialization order).

We only add one small JSON test for now, but with the
framework in place we now have the foundation to dramatically
expand the coverage of the conformance test suite.

Also added the ability for the testee to skip tests that
exercise features that are unimplemented.  This allows
Java (which currently has no JSON support) to skip tests
involving JSON.

Change-Id: I697b4363da432b61ae3b638b4287c4cda1af4deb
2015-07-10 16:36:59 -07:00
Josh Haberman
23bf3b566f Removed test_name from conformance.proto.
Change-Id: I382dcda97fa123a6da4ff5faad5d7ece95853f33
2015-06-04 15:04:00 -07:00
Josh Haberman
d2b67389b3 Conformance tests can now be excluded based on their names.
This allows us to enable conformance tests even when we know
that some tests are failing and need to be fixed.

Change-Id: I372f43663008747db6f2b2cf06e6ffa4c6d85b2d
2015-06-03 12:08:08 -07:00