language-extensions/R/test/src/RExtensionInitSessionTests.cpp
//----------------------------------------------------------------------------------------------
// Name: InitInvalidSessionTest
//
// Description:
// Test InitSession() API with invalid values. A negative test.
//
InitInvalidSessionTest
Description:
Test InitSession() API with invalid values. A negative test.
InitInvalidSessionTest Description : Test InitSession () API with invalid values . A negative test .
TEST_F(RExtensionApiTests, InitInvalidSessionTest)
	{
		SQLRETURN result = SQL_SUCCESS;
		result = (*sm_initSessionFuncPtr)(
			*m_sessionId,
			m_taskId,
			m_numTasks,
			nullptr,                    
			0,                          Length
			m_inputSchemaColumnsNumber,
			m_parametersNumber,
			m_inputDataName,
			m_inputDataNameString.length(),
			m_outputDataName,
			m_outputDataNameString.length());
		EXPECT_EQ(result, SQL_ERROR);
		CleanupSession();
		result = SQL_SUCCESS;
		result = (*sm_initSessionFuncPtr)(
			*m_sessionId,
			m_taskId,
			m_numTasks,
			m_script,
			m_scriptString.length(),
			m_inputSchemaColumnsNumber,
			m_parametersNumber,
			nullptr,                    
			0,                          Length
			m_outputDataName,
			m_outputDataNameString.length());
		EXPECT_EQ(result, SQL_ERROR);
		CleanupSession();
		result = SQL_SUCCESS;
		result = (*sm_initSessionFuncPtr)(
			*m_sessionId,
			m_taskId,
			m_numTasks,
			m_script,
			m_scriptString.length(),
			m_inputSchemaColumnsNumber,
			m_parametersNumber,
			m_inputDataName,
			m_inputDataNameString.length(),
			nullptr,                    
			0);                         Length
		EXPECT_EQ(result, SQL_ERROR);
	}
TEST_F ( RExtensionApiTests , InitInvalidSessionTest ) { SQLRETURN result = SQL_SUCCESS ; result = ( * sm_initSessionFuncPtr ) ( * m_sessionId , m_taskId , m_numTasks , nullptr , 0 , m_inputSchemaColumnsNumber , m_parametersNumber , m_inputDataName , m_inputDataNameString . length ( ) , m_outputDataName , m_outputDataNameString . length ( ) ) ; EXPECT_EQ ( result , SQL_ERROR ) ; CleanupSession ( ) ; result = SQL_SUCCESS ; result = ( * sm_initSessionFuncPtr ) ( * m_sessionId , m_taskId , m_numTasks , m_script , m_scriptString . length ( ) , m_inputSchemaColumnsNumber , m_parametersNumber , nullptr , 0 , m_outputDataName , m_outputDataNameString . length ( ) ) ; EXPECT_EQ ( result , SQL_ERROR ) ; CleanupSession ( ) ; result = SQL_SUCCESS ; result = ( * sm_initSessionFuncPtr ) ( * m_sessionId , m_taskId , m_numTasks , m_script , m_scriptString . length ( ) , m_inputSchemaColumnsNumber , m_parametersNumber , m_inputDataName , m_inputDataNameString . length ( ) , nullptr , 0 ) ; EXPECT_EQ ( result , SQL_ERROR ) ; }
Name: InitInvalidSessionTest
Description:
Test InitSession() API with invalid values.
Name : InitInvalidSessionTest Description : Test InitSession () API with invalid values .
// script // scriptLength // inputDataName // inputDataNameLength // outputDataName // outputDataNameLength