commenting out reader error checks (#2196)

Reader code doesn't run on Rpc now if a valid writer can not be found
In future PR write and read functions should be generated together as they share most of the same checks
This commit is contained in:
James Frowen 2020-08-25 01:39:03 +01:00 committed by GitHub
parent d73de03eca
commit c9a9f92c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 25 deletions

View File

@ -87,8 +87,9 @@ public void GivesErrorWhenUsingObject()
// would only want to be send as an arg as a base type for an Inherited object // would only want to be send as an arg as a base type for an Inherited object
HasError("Cannot generate writer for Object. Use a supported type or provide a custom writer", HasError("Cannot generate writer for Object. Use a supported type or provide a custom writer",
"UnityEngine.Object"); "UnityEngine.Object");
HasError("Cannot generate reader for Object. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"UnityEngine.Object"); //HasError("Cannot generate reader for Object. Use a supported type or provide a custom reader",
// "UnityEngine.Object");
} }
[Test] [Test]
@ -98,8 +99,9 @@ public void GivesErrorWhenUsingScriptableObject()
// would only want to be send as an arg as a base type for an Inherited object // would only want to be send as an arg as a base type for an Inherited object
HasError("Cannot generate writer for ScriptableObject. Use a supported type or provide a custom writer", HasError("Cannot generate writer for ScriptableObject. Use a supported type or provide a custom writer",
"UnityEngine.ScriptableObject"); "UnityEngine.ScriptableObject");
HasError("Cannot generate reader for ScriptableObject. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"UnityEngine.ScriptableObject"); //HasError("Cannot generate reader for ScriptableObject. Use a supported type or provide a custom reader",
// "UnityEngine.ScriptableObject");
} }
[Test] [Test]
@ -107,8 +109,9 @@ public void GivesErrorWhenUsingMonoBehaviour()
{ {
HasError("Cannot generate writer for component type MonoBehaviour. Use a supported type or provide a custom writer", HasError("Cannot generate writer for component type MonoBehaviour. Use a supported type or provide a custom writer",
"UnityEngine.MonoBehaviour"); "UnityEngine.MonoBehaviour");
HasError("Cannot generate reader for component type MonoBehaviour. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"UnityEngine.MonoBehaviour"); //HasError("Cannot generate reader for component type MonoBehaviour. Use a supported type or provide a custom reader",
// "UnityEngine.MonoBehaviour");
} }
[Test] [Test]
@ -116,8 +119,9 @@ public void GivesErrorWhenUsingTypeInheritedFromMonoBehaviour()
{ {
HasError("Cannot generate writer for component type MyBehaviour. Use a supported type or provide a custom writer", HasError("Cannot generate writer for component type MyBehaviour. Use a supported type or provide a custom writer",
"GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour"); "GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour");
HasError("Cannot generate reader for component type MyBehaviour. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour"); //HasError("Cannot generate reader for component type MyBehaviour. Use a supported type or provide a custom reader",
// "GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour");
} }
[Test] [Test]
@ -132,8 +136,9 @@ public void GivesErrorWhenUsingInterface()
{ {
HasError("Cannot generate writer for interface IData. Use a supported type or provide a custom writer", HasError("Cannot generate writer for interface IData. Use a supported type or provide a custom writer",
"GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData"); "GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData");
HasError("Cannot generate reader for interface IData. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData"); //HasError("Cannot generate reader for interface IData. Use a supported type or provide a custom reader",
// "GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData");
} }
[Test] [Test]
@ -179,8 +184,9 @@ public void GivesErrorForInvalidArrayType()
{ {
HasError("Cannot generate writer for Array because element MonoBehaviour does not have a writer. Use a supported type or provide a custom writer", HasError("Cannot generate writer for Array because element MonoBehaviour does not have a writer. Use a supported type or provide a custom writer",
"UnityEngine.MonoBehaviour[]"); "UnityEngine.MonoBehaviour[]");
HasError("Cannot generate reader for Array because element MonoBehaviour does not have a reader. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"UnityEngine.MonoBehaviour[]"); //HasError("Cannot generate reader for Array because element MonoBehaviour does not have a reader. Use a supported type or provide a custom reader",
// "UnityEngine.MonoBehaviour[]");
} }
[Test] [Test]
@ -188,8 +194,9 @@ public void GivesErrorForInvalidArraySegmentType()
{ {
HasError("Cannot generate writer for ArraySegment because element MonoBehaviour does not have a writer. Use a supported type or provide a custom writer", HasError("Cannot generate writer for ArraySegment because element MonoBehaviour does not have a writer. Use a supported type or provide a custom writer",
"System.ArraySegment`1<UnityEngine.MonoBehaviour>"); "System.ArraySegment`1<UnityEngine.MonoBehaviour>");
HasError("Cannot generate reader for ArraySegment because element MonoBehaviour does not have a reader. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"System.ArraySegment`1<UnityEngine.MonoBehaviour>"); //HasError("Cannot generate reader for ArraySegment because element MonoBehaviour does not have a reader. Use a supported type or provide a custom reader",
// "System.ArraySegment`1<UnityEngine.MonoBehaviour>");
} }
[Test] [Test]
@ -209,8 +216,9 @@ public void GivesErrorForInvalidListType()
{ {
HasError("Cannot generate writer for List because element MonoBehaviour does not have a writer. Use a supported type or provide a custom writer", HasError("Cannot generate writer for List because element MonoBehaviour does not have a writer. Use a supported type or provide a custom writer",
"System.Collections.Generic.List`1<UnityEngine.MonoBehaviour>"); "System.Collections.Generic.List`1<UnityEngine.MonoBehaviour>");
HasError("Cannot generate reader for List because element MonoBehaviour does not have a reader. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"System.Collections.Generic.List`1<UnityEngine.MonoBehaviour>"); //HasError("Cannot generate reader for List because element MonoBehaviour does not have a reader. Use a supported type or provide a custom reader",
// "System.Collections.Generic.List`1<UnityEngine.MonoBehaviour>");
} }
} }
} }

