void makeCalls(Caller myCaller, Base myBase) { string NAMESPACE = "director_classesNamespace."; myCaller.set(myBase); DoubleHolder dh = new DoubleHolder(444.555); // Class pointer, reference and pass by value tests if (myCaller.ValCall(dh).val != dh.val) { throw new Exception("failed"); } if (myCaller.RefCall(dh).val != dh.val) { throw new Exception("failed"); } if (myCaller.PtrCall(dh).val != dh.val) { throw new Exception("failed"); } if (myCaller.ConstPtrRefCall(dh).val != dh.val) { throw new Exception("failed"); } // Fully overloaded method test (all methods in base class are overloaded) if (NAMESPACE + myCaller.FullyOverloadedCall(10) != myBase.GetType() + "::FullyOverloaded(int)") { throw new Exception("failed"); } if (NAMESPACE + myCaller.FullyOverloadedCall(true) != myBase.GetType() + "::FullyOverloaded(bool)") { throw new Exception("failed"); } // Semi overloaded method test (some methods in base class are overloaded) if (NAMESPACE + myCaller.SemiOverloadedCall(-678) != myBase.GetType() + "::SemiOverloaded(int)") { throw new Exception("failed"); } if (myCaller.SemiOverloadedCall(true) != "Base" + "::SemiOverloaded(bool)") { throw new Exception("failed"); } // Default parameters methods test if (NAMESPACE + myCaller.DefaultParmsCall(10, 2.2) != myBase.GetType() + "::DefaultParms(int, double)") { throw new Exception("failed"); } if (myBase.GetType() == typeof(CSharpDerived)) // special handling for C# derived classes, there is no way to do this any other way { if (NAMESPACE + myCaller.DefaultParmsCall(10) != myBase.GetType() + "::DefaultParms(int, double)") { throw new Exception("failed"); } } else { if (NAMESPACE + myCaller.DefaultParmsCall(10) != myBase.GetType() + "::DefaultParms(int)") { throw new Exception("failed"); } } myCaller.reset(); }