[C++, Java, C#, TypeScript, JavaScript] Skip generation of mutable union types (#5599)

* Skip generation of mutable union types

* Removed C# and Java unit tests that mutated a Union type
This commit is contained in:
Derek Bailey
2019-11-04 14:54:44 -08:00
committed by Wouter van Oortmerssen
parent 7b38aa71e6
commit 46ae3f80a6
17 changed files with 64 additions and 209 deletions

View File

@@ -1,18 +1,3 @@
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import static com.google.flatbuffers.Constants.*;
@@ -36,6 +21,24 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/*
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class JavaTest {
public static void main(String[] args) {
@@ -438,10 +441,6 @@ class JavaTest {
// testType is an existing field and mutating it should succeed
TestEq(monster.testType(), (byte)Any.Monster);
TestEq(monster.mutateTestType(Any.NONE), true);
TestEq(monster.testType(), (byte)Any.NONE);
TestEq(monster.mutateTestType(Any.Monster), true);
TestEq(monster.testType(), (byte)Any.Monster);
//mutate the inventory vector
TestEq(monster.mutateInventory(0, 1), true);