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
HasError("Cannot generate writer for Object. Use a supported type or provide a custom writer",
"UnityEngine.Object");
HasError("Cannot generate reader for Object. Use a supported type or provide a custom reader",
"UnityEngine.Object");
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot generate reader for Object. Use a supported type or provide a custom reader",
// "UnityEngine.Object");
}
[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
HasError("Cannot generate writer for ScriptableObject. Use a supported type or provide a custom writer",
"UnityEngine.ScriptableObject");
HasError("Cannot generate reader for ScriptableObject. Use a supported type or provide a custom reader",
"UnityEngine.ScriptableObject");
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot generate reader for ScriptableObject. Use a supported type or provide a custom reader",
// "UnityEngine.ScriptableObject");
}
[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",
"UnityEngine.MonoBehaviour");
HasError("Cannot generate reader for component type MonoBehaviour. Use a supported type or provide a custom reader",
"UnityEngine.MonoBehaviour");
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot generate reader for component type MonoBehaviour. Use a supported type or provide a custom reader",
// "UnityEngine.MonoBehaviour");
}
[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",
"GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour");
HasError("Cannot generate reader for component type MyBehaviour. Use a supported type or provide a custom reader",
"GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour");
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot generate reader for component type MyBehaviour. Use a supported type or provide a custom reader",
// "GeneratedReaderWriter.GivesErrorWhenUsingTypeInheritedFromMonoBehaviour.MyBehaviour");
}
[Test]
@ -132,8 +136,9 @@ public void GivesErrorWhenUsingInterface()
{
HasError("Cannot generate writer for interface IData. Use a supported type or provide a custom writer",
"GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData");
HasError("Cannot generate reader for interface IData. Use a supported type or provide a custom reader",
"GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData");
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot generate reader for interface IData. Use a supported type or provide a custom reader",
// "GeneratedReaderWriter.GivesErrorWhenUsingInterface.IData");
}
[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",
"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[]");
// TODO change weaver to run checks for write/read at the same time
//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]
@ -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",
"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>");
// TODO change weaver to run checks for write/read at the same time
//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]
@ -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",
"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>");
// TODO change weaver to run checks for write/read at the same time
//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&");
HasError("RpcCantHaveParamRef has invalid parameter monkeys",
"System.Void WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamRef.NetworkBehaviourClientRpcParamRef::RpcCantHaveParamRef(System.Int32&)");
HasError("Cannot pass type Int32& by reference",
"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&)");
;
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot pass type Int32& by reference",
// "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]
@ -188,10 +188,11 @@ public void NetworkBehaviourClientRpcParamComponent()
"WeaverNetworkBehaviourTests.NetworkBehaviourClientRpcParamComponent.NetworkBehaviourClientRpcParamComponent/ComponentClass");
HasError("RpcCantHaveParamComponent has invalid parameter monkeyComp",
"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",
"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)");
// TODO change weaver to run checks for write/read at the same time
//HasError("Cannot generate reader for component type ComponentClass. Use a supported type or provide a custom reader",
// "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]