Browse Source

Z991239-385 #comment 处理在Linux下编译出现的问题

gifur 5 years ago
parent
commit
7f73477488
2 changed files with 8 additions and 3 deletions
  1. 5 2
      Common/SpTest.h
  2. 3 1
      spbase/test/testInherits.cpp

+ 5 - 2
Common/SpTest.h

@@ -167,11 +167,14 @@ public:
 	template<class TReq, class TAns>
 	struct MethodTestCaseT : public SpReqAnsContext<TReq, TAns>, public IMethodTestCase
 	{
+
+		using Pointer = CSmartPointer<SpReqAnsContext<TReq, TAns> >;
+
 		/*Prototype of Test Case Function*/
-		typedef ErrorCodeEnum(T::* ToTestFuncProto)(SpReqAnsContext<TReq, TAns>::Pointer ctx);
+		typedef ErrorCodeEnum(T::* ToTestFuncProto)(Pointer ctx);
 
 		MethodTestCaseT(CEntityBase* ent, ToTestFuncProto testFunc)
-			:SpReqAnsContext(m_spMockTransactionContext),m_enti(ent), m_testFunc(testFunc)
+			:SpReqAnsContext<TReq, TAns>(m_spMockTransactionContext),m_enti(ent), m_testFunc(testFunc)
 			,m_errorCode(Error_IgnoreAll),m_dwUserCode(0)
 			{ }
 

+ 3 - 1
spbase/test/testInherits.cpp

@@ -3,7 +3,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <stddef.h>
+#ifdef _WIN32
 #include <windows.h>
+#endif //_WIN32
 
 struct IEntityFunction
 {
@@ -56,7 +58,7 @@ void test(IEntityFunction* pEntityFunction)
 		pEntityFunctionPrivilege->g();
 }
 
-int _tmain(int argc, _TCHAR* argv[])
+int _tmain(int argc, TCHAR* argv[])
 {
 	printf("\n SpEntityPrivilege:\n");