View File

@ -167,11 +167,11 @@ public void NetworkBehaviourClientRpcParamRef()
"System.Int32&"); "System.Int32&");
HasError("RpcCantHaveParamRef has invalid parameter monkeys", HasError("RpcCantHaveParamRef has invalid parameter monkeys",
"System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamRef.NetworkBehaviourClientRpcParamRef::RpcCantHaveParamRef(System.Int32&)"); "System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamRef.NetworkBehaviourClientRpcParamRef::RpcCantHaveParamRef(System.Int32&)");
HasError("Cannot pass type Int32& by reference", // TODO change weaver to run checks for write/read at the same time
"System.Int32&"); //HasError("Cannot pass type Int32& by reference",
HasError("RpcCantHaveParamRef has invalid parameter monkeys. Unsupported type System.Int32&, use a supported Mirror type instead", // "System.Int32&");
"System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamRef.NetworkBehaviourClientRpcParamRef::RpcCantHaveParamRef(System.Int32&)"); //HasError("RpcCantHaveParamRef has invalid parameter monkeys. Unsupported type System.Int32&, use a supported Mirror type instead",
; // "System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamRef.NetworkBehaviourClientRpcParamRef::RpcCantHaveParamRef(System.Int32&)");
} }
[Test] [Test]
@ -188,10 +188,11 @@ public void NetworkBehaviourClientRpcParamComponent()
"WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass"); "WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass");
HasError("RpcCantHaveParamComponent has invalid parameter monkeyComp", HasError("RpcCantHaveParamComponent has invalid parameter monkeyComp",
"System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent::RpcCantHaveParamComponent(WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass)"); "System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent::RpcCantHaveParamComponent(WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass)");
HasError("Cannot generate reader for component type ComponentClass. Use a supported type or provide a custom reader", // TODO change weaver to run checks for write/read at the same time
"WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass"); //HasError("Cannot generate reader for component type ComponentClass. Use a supported type or provide a custom reader",
HasError("RpcCantHaveParamComponent has invalid parameter monkeyComp. Unsupported type WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass, use a supported Mirror type instead", // "WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass");
"System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent::RpcCantHaveParamComponent(WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass)"); //HasError("RpcCantHaveParamComponent has invalid parameter monkeyComp. Unsupported type WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass, use a supported Mirror type instead",
// "System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent::RpcCantHaveParamComponent(WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass)");
} }
[Test] [Test]