mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
710 lines
18 KiB
710 lines
18 KiB
/*++
|
|
|
|
Copyright (c) 1995 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
itlucc.c
|
|
|
|
Abstract:
|
|
|
|
This module contains the test functions for lineUncompleteCall
|
|
|
|
Author:
|
|
|
|
Xiao Ying Ding (XiaoD) 31-Jan-1996
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
|
|
|
|
#include "windows.h"
|
|
#include "malloc.h"
|
|
#include "string.h"
|
|
#include "tapi.h"
|
|
#include "trapper.h"
|
|
#include "tcore.h"
|
|
#include "ttest.h"
|
|
#include "doline.h"
|
|
#include "vars.h"
|
|
#include "sline.h"
|
|
|
|
|
|
|
|
// lineUncompleteCall
|
|
//
|
|
// The following tests are made:
|
|
//
|
|
// Tested Notes
|
|
// -------------------------------------------------------------------------
|
|
// Go/No-Go test
|
|
//
|
|
// * = Stand-alone test case
|
|
//
|
|
//
|
|
|
|
BOOL TestLineUncompleteCall(BOOL fQuietMode, BOOL fStandAlone)
|
|
{
|
|
LPTAPILINETESTINFO lpTapiLineTestInfo;
|
|
INT n;
|
|
LPCALLBACKPARAMS lpCallbackParams;
|
|
ESPDEVSPECIFICINFO info;
|
|
BOOL fTestPassed = TRUE;
|
|
BOOL fUnimdm;
|
|
#ifdef WUNICODE
|
|
WCHAR wszValidAddress[] = L"55555";
|
|
#else
|
|
CHAR szValidAddress[] = "55555";
|
|
#endif
|
|
|
|
|
|
InitTestNumber();
|
|
TapiLineTestInit();
|
|
lpTapiLineTestInfo = GetLineTestInfo();
|
|
lpCallbackParams = GetCallbackParams();
|
|
|
|
OutputTAPIDebugInfo(
|
|
DBUG_SHOW_DETAIL,
|
|
"\n*****************************************************************************************");
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">>>>>>>> Begin testing lineUncompleteCall <<<<<<<<"
|
|
);
|
|
|
|
/*
|
|
// Initialize a line app
|
|
if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->dwDeviceID = 0;
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
if(IsUNIMDMLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
fUnimdm = TRUE;
|
|
}
|
|
else
|
|
fUnimdm = FALSE;
|
|
|
|
if(fUnimdm)
|
|
{
|
|
TapiLogDetail(
|
|
DBUG_SHOW_DETAIL,
|
|
"### Unimdm does not supported these apis");
|
|
|
|
// Shutdown and end the tests
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
return fTestPassed;
|
|
}
|
|
|
|
// Shutdown and end the tests
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
} */
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">> Test Case %ld: invalid hLine values", dwTestCase + 1
|
|
);
|
|
|
|
lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1;
|
|
lpTapiLineTestInfo->lpLineInitializeExParams =
|
|
(LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap (
|
|
sizeof(LINEINITIALIZEEXPARAMS));
|
|
lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize =
|
|
sizeof(LINEINITIALIZEEXPARAMS);
|
|
lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions =
|
|
LINEINITIALIZEEXOPTION_USEHIDDENWINDOW;
|
|
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER;
|
|
lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM;
|
|
|
|
if (! DoTapiLineFuncs(
|
|
lpTapiLineTestInfo,
|
|
LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN
|
|
))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->dwCompletionID = 0;
|
|
lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine);
|
|
for (n = 0; n < NUMINVALIDHANDLES; n++)
|
|
{
|
|
TapiLogDetail(
|
|
DBUG_SHOW_DETAIL,
|
|
"n= %ld", n);
|
|
*(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n];
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
fTestPassed = ShowTestCase(fTestPassed);
|
|
|
|
*(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig;
|
|
|
|
// Shutdown to isolate the test case
|
|
if (! DoTapiLineFuncs(
|
|
lpTapiLineTestInfo,
|
|
LSHUTDOWN
|
|
))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">> Test Case %ld: Success", dwTestCase + 1
|
|
);
|
|
|
|
|
|
// Initialize a line app
|
|
if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->dwDeviceID = 0;
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
|
|
// Negotiate the API Version
|
|
if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
// Open a line
|
|
lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM;
|
|
lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER;
|
|
|
|
if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
#ifdef WUNICODE
|
|
lpTapiLineTestInfo->lpwszDestAddress = L"55555";
|
|
#else
|
|
lpTapiLineTestInfo->lpszDestAddress = "55555";
|
|
#endif
|
|
lpTapiLineTestInfo->dwCountryCode = 0;
|
|
lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL;
|
|
|
|
if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID;
|
|
lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_CALLBACK;
|
|
lpTapiLineTestInfo->dwMessageID = 0;
|
|
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
if (! DoLineCompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_DETAIL,
|
|
"#### lpCallInfo->dwCompleionID = %lx",
|
|
*lpTapiLineTestInfo->lpdwCompletionID);
|
|
|
|
// call linecallinfo to verify the comepletion
|
|
|
|
lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap (
|
|
sizeof(LINECALLINFO));
|
|
lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO);
|
|
|
|
if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_DETAIL,
|
|
"#### lpCallInfo->dwCompleionID = %lx",
|
|
lpTapiLineTestInfo->lpCallInfo->dwCompletionID);
|
|
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
fTestPassed = ShowTestCase(fTestPassed);
|
|
|
|
|
|
// Close the line
|
|
if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Shutdown and end the tests
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">> Test Case %ld: Different dwCompletionID from lineCompleteCall", dwTestCase + 1
|
|
);
|
|
|
|
|
|
// Initialize a line app
|
|
if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
|
|
// Negotiate the API Version
|
|
if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
// Open a line
|
|
lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM;
|
|
lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER;
|
|
|
|
if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
#ifdef WUNICODE
|
|
lpTapiLineTestInfo->lpwszDestAddress = L"55555";
|
|
#else
|
|
lpTapiLineTestInfo->lpszDestAddress = "55555";
|
|
#endif
|
|
|
|
lpTapiLineTestInfo->dwCountryCode = 0;
|
|
lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL;
|
|
|
|
if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID;
|
|
lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_CALLBACK;
|
|
lpTapiLineTestInfo->dwMessageID = 0;
|
|
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
if (! DoLineCompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_DETAIL,
|
|
"#### lpCallInfo->dwCompleionID = %lx",
|
|
*lpTapiLineTestInfo->lpdwCompletionID);
|
|
|
|
// call linecallinfo to verify the comepletion
|
|
|
|
if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_DETAIL,
|
|
"#### lpCallInfo->dwCompleionID = %lx",
|
|
lpTapiLineTestInfo->lpCallInfo->dwCompletionID);
|
|
|
|
lpTapiLineTestInfo->dwCompletionID += 1;
|
|
|
|
// esp didn't check it, so it is not a test case
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
fTestPassed = ShowTestCase(fTestPassed);
|
|
|
|
|
|
// Close the line
|
|
if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Shutdown and end the tests
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">> Test Case %ld: Bad dwCompletionID (-1)", dwTestCase + 1
|
|
);
|
|
|
|
|
|
// Initialize a line app
|
|
if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
|
|
// Negotiate the API Version
|
|
if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
// Open a line
|
|
lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM;
|
|
lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER;
|
|
|
|
if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID;
|
|
lpTapiLineTestInfo->dwCompletionID = 0xffffffff;
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_INVALCOMPLETIONID, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
AddMessage(
|
|
LINE_REPLY,
|
|
(DWORD) lpTapiLineTestInfo->hLine1,
|
|
(DWORD) lpCallbackParams,
|
|
0x00000000,
|
|
(DWORD) LINEERR_INVALCOMPLETIONID,
|
|
0x00000000,
|
|
TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST |
|
|
TAPIMSG_DWPARAM2
|
|
);
|
|
|
|
if(WaitForAllMessages())
|
|
{
|
|
fTestPassed = TRUE;
|
|
}
|
|
else
|
|
{
|
|
fTestPassed = FALSE;
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
}
|
|
|
|
fTestPassed = ShowTestCase(fTestPassed);
|
|
|
|
|
|
// Close the line
|
|
if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Shutdown and end the tests
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
|
|
FreeTestHeap();
|
|
|
|
for(n = ESP_RESULT_CALLCOMPLPROCSYNC; n <= ESP_RESULT_CALLCOMPLPROCASYNC; n++)
|
|
{
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n
|
|
);
|
|
|
|
TapiLineTestInit();
|
|
lpTapiLineTestInfo = GetLineTestInfo();
|
|
lpCallbackParams = GetCallbackParams();
|
|
|
|
lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1;
|
|
lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1;
|
|
lpTapiLineTestInfo->lpLineInitializeExParams =
|
|
(LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap (
|
|
sizeof(LINEINITIALIZEEXPARAMS));
|
|
lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize =
|
|
sizeof(LINEINITIALIZEEXPARAMS);
|
|
lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions =
|
|
LINEINITIALIZEEXOPTION_USEHIDDENWINDOW;
|
|
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap(
|
|
sizeof(LINEDEVCAPS)
|
|
);
|
|
lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS);
|
|
lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM;
|
|
lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER;
|
|
lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS;
|
|
|
|
#ifdef WUNICODE
|
|
lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress;
|
|
#else
|
|
lpTapiLineTestInfo->lpszDestAddress = szValidAddress;
|
|
#endif
|
|
|
|
// Init a line
|
|
if (! DoTapiLineFuncs(
|
|
lpTapiLineTestInfo,
|
|
LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN
|
|
| LMAKECALL
|
|
))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
info.dwKey = ESPDEVSPECIFIC_KEY;
|
|
info.dwType = ESP_DEVSPEC_RESULT;
|
|
info.u.EspResult.lResult = TAPISUCCESS;
|
|
info.u.EspResult.dwCompletionType = n;
|
|
lpTapiLineTestInfo->lpParams = (LPVOID)&info;
|
|
lpTapiLineTestInfo->dwSize = sizeof(info);
|
|
|
|
if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->dwCompletionID = 0;
|
|
if ( ! DoLineUncompleteCall(lpTapiLineTestInfo, info.u.EspResult.lResult, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
}
|
|
fTestPassed = ShowTestCase(fTestPassed);
|
|
|
|
if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Shutdown to isolate the test case
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Free the memory allocated during the tests
|
|
FreeTestHeap();
|
|
}
|
|
|
|
for(n = ESP_RESULT_RETURNRESULT; n <= ESP_RESULT_CALLCOMPLPROCASYNC; n++)
|
|
{
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n
|
|
);
|
|
|
|
TapiLineTestInit();
|
|
lpTapiLineTestInfo = GetLineTestInfo();
|
|
lpCallbackParams = GetCallbackParams();
|
|
|
|
lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1;
|
|
lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1;
|
|
lpTapiLineTestInfo->lpLineInitializeExParams =
|
|
(LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap (
|
|
sizeof(LINEINITIALIZEEXPARAMS));
|
|
lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize =
|
|
sizeof(LINEINITIALIZEEXPARAMS);
|
|
lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions =
|
|
LINEINITIALIZEEXOPTION_USEHIDDENWINDOW;
|
|
|
|
lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion;
|
|
lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0;
|
|
lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION;
|
|
lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION;
|
|
lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap(
|
|
sizeof(LINEDEVCAPS)
|
|
);
|
|
lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS);
|
|
lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM;
|
|
lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER;
|
|
lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS;
|
|
|
|
#ifdef WUNICODE
|
|
lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress;
|
|
#else
|
|
lpTapiLineTestInfo->lpszDestAddress = szValidAddress;
|
|
#endif
|
|
|
|
// Init a line
|
|
if (! DoTapiLineFuncs(
|
|
lpTapiLineTestInfo,
|
|
LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN
|
|
| LMAKECALL
|
|
))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
if(IsESPLineDevice(lpTapiLineTestInfo))
|
|
{
|
|
info.dwKey = ESPDEVSPECIFIC_KEY;
|
|
info.dwType = ESP_DEVSPEC_RESULT;
|
|
info.u.EspResult.lResult = LINEERR_INVALCOMPLETIONID;
|
|
info.u.EspResult.dwCompletionType = n;
|
|
lpTapiLineTestInfo->lpParams = (LPVOID)&info;
|
|
lpTapiLineTestInfo->dwSize = sizeof(info);
|
|
|
|
if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
lpTapiLineTestInfo->fCompletionModeSet = TRUE;
|
|
if ( ! DoLineUncompleteCall(lpTapiLineTestInfo, info.u.EspResult.lResult, FALSE))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
AddMessage(
|
|
LINE_REPLY,
|
|
(DWORD) lpTapiLineTestInfo->hCall1,
|
|
(DWORD) lpCallbackParams,
|
|
0x00000000,
|
|
info.u.EspResult.lResult,
|
|
0x00000000,
|
|
TAPIMSG_DWMSG | TAPIMSG_DWPARAM2
|
|
);
|
|
|
|
if( !WaitForAllMessages())
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
|
|
lpTapiLineTestInfo->fCompletionModeSet = FALSE;
|
|
}
|
|
fTestPassed = ShowTestCase(fTestPassed);
|
|
|
|
if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Shutdown to isolate the test case
|
|
if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS))
|
|
{
|
|
TLINE_FAIL();
|
|
}
|
|
|
|
// Free the memory allocated during the tests
|
|
FreeTestHeap();
|
|
}
|
|
|
|
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
"@@ lineUncompleteCall: Total Test Case = %ld, Passed = %ld, Failed = %ld",
|
|
dwTestCase, dwTestCasePassed, dwTestCaseFailed);
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
"@@ Total Test Case = %ld, Passed = %ld, Failed = %ld",
|
|
dwglTestCase, dwglTestCasePassed, dwglTestCaseFailed);
|
|
if(dwTestCaseFailed > 0)
|
|
fTestPassed = FALSE;
|
|
|
|
TapiLogDetail(
|
|
DBUG_SHOW_PASS,
|
|
">>>>>>>> End testing lineUncompleteCall <<<<<<<<"
|
|
);
|
|
|
|
return fTestPassed;
|
|
}
|
|
|
|
|