aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf.Test
Commit message (Collapse)AuthorAgeFilesLines
* Fixed parsing of BoolValue.Jos Hickson2016-05-111-0/+7
|
* Allow custom type URL prefixes in Any.PackJon Skeet2016-04-293-0/+47
| | | | | | (And likewise ignore the prefix in unpack.) Fixes issue #1459.
* Regenerate all C# code and make it compileJon Skeet2016-04-2012-113/+113
| | | | JSON tests fail, as we're not using OriginalNameAttribute yet.
* Remove duplicate test cases.Jon Skeet2016-04-012-2/+0
| | | | (NCrunch noticed these.)
* Code review fixesalien2016-03-291-0/+1
|
* csharp: add support for the json_name optionalien2016-03-182-5/+186
| | | | | Conflicts: csharp/src/Google.Protobuf/JsonFormatter.cs
* Replace StringBuilder with TextWriter in JsonFormatteravgweb2016-03-061-0/+9
|
* Fix copy/paste typo in CodedInputStreamTestJon Skeet2016-03-011-1/+1
|
* Implement IDisposable for CodedInputStream and CodedOutputStreamJon Skeet2016-02-292-0/+50
| | | | | This fixes issue #679 and issue #1282. (The .gitignore change is just around ncrunch; I can put it in a separate PR if you really want.)
* Merge pull request #1240 from jskeet/validate_groupJan Tattermusch2016-02-182-6/+51
|\ | | | | Validate that end-group tags match their corresponding start-group tags
| * Validate that end-group tags match their corresponding start-group tagsJon Skeet2016-02-152-6/+51
| | | | | | | | | | | | | | | | This detects: - An end-group tag with the wrong field number (doesn't match the start-group field) - An end-group tag with no preceding start-group tag Fixes issue #688.
* | Add more tests around merging wrappersJon Skeet2016-02-151-2/+41
|/ | | | This was in an attempt to fix the wrapper handling corner case, but it's really fiddly.
* Use checked-in key to build ReleaseSignedJan Tattermusch2016-02-091-1/+1
|
* Generated code changes from previous commitJon Skeet2016-02-042-14/+14
|
* Generated code for GeneratedCodeInfo changeJon Skeet2016-02-046-59/+59
|
* Merge pull request #1158 from jskeet/nonnormalized-tostringJan Tattermusch2016-01-265-2/+94
|\ | | | | Ensure that FieldMask, Timestamp and Duration ToString() calls don't throw
| * Ensure that FieldMask, Timestamp and Duration ToString() calls don't throwJon Skeet2016-01-205-2/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | The usage of ICustomDiagnosticMessage here is non-essential - ToDiagnosticString doesn't actually get called by ToString() in this case, due to JsonFormatter code. It was intended to make it clearer that it *did* have a custom format... but then arguably I should do the same for Value, Struct, Any etc. Moving some of the code out of JsonFormatter and into Duration/Timestamp/FieldMask likewise feels somewhat nice, somewhat nasty... basically there are JSON-specific bits of formatting, but also domain-specific bits of computation. <sigh> Thoughts welcome.
* | Fix mistakes in highest-representable float64 integersJon Skeet2016-01-211-2/+2
|/
* Merge pull request #1096 from jskeet/custom-to-stringJan Tattermusch2016-01-194-1/+63
|\ | | | | Introduce ICustomDiagnosticMessage to allow for custom string formatting
| * Introduce ICustomDiagnosticMessage to allow for custom string formattingJon Skeet2016-01-134-1/+63
| | | | | | | | This fixes issue #933, effectively.
* | Fix broken testJon Skeet2016-01-151-1/+1
| |
* | Make sure thatJon Skeet2016-01-152-4/+51
| | | | | | | | | | | | "valueField": null is parsed appropriately, i.e. that it remembers that the field is set.
* | Reject JSON containing the same oneof field twiceJon Skeet2016-01-151-0/+7
| |
* | Change handling of unknown enums: we now write out the value as a number.Jon Skeet2016-01-152-16/+13
| |
* | Extra strictness for FieldMask conversionJon Skeet2016-01-152-0/+18
| |
* | Allow the original field name (rather than camel-cased) when parsing JSONJon Skeet2016-01-151-0/+8
| |
* | Fixes to JSON timestamp/duration representationsJon Skeet2016-01-154-9/+73
| |
* | Prohibit null values in repeated and map fields in JSONJon Skeet2016-01-151-0/+30
| |
* | Throw a better exception when invalid base64 is detected in JSONJon Skeet2016-01-151-0/+9
| |
* | Support (and test) numeric enum parsing in JSONJon Skeet2016-01-151-0/+20
| |
* | Fix handling of repeated wrappersJon Skeet2016-01-151-0/+24
| | | | | | | | | | Previously we were incorrectly packing wrapper types. This also refactors FieldCodec a bit as well, using more C# 6-ness.
* | JSON conformance test fixesJon Skeet2016-01-131-0/+7
|/ | | | | - Spot an Any without a type URL - In the conformance test runner, catch exceptions due to generally-invalid JSON
* Prohibit null values in map fieldsJon Skeet2016-01-115-77/+51
| | | | | On deserialization, missing values for message types are replaced with a "default" message.
* Merge pull request #1098 from jskeet/wkt-jsonJan Tattermusch2016-01-082-25/+41
|\ | | | | Ensure all formatted well-known-type values are valid JSON
| * Ensure all formatted well-known-type values are valid JSONJon Skeet2016-01-062-25/+41
| | | | | | | | | | | | | | This involves quoting timestamp/duration/field-mask values, even when they're not in fields. It's better for consistency. Fixes issue #1097.
* | Improve number handling in JSON parsingJon Skeet2016-01-061-12/+35
|/ | | | | | - Tighten up on Infinity/NaN handling in terms of whitespace handling (and test casing) - Validate that values are genuinely integers when they've been parsed from a JSON number (ignoring the fact that 1.0000000000000000001 == 1 as a double...) - Allow exponents and decimal points in string representations
* Generated code changes from previous commit.Jon Skeet2015-12-156-58/+58
|
* Make ToString() valid without a type registryJon Skeet2015-12-151-0/+23
| | | | | | | | | | | | | | | This addresses issue #1008, by creating a JsonFormatter which is private and only different to JsonFormatter.Default in terms of reference equality. Other plausible designs: - The same, but expose the diagnostic-only formatter - Add something to settings to say "I don't have a type registry at all" - Change the behaviour of JsonFormatter.Default (bad idea IMO, as we really *don't* want the result of this used as regular JSON to be parsed) Note that just trying to find a separate fix to issue #933 and using that to override Any.ToString() differently wouldn't work for messages that *contain* an Any. Generated code changes follow in the next commit.
* Handle JSON parsing for Any.Jon Skeet2015-12-022-7/+57
| | | | This required a rework of the tokenizer to allow for a "replaying" tokenizer, basically in case the @type value comes after the data itself. This rework is nice in some ways (all the pushback and object depth logic in one place) but is a little fragile in terms of token push-back when using the replay tokenizer. It'll be fine for the scenario we need it for, but we should be careful...
* JSON formatting for Any.Jon Skeet2015-12-021-0/+42
|
* Generated code changes for previous commit (basically ↵Jon Skeet2015-11-226-6/+6
| | | | InternalBuildGeneratedFileFrom => FromGeneratedCode)
* Tidy up reflection in advance of attempting to implement DynamicMessage.Jon Skeet2015-11-221-12/+6
| | | | | | | | | There are corner cases where MessageDescriptor.{ClrType,Parser} will return null, and these are now documented. However, normally they *should* be implemented, even for descriptors of for dynamic messages. Ditto FieldDescriptor.Accessor. We'll still need a fair amount of work to implement dynamic messages, but this change means that the public API will be remain intact. Additionally, this change starts making use of C# 6 features in the files that it touches. This is far from exhaustive, and later PRs will have more. Generated code changes coming in the next commit.
* Added the type registry in advance of implementing Any support.Jon Skeet2015-11-212-0/+95
| | | | Biting off just this bit first as I don't need the changes from a previous PR for this part.
* Generated code from previous commit.Jon Skeet2015-11-197-54/+56
|
* Generated code changes and manual changes for previous commit.Jon Skeet2015-11-098-83/+84
|
* Merge pull request #941 from jskeet/recursion-limitJan Tattermusch2015-11-053-2/+77
|\ | | | | Add recursion limit handling to JSON parsing.
| * Reimplement JSON recursion by detecting the depth in the tokenizer.Jon Skeet2015-11-051-0/+57
| | | | | | | | Added a TODO around a possible change to the tokenizer API, changing PushBack(token) into just Rewind() or something similar.
| * Add recursion limit handling to JSON parsing.Jon Skeet2015-11-042-2/+20
| | | | | | | | Fixes issue #932.
* | Created a new exception for JSON failures.Jon Skeet2015-11-052-24/+24
|/ | | | | | This is only thrown directly by JsonTokenizer, but surfaces from JsonParser as well. I've added doc comments to hopefully make everything clear. The exception is actually thrown by the reader within JsonTokenizer, in anticipation of keeping track of the location within the document, but that change is not within this PR.
* Implement JSON parsing in C#.Jon Skeet2015-11-034-6/+1102
| | | | | | | | | | This includes all the well-known types except Any. Some aspects are likely to require further work when the details of the JSON parsing expectations are hammered out in more detail. Some of these have "ignored" tests already. Note that the choice *not* to use Json.NET was made for two reasons: - Going from 0 dependencies to 1 dependency is a big hit, and there's not much benefit here - Json.NET parses more leniently than we'd want; accommodating that would be nearly as much work as writing the tokenizer This only really affects the JsonTokenizer, which could be replaced by Json.NET. The JsonParser code would be about the same length with Json.NET... but I wouldn't be as confident in it.