flatbuffers/tests/optional_scalars
Stefan F 65c415911a
Generate nullable properties in C# object-based API for optional scalars. (without -gen-mutable) (#6273)
* Added missing EndTable() call to VerifyObject()

VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables.

https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg

* Added Check to VerifyAlignment

https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri

* Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring

* flatc should warn, when an attribute is attached more than once.

flatc.exe -b duplicate.fbs
warning: duplicate.fbs(5, 36): warning: attribute already found: priority

duplicate.fbs:

namespace MyGame;

attribute "priority";

table Monster (priority:1, priority:2) {
}

root_type Monster;

* flatc should support --binary --schema with optional scalar fields.

This fixes 'error: Optional scalars are not yet supported in at least one the of the specified programming languages.' when calling flatc.exe --binary --schema with a schema containing optional scalars.

* Generate nullable properties in C# object-based API for optional scalars.
tests\generate_code.bat extended to test this.

Ran tests\generate_code.bat
Ran tests\Flatbuffers.Test\NetTest.bat

* %TEST_BASE_FLAGS% replaced with --gen-object-api in generate_code.bat, because only this is part of this PR. Added this same flag to generate_code.sh

* generate_code.bat and generate_code.sh changed to only test c# with object based api.
2020-12-10 16:50:30 -08:00
..
OptionalByte.cs [C#] Optional Scalars (#6217) 2020-10-30 13:18:59 -07:00
OptionalByte.java [Java] Implement optional scalars (#6212) 2020-10-26 17:46:50 -07:00
OptionalByte.kt Kotlin test optional enum (#6201) 2020-10-22 13:36:02 -07:00
ScalarStuff.cs Generate nullable properties in C# object-based API for optional scalars. (without -gen-mutable) (#6273) 2020-12-10 16:50:30 -08:00
ScalarStuff.java [Java] Implement optional scalars (#6212) 2020-10-26 17:46:50 -07:00
ScalarStuff.kt Kotlin test optional enum (#6201) 2020-10-22 13:36:02 -07:00