From e611b132f9b8abe35b362e5870b74bce94a1e58e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 16 May 2020 20:51:50 -0700 Subject: initial commit --- private/tapi/qa/trapper/apilist.xls | Bin 0 -> 51512 bytes private/tapi/qa/trapper/dirs | 24 + private/tapi/qa/trapper/fiesta.xls | Bin 0 -> 266752 bytes private/tapi/qa/trapper/itest/cline/cline.c | 316 + private/tapi/qa/trapper/itest/cline/cline.def | 24 + private/tapi/qa/trapper/itest/cline/cline.h | 183 + private/tapi/qa/trapper/itest/cline/cline.rc | 13 + private/tapi/qa/trapper/itest/cline/itlatc.c | 242 + private/tapi/qa/trapper/itest/cline/itlcc.c | 203 + private/tapi/qa/trapper/itest/cline/itlgcrc.c | 246 + private/tapi/qa/trapper/itest/cline/itlpatc.c | 260 + private/tapi/qa/trapper/itest/cline/itlrd.c | 181 + private/tapi/qa/trapper/itest/cline/itlrfc.c | 272 + private/tapi/qa/trapper/itest/cline/itlsc.c | 180 + private/tapi/qa/trapper/itest/cline/itlsh.c | 263 + private/tapi/qa/trapper/itest/cline/itlsuc.c | 179 + private/tapi/qa/trapper/itest/cline/ittgli.c | 112 + private/tapi/qa/trapper/itest/cline/ittrd.c | 91 + private/tapi/qa/trapper/itest/cline/ittrmc.c | 191 + private/tapi/qa/trapper/itest/cline/ittrmec.c | 98 + private/tapi/qa/trapper/itest/cline/makefile | 6 + private/tapi/qa/trapper/itest/cline/sources | 74 + private/tapi/qa/trapper/itest/dirs | 23 + private/tapi/qa/trapper/itest/iline/iline.c | 335 + private/tapi/qa/trapper/itest/iline/iline.def | 22 + private/tapi/qa/trapper/itest/iline/iline.h | 200 + private/tapi/qa/trapper/itest/iline/iline.rc | 13 + private/tapi/qa/trapper/itest/iline/itlac.c | 254 + private/tapi/qa/trapper/itest/iline/itlas.c | 250 + private/tapi/qa/trapper/itest/iline/itlbt.c | 179 + private/tapi/qa/trapper/itest/iline/itlct.c | 198 + private/tapi/qa/trapper/itest/iline/itlfw.c | 186 + private/tapi/qa/trapper/itest/iline/itlh.c | 222 + private/tapi/qa/trapper/itest/iline/itlnev.c | 212 + private/tapi/qa/trapper/itest/iline/itlruui.c | 195 + private/tapi/qa/trapper/itest/iline/itlsas.c | 242 + private/tapi/qa/trapper/itest/iline/itlst.c | 182 + private/tapi/qa/trapper/itest/iline/itlsuui.c | 208 + private/tapi/qa/trapper/itest/iline/itluh.c | 255 + private/tapi/qa/trapper/itest/iline/makefile | 6 + private/tapi/qa/trapper/itest/iline/sources | 70 + private/tapi/qa/trapper/itest/line/dirs | 3 + private/tapi/qa/trapper/itest/line/itlc.c | 1541 +++ private/tapi/qa/trapper/itest/line/itldc.c | 523 + private/tapi/qa/trapper/itest/line/itldial.c | 774 ++ private/tapi/qa/trapper/itest/line/itldrop.c | 781 ++ private/tapi/qa/trapper/itest/line/itlgac.c | 919 ++ private/tapi/qa/trapper/itest/line/itlgaid.c | 796 ++ private/tapi/qa/trapper/itest/line/itlgas.c | 615 + private/tapi/qa/trapper/itest/line/itlgci.c | 553 + private/tapi/qa/trapper/itest/line/itlgcs.c | 559 + private/tapi/qa/trapper/itest/line/itlgdc.c | 853 ++ private/tapi/qa/trapper/itest/line/itlgid.c | 965 ++ private/tapi/qa/trapper/itest/line/itlglds.c | 546 + private/tapi/qa/trapper/itest/line/itlgnc.c | 954 ++ private/tapi/qa/trapper/itest/line/itlgnr.c | 434 + private/tapi/qa/trapper/itest/line/itlgpl.c | 168 + private/tapi/qa/trapper/itest/line/itlgsm.c | 505 + private/tapi/qa/trapper/itest/line/itli.c | 561 + private/tapi/qa/trapper/itest/line/itlmc.c | 1198 ++ private/tapi/qa/trapper/itest/line/itlmc1.c | 8931 ++++++++++++ private/tapi/qa/trapper/itest/line/itlmc2.c | 8932 ++++++++++++ private/tapi/qa/trapper/itest/line/itlnapiv.c | 625 + private/tapi/qa/trapper/itest/line/itlo.c | 1129 ++ private/tapi/qa/trapper/itest/line/itls.c | 993 ++ private/tapi/qa/trapper/itest/line/itlscp.c | 548 + private/tapi/qa/trapper/itest/line/itlsnr.c | 255 + private/tapi/qa/trapper/itest/line/itlssm.c | 681 + private/tapi/qa/trapper/itest/line/line.inc | 82 + private/tapi/qa/trapper/itest/line/linea/makefile | 6 + private/tapi/qa/trapper/itest/line/linea/sources | 35 + private/tapi/qa/trapper/itest/line/linew/makefile | 6 + private/tapi/qa/trapper/itest/line/linew/sources | 36 + private/tapi/qa/trapper/itest/line/tline.c | 409 + private/tapi/qa/trapper/itest/line/tline.def | 36 + private/tapi/qa/trapper/itest/line/tline.h | 446 + private/tapi/qa/trapper/itest/line/tline.rc | 12 + private/tapi/qa/trapper/itest/line/uline.c | 390 + private/tapi/qa/trapper/itest/line20/itlas.c | 192 + private/tapi/qa/trapper/itest/line20/itlgaal.c | 211 + private/tapi/qa/trapper/itest/line20/itlgac.c | 208 + private/tapi/qa/trapper/itest/line20/itlgagl.c | 212 + private/tapi/qa/trapper/itest/line20/itlgas.c | 212 + private/tapi/qa/trapper/itest/line20/itlgm.c | 151 + private/tapi/qa/trapper/itest/line20/itlie.c | 102 + private/tapi/qa/trapper/itest/line20/itlpm.c | 176 + private/tapi/qa/trapper/itest/line20/itlpr.c | 201 + private/tapi/qa/trapper/itest/line20/itlsaa.c | 198 + private/tapi/qa/trapper/itest/line20/itlsag.c | 201 + private/tapi/qa/trapper/itest/line20/itlsas.c | 200 + private/tapi/qa/trapper/itest/line20/line20.c | 310 + private/tapi/qa/trapper/itest/line20/line20.def | 22 + private/tapi/qa/trapper/itest/line20/line20.h | 248 + private/tapi/qa/trapper/itest/line20/line20.rc | 13 + private/tapi/qa/trapper/itest/line20/makefile | 6 + private/tapi/qa/trapper/itest/line20/sources | 70 + private/tapi/qa/trapper/itest/phone/itpc.c | 140 + private/tapi/qa/trapper/itest/phone/itpcd.c | 120 + private/tapi/qa/trapper/itest/phone/itpds.c | 152 + private/tapi/qa/trapper/itest/phone/itpgbi.c | 165 + private/tapi/qa/trapper/itest/phone/itpgd.c | 152 + private/tapi/qa/trapper/itest/phone/itpgdc.c | 141 + private/tapi/qa/trapper/itest/phone/itpgdp.c | 159 + private/tapi/qa/trapper/itest/phone/itpgg.c | 151 + private/tapi/qa/trapper/itest/phone/itpghs.c | 154 + private/tapi/qa/trapper/itest/phone/itpgi.c | 148 + private/tapi/qa/trapper/itest/phone/itpgid.c | 152 + private/tapi/qa/trapper/itest/phone/itpgl.c | 155 + private/tapi/qa/trapper/itest/phone/itpgm.c | 151 + private/tapi/qa/trapper/itest/phone/itpgr.c | 158 + private/tapi/qa/trapper/itest/phone/itpgs.c | 155 + private/tapi/qa/trapper/itest/phone/itpgsm.c | 162 + private/tapi/qa/trapper/itest/phone/itpgv.c | 151 + private/tapi/qa/trapper/itest/phone/itpi.c | 94 + private/tapi/qa/trapper/itest/phone/itpie.c | 105 + private/tapi/qa/trapper/itest/phone/itpnav.c | 116 + private/tapi/qa/trapper/itest/phone/itpne.c | 138 + private/tapi/qa/trapper/itest/phone/itpo.c | 140 + private/tapi/qa/trapper/itest/phone/itps.c | 105 + private/tapi/qa/trapper/itest/phone/itpsbi.c | 187 + private/tapi/qa/trapper/itest/phone/itpsd.c | 176 + private/tapi/qa/trapper/itest/phone/itpsdp.c | 188 + private/tapi/qa/trapper/itest/phone/itpsg.c | 162 + private/tapi/qa/trapper/itest/phone/itpshs.c | 170 + private/tapi/qa/trapper/itest/phone/itpsl.c | 166 + private/tapi/qa/trapper/itest/phone/itpsr.c | 170 + private/tapi/qa/trapper/itest/phone/itpssm.c | 174 + private/tapi/qa/trapper/itest/phone/itpsv.c | 167 + private/tapi/qa/trapper/itest/phone/makefile | 6 + private/tapi/qa/trapper/itest/phone/sources | 91 + private/tapi/qa/trapper/itest/phone/tphone.c | 491 + private/tapi/qa/trapper/itest/phone/tphone.def | 42 + private/tapi/qa/trapper/itest/phone/tphone.h | 293 + private/tapi/qa/trapper/itest/phone/tphone.rc | 11 + private/tapi/qa/trapper/itest/sline/itlgad.c | 183 + private/tapi/qa/trapper/itest/sline/itlgap.c | 158 + private/tapi/qa/trapper/itest/sline/itlmod.c | 170 + private/tapi/qa/trapper/itest/sline/itlmom.c | 171 + private/tapi/qa/trapper/itest/sline/itlmot.c | 171 + private/tapi/qa/trapper/itest/sline/itlpak.c | 176 + private/tapi/qa/trapper/itest/sline/itlpk.c | 162 + private/tapi/qa/trapper/itest/sline/itlsap.c | 158 + private/tapi/qa/trapper/itest/sline/itlscd.c | 201 + private/tapi/qa/trapper/itest/sline/itlscl.c | 184 + private/tapi/qa/trapper/itest/sline/itlscqs.c | 235 + private/tapi/qa/trapper/itest/sline/itlsct.c | 226 + private/tapi/qa/trapper/itest/sline/itlslds.c | 189 + private/tapi/qa/trapper/itest/sline/itlucc.c | 210 + private/tapi/qa/trapper/itest/sline/itlupak.c | 166 + private/tapi/qa/trapper/itest/sline/makefile | 6 + private/tapi/qa/trapper/itest/sline/sline.c | 337 + private/tapi/qa/trapper/itest/sline/sline.def | 25 + private/tapi/qa/trapper/itest/sline/sline.h | 294 + private/tapi/qa/trapper/itest/sline/sline.rc | 13 + private/tapi/qa/trapper/itest/sline/sources | 74 + private/tapi/qa/trapper/itest/tcline/cline.c | 328 + private/tapi/qa/trapper/itest/tcline/cline.def | 25 + private/tapi/qa/trapper/itest/tcline/cline.h | 189 + private/tapi/qa/trapper/itest/tcline/cline.rc | 13 + private/tapi/qa/trapper/itest/tcline/dirs | 2 + private/tapi/qa/trapper/itest/tcline/itlatc.c | 1663 +++ private/tapi/qa/trapper/itest/tcline/itlcc.c | 1057 ++ private/tapi/qa/trapper/itest/tcline/itlgcrc.c | 927 ++ private/tapi/qa/trapper/itest/tcline/itlpatc.c | 950 ++ private/tapi/qa/trapper/itest/tcline/itlrd.c | 564 + private/tapi/qa/trapper/itest/tcline/itlrfc.c | 653 + private/tapi/qa/trapper/itest/tcline/itlsc.c | 476 + private/tapi/qa/trapper/itest/tcline/itlsh.c | 765 + private/tapi/qa/trapper/itest/tcline/itlsuc.c | 1291 ++ private/tapi/qa/trapper/itest/tcline/ittgli.c | 278 + private/tapi/qa/trapper/itest/tcline/ittrd.c | 123 + private/tapi/qa/trapper/itest/tcline/ittrmc.c | 616 + private/tapi/qa/trapper/itest/tcline/ittrmec.c | 408 + private/tapi/qa/trapper/itest/tcline/tcline.def | 25 + private/tapi/qa/trapper/itest/tcline/tcline.inc | 73 + .../tapi/qa/trapper/itest/tcline/tclinea/makefile | 6 + .../tapi/qa/trapper/itest/tcline/tclinea/sources | 35 + .../tapi/qa/trapper/itest/tcline/tclinew/makefile | 6 + .../tapi/qa/trapper/itest/tcline/tclinew/sources | 36 + private/tapi/qa/trapper/itest/tcline/uline.c | 188 + private/tapi/qa/trapper/itest/testapp/dirs | 2 + private/tapi/qa/trapper/itest/testapp/testapp.c | 365 + private/tapi/qa/trapper/itest/testapp/testapp.def | 25 + private/tapi/qa/trapper/itest/testapp/testapp.h | 16 + private/tapi/qa/trapper/itest/testapp/testapp.inc | 56 + private/tapi/qa/trapper/itest/testapp/testapp.rc | 24 + .../qa/trapper/itest/testapp/testappa/makefile | 6 + .../tapi/qa/trapper/itest/testapp/testappa/sources | 45 + .../qa/trapper/itest/testapp/testappw/makefile | 6 + .../tapi/qa/trapper/itest/testapp/testappw/sources | 43 + private/tapi/qa/trapper/itest/tiline/dirs | 2 + private/tapi/qa/trapper/itest/tiline/iline.c | 362 + private/tapi/qa/trapper/itest/tiline/iline.h | 218 + .../tapi/qa/trapper/itest/tiline/ilinea/makefile | 6 + .../tapi/qa/trapper/itest/tiline/ilinea/sources | 35 + .../tapi/qa/trapper/itest/tiline/ilinew/makefile | 6 + .../tapi/qa/trapper/itest/tiline/ilinew/sources | 36 + private/tapi/qa/trapper/itest/tiline/itlac.c | 1653 +++ private/tapi/qa/trapper/itest/tiline/itlas.c | 1620 +++ private/tapi/qa/trapper/itest/tiline/itlbt.c | 856 ++ private/tapi/qa/trapper/itest/tiline/itlct.c | 1748 +++ private/tapi/qa/trapper/itest/tiline/itlfw.c | 13814 +++++++++++++++++++ private/tapi/qa/trapper/itest/tiline/itlfw1.c | 9240 +++++++++++++ private/tapi/qa/trapper/itest/tiline/itlfw2.c | 9236 +++++++++++++ private/tapi/qa/trapper/itest/tiline/itlh.c | 477 + private/tapi/qa/trapper/itest/tiline/itlnev.c | 609 + private/tapi/qa/trapper/itest/tiline/itlruui.c | 730 + private/tapi/qa/trapper/itest/tiline/itlsas.c | 467 + private/tapi/qa/trapper/itest/tiline/itlst.c | 1340 ++ private/tapi/qa/trapper/itest/tiline/itlsuui.c | 1220 ++ private/tapi/qa/trapper/itest/tiline/itluh.c | 510 + private/tapi/qa/trapper/itest/tiline/test.c | 170 + private/tapi/qa/trapper/itest/tiline/testx.c | 83 + private/tapi/qa/trapper/itest/tiline/testy.c | 95 + private/tapi/qa/trapper/itest/tiline/tiline.def | 25 + private/tapi/qa/trapper/itest/tiline/tiline.inc | 69 + private/tapi/qa/trapper/itest/tiline/uline.c | 217 + private/tapi/qa/trapper/itest/tiline/version.rc | 11 + private/tapi/qa/trapper/itest/tline20/dirs | 2 + private/tapi/qa/trapper/itest/tline20/itlas.c | 917 ++ private/tapi/qa/trapper/itest/tline20/itlgaal.c | 974 ++ private/tapi/qa/trapper/itest/tline20/itlgac.c | 1307 ++ private/tapi/qa/trapper/itest/tline20/itlgagl.c | 982 ++ private/tapi/qa/trapper/itest/tline20/itlgas.c | 879 ++ private/tapi/qa/trapper/itest/tline20/itlgm.c | 366 + private/tapi/qa/trapper/itest/tline20/itlie.c | 1898 +++ private/tapi/qa/trapper/itest/tline20/itlpm.c | 800 ++ private/tapi/qa/trapper/itest/tline20/itlpr.c | 689 + private/tapi/qa/trapper/itest/tline20/itlsaa.c | 627 + private/tapi/qa/trapper/itest/tline20/itlsag.c | 828 ++ private/tapi/qa/trapper/itest/tline20/itlsas.c | 949 ++ private/tapi/qa/trapper/itest/tline20/line20.c | 440 + private/tapi/qa/trapper/itest/tline20/line20.h | 266 + private/tapi/qa/trapper/itest/tline20/tline20.def | 23 + private/tapi/qa/trapper/itest/tline20/tline20.inc | 69 + .../qa/trapper/itest/tline20/tline20a/makefile | 6 + .../tapi/qa/trapper/itest/tline20/tline20a/sources | 35 + .../qa/trapper/itest/tline20/tline20w/makefile | 6 + .../tapi/qa/trapper/itest/tline20/tline20w/sources | 36 + private/tapi/qa/trapper/itest/tline20/uline.c | 431 + private/tapi/qa/trapper/itest/tline20/version.rc | 11 + private/tapi/qa/trapper/itest/tphone/dirs | 2 + private/tapi/qa/trapper/itest/tphone/itpc.c | 1553 +++ private/tapi/qa/trapper/itest/tphone/itpcd.c | 740 + private/tapi/qa/trapper/itest/tphone/itpds.c | 776 ++ private/tapi/qa/trapper/itest/tphone/itpgbi.c | 901 ++ private/tapi/qa/trapper/itest/tphone/itpgd.c | 895 ++ private/tapi/qa/trapper/itest/tphone/itpgdc.c | 961 ++ private/tapi/qa/trapper/itest/tphone/itpgdp.c | 772 ++ private/tapi/qa/trapper/itest/tphone/itpgg.c | 888 ++ private/tapi/qa/trapper/itest/tphone/itpghs.c | 612 + private/tapi/qa/trapper/itest/tphone/itpgi.c | 943 ++ private/tapi/qa/trapper/itest/tphone/itpgid.c | 759 + private/tapi/qa/trapper/itest/tphone/itpgl.c | 648 + private/tapi/qa/trapper/itest/tphone/itpgm.c | 363 + private/tapi/qa/trapper/itest/tphone/itpgr.c | 840 ++ private/tapi/qa/trapper/itest/tphone/itpgs.c | 774 ++ private/tapi/qa/trapper/itest/tphone/itpgsm.c | 1067 ++ private/tapi/qa/trapper/itest/tphone/itpgv.c | 877 ++ private/tapi/qa/trapper/itest/tphone/itpi.c | 712 + private/tapi/qa/trapper/itest/tphone/itpie.c | 1619 +++ private/tapi/qa/trapper/itest/tphone/itpnav.c | 640 + private/tapi/qa/trapper/itest/tphone/itpne.c | 839 ++ private/tapi/qa/trapper/itest/tphone/itpo.c | 1672 +++ private/tapi/qa/trapper/itest/tphone/itps.c | 813 ++ private/tapi/qa/trapper/itest/tphone/itpsbi.c | 2218 +++ private/tapi/qa/trapper/itest/tphone/itpsd.c | 973 ++ private/tapi/qa/trapper/itest/tphone/itpsdp.c | 1000 ++ private/tapi/qa/trapper/itest/tphone/itpsg.c | 1017 ++ private/tapi/qa/trapper/itest/tphone/itpshs.c | 1157 ++ private/tapi/qa/trapper/itest/tphone/itpsl.c | 922 ++ private/tapi/qa/trapper/itest/tphone/itpsr.c | 789 ++ private/tapi/qa/trapper/itest/tphone/itpssm.c | 1646 +++ private/tapi/qa/trapper/itest/tphone/itpsv.c | 1018 ++ private/tapi/qa/trapper/itest/tphone/msgphone.c | 504 + private/tapi/qa/trapper/itest/tphone/tphone.c | 510 + private/tapi/qa/trapper/itest/tphone/tphone.h | 305 + private/tapi/qa/trapper/itest/tphone/tphone.inc | 90 + .../tapi/qa/trapper/itest/tphone/tphonea/makefile | 6 + .../tapi/qa/trapper/itest/tphone/tphonea/sources | 35 + .../tapi/qa/trapper/itest/tphone/tphonew/makefile | 6 + .../tapi/qa/trapper/itest/tphone/tphonew/sources | 36 + private/tapi/qa/trapper/itest/tphone/ttphone.def | 44 + private/tapi/qa/trapper/itest/tphone/uline.c | 543 + private/tapi/qa/trapper/itest/tphone/version.rc | 11 + private/tapi/qa/trapper/itest/tsline/dirs | 2 + private/tapi/qa/trapper/itest/tsline/itlgad.c | 1509 ++ private/tapi/qa/trapper/itest/tsline/itlgap.c | 1142 ++ private/tapi/qa/trapper/itest/tsline/itlmod.c | 678 + private/tapi/qa/trapper/itest/tsline/itlmom.c | 690 + private/tapi/qa/trapper/itest/tsline/itlmot.c | 832 ++ private/tapi/qa/trapper/itest/tsline/itlpak.c | 1109 ++ private/tapi/qa/trapper/itest/tsline/itlpk.c | 879 ++ private/tapi/qa/trapper/itest/tsline/itlsap.c | 966 ++ private/tapi/qa/trapper/itest/tsline/itlscd.c | 714 + private/tapi/qa/trapper/itest/tsline/itlscl.c | 422 + private/tapi/qa/trapper/itest/tsline/itlscqs.c | 955 ++ private/tapi/qa/trapper/itest/tsline/itlsct.c | 873 ++ private/tapi/qa/trapper/itest/tsline/itlslds.c | 725 + private/tapi/qa/trapper/itest/tsline/itlucc.c | 710 + private/tapi/qa/trapper/itest/tsline/itlupak.c | 645 + private/tapi/qa/trapper/itest/tsline/sline.c | 347 + private/tapi/qa/trapper/itest/tsline/sline.h | 308 + private/tapi/qa/trapper/itest/tsline/sline.rc | 11 + private/tapi/qa/trapper/itest/tsline/tsline.def | 26 + private/tapi/qa/trapper/itest/tsline/tsline.inc | 73 + .../tapi/qa/trapper/itest/tsline/tslinea/makefile | 6 + .../tapi/qa/trapper/itest/tsline/tslinea/sources | 35 + .../tapi/qa/trapper/itest/tsline/tslinew/makefile | 6 + .../tapi/qa/trapper/itest/tsline/tslinew/sources | 36 + private/tapi/qa/trapper/itest/tsline/uline.c | 277 + private/tapi/qa/trapper/itest/ttest.c | 2583 ++++ private/tapi/qa/trapper/itest/ttest.def | 30 + private/tapi/qa/trapper/itest/ttest.h | 278 + private/tapi/qa/trapper/itest/ttest.inc | 54 + private/tapi/qa/trapper/itest/ttesta/makefile | 6 + private/tapi/qa/trapper/itest/ttesta/sources | 36 + private/tapi/qa/trapper/itest/ttestw/makefile | 6 + private/tapi/qa/trapper/itest/ttestw/sources | 37 + private/tapi/qa/trapper/itest/txline/dirs | 2 + private/tapi/qa/trapper/itest/txline/itlcd.c | 541 + private/tapi/qa/trapper/itest/txline/itlcde.c | 617 + private/tapi/qa/trapper/itest/txline/itlds.c | 885 ++ private/tapi/qa/trapper/itest/txline/itldsf.c | 618 + private/tapi/qa/trapper/itest/txline/itlgdcf.c | 631 + private/tapi/qa/trapper/itest/txline/itlgr.c | 868 ++ private/tapi/qa/trapper/itest/txline/itlrrr.c | 633 + private/tapi/qa/trapper/itest/txline/itlscp.c | 727 + private/tapi/qa/trapper/itest/txline/itlsdcf.c | 649 + private/tapi/qa/trapper/itest/txline/itlsmc.c | 1543 +++ private/tapi/qa/trapper/itest/txline/itlsmm.c | 766 + private/tapi/qa/trapper/itest/txline/itlst.c | 870 ++ private/tapi/qa/trapper/itest/txline/itlstl.c | 627 + private/tapi/qa/trapper/itest/txline/msgline.c | 1422 ++ private/tapi/qa/trapper/itest/txline/txline.def | 25 + private/tapi/qa/trapper/itest/txline/txline.inc | 73 + .../tapi/qa/trapper/itest/txline/txlinea/makefile | 6 + .../tapi/qa/trapper/itest/txline/txlinea/sources | 35 + .../tapi/qa/trapper/itest/txline/txlinew/makefile | 6 + .../tapi/qa/trapper/itest/txline/txlinew/sources | 36 + private/tapi/qa/trapper/itest/txline/uline.c | 242 + private/tapi/qa/trapper/itest/txline/xline.c | 335 + private/tapi/qa/trapper/itest/txline/xline.def | 25 + private/tapi/qa/trapper/itest/txline/xline.h | 193 + private/tapi/qa/trapper/itest/txline/xline.rc | 12 + private/tapi/qa/trapper/itest/tyline/dirs | 2 + private/tapi/qa/trapper/itest/tyline/itlap.c | 694 + private/tapi/qa/trapper/itest/tyline/itlcp.c | 549 + private/tapi/qa/trapper/itest/tyline/itlgc.c | 703 + private/tapi/qa/trapper/itest/tyline/itlgdt.c | 903 ++ private/tapi/qa/trapper/itest/tyline/itlgi.c | 596 + private/tapi/qa/trapper/itest/tyline/itlgpl.c | 438 + private/tapi/qa/trapper/itest/tyline/itlgtc.c | 357 + private/tapi/qa/trapper/itest/tyline/itlgtn.c | 1030 ++ private/tapi/qa/trapper/itest/tyline/itlho.c | 594 + private/tapi/qa/trapper/itest/tyline/itlrp.c | 552 + private/tapi/qa/trapper/itest/tyline/itlta.c | 743 + private/tapi/qa/trapper/itest/tyline/itltd.c | 634 + private/tapi/qa/trapper/itest/tyline/test1.xls | Bin 0 -> 17408 bytes private/tapi/qa/trapper/itest/tyline/test2.xls | Bin 0 -> 17408 bytes private/tapi/qa/trapper/itest/tyline/tyline.def | 23 + private/tapi/qa/trapper/itest/tyline/tyline.inc | 69 + .../tapi/qa/trapper/itest/tyline/tylinea/makefile | 6 + .../tapi/qa/trapper/itest/tyline/tylinea/sources | 35 + .../tapi/qa/trapper/itest/tyline/tylinew/makefile | 6 + .../tapi/qa/trapper/itest/tyline/tylinew/sources | 36 + private/tapi/qa/trapper/itest/tyline/uline.c | 254 + private/tapi/qa/trapper/itest/tyline/yline.c | 316 + private/tapi/qa/trapper/itest/tyline/yline.def | 23 + private/tapi/qa/trapper/itest/tyline/yline.h | 181 + private/tapi/qa/trapper/itest/tyline/yline.rc | 11 + private/tapi/qa/trapper/itest/uline/dirs | 3 + private/tapi/qa/trapper/itest/uline/uline.c | 247 + private/tapi/qa/trapper/itest/uline/uline.def | 17 + private/tapi/qa/trapper/itest/uline/uline.h | 187 + private/tapi/qa/trapper/itest/uline/uline.inc | 65 + private/tapi/qa/trapper/itest/uline/uline.rc | 11 + .../tapi/qa/trapper/itest/uline/ulinea/makefile | 6 + private/tapi/qa/trapper/itest/uline/ulinea/sources | 35 + .../tapi/qa/trapper/itest/uline/ulinew/makefile | 6 + private/tapi/qa/trapper/itest/uline/ulinew/sources | 36 + private/tapi/qa/trapper/itest/uline/utcline.c | 188 + private/tapi/qa/trapper/itest/uline/utiline.c | 215 + private/tapi/qa/trapper/itest/uline/utline.c | 387 + private/tapi/qa/trapper/itest/uline/utline20.c | 433 + private/tapi/qa/trapper/itest/uline/utsline.c | 277 + private/tapi/qa/trapper/itest/uline/utxline.c | 242 + private/tapi/qa/trapper/itest/uline/utyline.c | 255 + private/tapi/qa/trapper/itest/version.rc | 11 + private/tapi/qa/trapper/itest/wline/makefile | 6 + private/tapi/qa/trapper/itest/wline/readme.txt | 64 + private/tapi/qa/trapper/itest/wline/sources | 89 + private/tapi/qa/trapper/itest/wline/version.rc | 11 + private/tapi/qa/trapper/itest/wline/witlap.c | 246 + private/tapi/qa/trapper/itest/wline/witlbt.c | 189 + private/tapi/qa/trapper/itest/wline/witlcd.c | 154 + private/tapi/qa/trapper/itest/wline/witlcde.c | 236 + private/tapi/qa/trapper/itest/wline/witlfw.c | 188 + private/tapi/qa/trapper/itest/wline/witlgaal.c | 214 + private/tapi/qa/trapper/itest/wline/witlgad.c | 203 + private/tapi/qa/trapper/itest/wline/witlgap.c | 165 + private/tapi/qa/trapper/itest/wline/witlgc.c | 155 + private/tapi/qa/trapper/itest/wline/witlgdcf.c | 158 + private/tapi/qa/trapper/itest/wline/witlgdt.c | 189 + private/tapi/qa/trapper/itest/wline/witlgi.c | 146 + private/tapi/qa/trapper/itest/wline/witlgr.c | 179 + private/tapi/qa/trapper/itest/wline/witlgtc.c | 198 + private/tapi/qa/trapper/itest/wline/witlho.c | 227 + private/tapi/qa/trapper/itest/wline/witlie.c | 104 + private/tapi/qa/trapper/itest/wline/witlpak.c | 191 + private/tapi/qa/trapper/itest/wline/witlpatc.c | 259 + private/tapi/qa/trapper/itest/wline/witlpk.c | 171 + private/tapi/qa/trapper/itest/wline/witlrd.c | 193 + private/tapi/qa/trapper/itest/wline/witlsap.c | 165 + private/tapi/qa/trapper/itest/wline/witlsdcf.c | 175 + private/tapi/qa/trapper/itest/wline/witlst.c | 189 + private/tapi/qa/trapper/itest/wline/witlstl.c | 151 + private/tapi/qa/trapper/itest/wline/witlsuc.c | 181 + private/tapi/qa/trapper/itest/wline/witlta.c | 179 + private/tapi/qa/trapper/itest/wline/witltd.c | 195 + private/tapi/qa/trapper/itest/wline/witlupak.c | 172 + private/tapi/qa/trapper/itest/wline/wittgli.c | 140 + private/tapi/qa/trapper/itest/wline/wittrmc.c | 132 + private/tapi/qa/trapper/itest/wline/wittrmec.c | 114 + private/tapi/qa/trapper/itest/wline/wline.c | 508 + private/tapi/qa/trapper/itest/wline/wline.def | 41 + private/tapi/qa/trapper/itest/wline/wline.h | 311 + private/tapi/qa/trapper/itest/wphone/makefile | 6 + private/tapi/qa/trapper/itest/wphone/sources | 66 + private/tapi/qa/trapper/itest/wphone/wphone.c | 266 + private/tapi/qa/trapper/itest/wphone/wphone.def | 19 + private/tapi/qa/trapper/itest/wphone/wphone.h | 136 + private/tapi/qa/trapper/itest/wphone/wtpcd.c | 114 + private/tapi/qa/trapper/itest/wphone/wtpgbi.c | 156 + private/tapi/qa/trapper/itest/wphone/wtpgdc.c | 133 + private/tapi/qa/trapper/itest/wphone/wtpgi.c | 143 + private/tapi/qa/trapper/itest/wphone/wtpgid.c | 148 + private/tapi/qa/trapper/itest/wphone/wtpgs.c | 147 + private/tapi/qa/trapper/itest/wphone/wtpi.c | 88 + private/tapi/qa/trapper/itest/wphone/wtpie.c | 97 + private/tapi/qa/trapper/itest/wphone/wtpsbi.c | 185 + private/tapi/qa/trapper/itest/xline/itlcd.c | 144 + private/tapi/qa/trapper/itest/xline/itlcde.c | 230 + private/tapi/qa/trapper/itest/xline/itlds.c | 202 + private/tapi/qa/trapper/itest/xline/itldsf.c | 188 + private/tapi/qa/trapper/itest/xline/itlgdcf.c | 159 + private/tapi/qa/trapper/itest/xline/itlgr.c | 169 + private/tapi/qa/trapper/itest/xline/itlrrr.c | 187 + private/tapi/qa/trapper/itest/xline/itlscp.c | 257 + private/tapi/qa/trapper/itest/xline/itlsdcf.c | 176 + private/tapi/qa/trapper/itest/xline/itlsmc.c | 234 + private/tapi/qa/trapper/itest/xline/itlsmm.c | 201 + private/tapi/qa/trapper/itest/xline/itlst.c | 256 + private/tapi/qa/trapper/itest/xline/itlstl.c | 144 + private/tapi/qa/trapper/itest/xline/makefile | 6 + private/tapi/qa/trapper/itest/xline/sources | 72 + private/tapi/qa/trapper/itest/xline/xline.c | 316 + private/tapi/qa/trapper/itest/xline/xline.def | 23 + private/tapi/qa/trapper/itest/xline/xline.h | 178 + private/tapi/qa/trapper/itest/xline/xline.rc | 12 + private/tapi/qa/trapper/itest/yline/itlap.c | 238 + private/tapi/qa/trapper/itest/yline/itlcp.c | 166 + private/tapi/qa/trapper/itest/yline/itlgc.c | 152 + private/tapi/qa/trapper/itest/yline/itlgdt.c | 176 + private/tapi/qa/trapper/itest/yline/itlgi.c | 139 + private/tapi/qa/trapper/itest/yline/itlgpl.c | 155 + private/tapi/qa/trapper/itest/yline/itlgtc.c | 196 + private/tapi/qa/trapper/itest/yline/itlgtn.c | 178 + private/tapi/qa/trapper/itest/yline/itlho.c | 175 + private/tapi/qa/trapper/itest/yline/itlrp.c | 230 + private/tapi/qa/trapper/itest/yline/itlta.c | 173 + private/tapi/qa/trapper/itest/yline/itltd.c | 186 + private/tapi/qa/trapper/itest/yline/makefile | 6 + private/tapi/qa/trapper/itest/yline/sources | 71 + private/tapi/qa/trapper/itest/yline/yline.c | 303 + private/tapi/qa/trapper/itest/yline/yline.def | 23 + private/tapi/qa/trapper/itest/yline/yline.h | 175 + private/tapi/qa/trapper/itest/yline/yline.rc | 13 + private/tapi/qa/trapper/private.h | 116 + private/tapi/qa/trapper/readme.txt | 26 + private/tapi/qa/trapper/trapper.c | 1901 +++ private/tapi/qa/trapper/trapper.def | 8 + private/tapi/qa/trapper/trapper.h | 35 + private/tapi/qa/trapper/trapper.ini | 409 + private/tapi/qa/trapper/trapper.rc | 100 + private/tapi/qa/trapper/trapper/makefile | 6 + private/tapi/qa/trapper/trapper/sources | 59 + 487 files changed, 215217 insertions(+) create mode 100644 private/tapi/qa/trapper/apilist.xls create mode 100644 private/tapi/qa/trapper/dirs create mode 100644 private/tapi/qa/trapper/fiesta.xls create mode 100644 private/tapi/qa/trapper/itest/cline/cline.c create mode 100644 private/tapi/qa/trapper/itest/cline/cline.def create mode 100644 private/tapi/qa/trapper/itest/cline/cline.h create mode 100644 private/tapi/qa/trapper/itest/cline/cline.rc create mode 100644 private/tapi/qa/trapper/itest/cline/itlatc.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlcc.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlgcrc.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlpatc.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlrd.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlrfc.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlsc.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlsh.c create mode 100644 private/tapi/qa/trapper/itest/cline/itlsuc.c create mode 100644 private/tapi/qa/trapper/itest/cline/ittgli.c create mode 100644 private/tapi/qa/trapper/itest/cline/ittrd.c create mode 100644 private/tapi/qa/trapper/itest/cline/ittrmc.c create mode 100644 private/tapi/qa/trapper/itest/cline/ittrmec.c create mode 100644 private/tapi/qa/trapper/itest/cline/makefile create mode 100644 private/tapi/qa/trapper/itest/cline/sources create mode 100644 private/tapi/qa/trapper/itest/dirs create mode 100644 private/tapi/qa/trapper/itest/iline/iline.c create mode 100644 private/tapi/qa/trapper/itest/iline/iline.def create mode 100644 private/tapi/qa/trapper/itest/iline/iline.h create mode 100644 private/tapi/qa/trapper/itest/iline/iline.rc create mode 100644 private/tapi/qa/trapper/itest/iline/itlac.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlas.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlbt.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlct.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlfw.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlh.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlnev.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlruui.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlsas.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlst.c create mode 100644 private/tapi/qa/trapper/itest/iline/itlsuui.c create mode 100644 private/tapi/qa/trapper/itest/iline/itluh.c create mode 100644 private/tapi/qa/trapper/itest/iline/makefile create mode 100644 private/tapi/qa/trapper/itest/iline/sources create mode 100644 private/tapi/qa/trapper/itest/line/dirs create mode 100644 private/tapi/qa/trapper/itest/line/itlc.c create mode 100644 private/tapi/qa/trapper/itest/line/itldc.c create mode 100644 private/tapi/qa/trapper/itest/line/itldial.c create mode 100644 private/tapi/qa/trapper/itest/line/itldrop.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgac.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgaid.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgas.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgci.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgcs.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgdc.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgid.c create mode 100644 private/tapi/qa/trapper/itest/line/itlglds.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgnc.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgnr.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgpl.c create mode 100644 private/tapi/qa/trapper/itest/line/itlgsm.c create mode 100644 private/tapi/qa/trapper/itest/line/itli.c create mode 100644 private/tapi/qa/trapper/itest/line/itlmc.c create mode 100644 private/tapi/qa/trapper/itest/line/itlmc1.c create mode 100644 private/tapi/qa/trapper/itest/line/itlmc2.c create mode 100644 private/tapi/qa/trapper/itest/line/itlnapiv.c create mode 100644 private/tapi/qa/trapper/itest/line/itlo.c create mode 100644 private/tapi/qa/trapper/itest/line/itls.c create mode 100644 private/tapi/qa/trapper/itest/line/itlscp.c create mode 100644 private/tapi/qa/trapper/itest/line/itlsnr.c create mode 100644 private/tapi/qa/trapper/itest/line/itlssm.c create mode 100644 private/tapi/qa/trapper/itest/line/line.inc create mode 100644 private/tapi/qa/trapper/itest/line/linea/makefile create mode 100644 private/tapi/qa/trapper/itest/line/linea/sources create mode 100644 private/tapi/qa/trapper/itest/line/linew/makefile create mode 100644 private/tapi/qa/trapper/itest/line/linew/sources create mode 100644 private/tapi/qa/trapper/itest/line/tline.c create mode 100644 private/tapi/qa/trapper/itest/line/tline.def create mode 100644 private/tapi/qa/trapper/itest/line/tline.h create mode 100644 private/tapi/qa/trapper/itest/line/tline.rc create mode 100644 private/tapi/qa/trapper/itest/line/uline.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlas.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlgaal.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlgac.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlgagl.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlgas.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlgm.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlie.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlpm.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlpr.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlsaa.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlsag.c create mode 100644 private/tapi/qa/trapper/itest/line20/itlsas.c create mode 100644 private/tapi/qa/trapper/itest/line20/line20.c create mode 100644 private/tapi/qa/trapper/itest/line20/line20.def create mode 100644 private/tapi/qa/trapper/itest/line20/line20.h create mode 100644 private/tapi/qa/trapper/itest/line20/line20.rc create mode 100644 private/tapi/qa/trapper/itest/line20/makefile create mode 100644 private/tapi/qa/trapper/itest/line20/sources create mode 100644 private/tapi/qa/trapper/itest/phone/itpc.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpcd.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpds.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgbi.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgd.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgdc.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgdp.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgg.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpghs.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgi.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgid.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgl.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgm.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgr.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgs.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgsm.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpgv.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpi.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpie.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpnav.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpne.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpo.c create mode 100644 private/tapi/qa/trapper/itest/phone/itps.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsbi.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsd.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsdp.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsg.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpshs.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsl.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsr.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpssm.c create mode 100644 private/tapi/qa/trapper/itest/phone/itpsv.c create mode 100644 private/tapi/qa/trapper/itest/phone/makefile create mode 100644 private/tapi/qa/trapper/itest/phone/sources create mode 100644 private/tapi/qa/trapper/itest/phone/tphone.c create mode 100644 private/tapi/qa/trapper/itest/phone/tphone.def create mode 100644 private/tapi/qa/trapper/itest/phone/tphone.h create mode 100644 private/tapi/qa/trapper/itest/phone/tphone.rc create mode 100644 private/tapi/qa/trapper/itest/sline/itlgad.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlgap.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlmod.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlmom.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlmot.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlpak.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlpk.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlsap.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlscd.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlscl.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlscqs.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlsct.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlslds.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlucc.c create mode 100644 private/tapi/qa/trapper/itest/sline/itlupak.c create mode 100644 private/tapi/qa/trapper/itest/sline/makefile create mode 100644 private/tapi/qa/trapper/itest/sline/sline.c create mode 100644 private/tapi/qa/trapper/itest/sline/sline.def create mode 100644 private/tapi/qa/trapper/itest/sline/sline.h create mode 100644 private/tapi/qa/trapper/itest/sline/sline.rc create mode 100644 private/tapi/qa/trapper/itest/sline/sources create mode 100644 private/tapi/qa/trapper/itest/tcline/cline.c create mode 100644 private/tapi/qa/trapper/itest/tcline/cline.def create mode 100644 private/tapi/qa/trapper/itest/tcline/cline.h create mode 100644 private/tapi/qa/trapper/itest/tcline/cline.rc create mode 100644 private/tapi/qa/trapper/itest/tcline/dirs create mode 100644 private/tapi/qa/trapper/itest/tcline/itlatc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlcc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlgcrc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlpatc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlrd.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlrfc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlsc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlsh.c create mode 100644 private/tapi/qa/trapper/itest/tcline/itlsuc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/ittgli.c create mode 100644 private/tapi/qa/trapper/itest/tcline/ittrd.c create mode 100644 private/tapi/qa/trapper/itest/tcline/ittrmc.c create mode 100644 private/tapi/qa/trapper/itest/tcline/ittrmec.c create mode 100644 private/tapi/qa/trapper/itest/tcline/tcline.def create mode 100644 private/tapi/qa/trapper/itest/tcline/tcline.inc create mode 100644 private/tapi/qa/trapper/itest/tcline/tclinea/makefile create mode 100644 private/tapi/qa/trapper/itest/tcline/tclinea/sources create mode 100644 private/tapi/qa/trapper/itest/tcline/tclinew/makefile create mode 100644 private/tapi/qa/trapper/itest/tcline/tclinew/sources create mode 100644 private/tapi/qa/trapper/itest/tcline/uline.c create mode 100644 private/tapi/qa/trapper/itest/testapp/dirs create mode 100644 private/tapi/qa/trapper/itest/testapp/testapp.c create mode 100644 private/tapi/qa/trapper/itest/testapp/testapp.def create mode 100644 private/tapi/qa/trapper/itest/testapp/testapp.h create mode 100644 private/tapi/qa/trapper/itest/testapp/testapp.inc create mode 100644 private/tapi/qa/trapper/itest/testapp/testapp.rc create mode 100644 private/tapi/qa/trapper/itest/testapp/testappa/makefile create mode 100644 private/tapi/qa/trapper/itest/testapp/testappa/sources create mode 100644 private/tapi/qa/trapper/itest/testapp/testappw/makefile create mode 100644 private/tapi/qa/trapper/itest/testapp/testappw/sources create mode 100644 private/tapi/qa/trapper/itest/tiline/dirs create mode 100644 private/tapi/qa/trapper/itest/tiline/iline.c create mode 100644 private/tapi/qa/trapper/itest/tiline/iline.h create mode 100644 private/tapi/qa/trapper/itest/tiline/ilinea/makefile create mode 100644 private/tapi/qa/trapper/itest/tiline/ilinea/sources create mode 100644 private/tapi/qa/trapper/itest/tiline/ilinew/makefile create mode 100644 private/tapi/qa/trapper/itest/tiline/ilinew/sources create mode 100644 private/tapi/qa/trapper/itest/tiline/itlac.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlas.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlbt.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlct.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlfw.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlfw1.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlfw2.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlh.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlnev.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlruui.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlsas.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlst.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itlsuui.c create mode 100644 private/tapi/qa/trapper/itest/tiline/itluh.c create mode 100644 private/tapi/qa/trapper/itest/tiline/test.c create mode 100644 private/tapi/qa/trapper/itest/tiline/testx.c create mode 100644 private/tapi/qa/trapper/itest/tiline/testy.c create mode 100644 private/tapi/qa/trapper/itest/tiline/tiline.def create mode 100644 private/tapi/qa/trapper/itest/tiline/tiline.inc create mode 100644 private/tapi/qa/trapper/itest/tiline/uline.c create mode 100644 private/tapi/qa/trapper/itest/tiline/version.rc create mode 100644 private/tapi/qa/trapper/itest/tline20/dirs create mode 100644 private/tapi/qa/trapper/itest/tline20/itlas.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlgaal.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlgac.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlgagl.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlgas.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlgm.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlie.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlpm.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlpr.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlsaa.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlsag.c create mode 100644 private/tapi/qa/trapper/itest/tline20/itlsas.c create mode 100644 private/tapi/qa/trapper/itest/tline20/line20.c create mode 100644 private/tapi/qa/trapper/itest/tline20/line20.h create mode 100644 private/tapi/qa/trapper/itest/tline20/tline20.def create mode 100644 private/tapi/qa/trapper/itest/tline20/tline20.inc create mode 100644 private/tapi/qa/trapper/itest/tline20/tline20a/makefile create mode 100644 private/tapi/qa/trapper/itest/tline20/tline20a/sources create mode 100644 private/tapi/qa/trapper/itest/tline20/tline20w/makefile create mode 100644 private/tapi/qa/trapper/itest/tline20/tline20w/sources create mode 100644 private/tapi/qa/trapper/itest/tline20/uline.c create mode 100644 private/tapi/qa/trapper/itest/tline20/version.rc create mode 100644 private/tapi/qa/trapper/itest/tphone/dirs create mode 100644 private/tapi/qa/trapper/itest/tphone/itpc.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpcd.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpds.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgbi.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgd.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgdc.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgdp.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgg.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpghs.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgi.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgid.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgl.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgm.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgr.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgs.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgsm.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpgv.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpi.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpie.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpnav.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpne.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpo.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itps.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsbi.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsd.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsdp.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsg.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpshs.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsl.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsr.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpssm.c create mode 100644 private/tapi/qa/trapper/itest/tphone/itpsv.c create mode 100644 private/tapi/qa/trapper/itest/tphone/msgphone.c create mode 100644 private/tapi/qa/trapper/itest/tphone/tphone.c create mode 100644 private/tapi/qa/trapper/itest/tphone/tphone.h create mode 100644 private/tapi/qa/trapper/itest/tphone/tphone.inc create mode 100644 private/tapi/qa/trapper/itest/tphone/tphonea/makefile create mode 100644 private/tapi/qa/trapper/itest/tphone/tphonea/sources create mode 100644 private/tapi/qa/trapper/itest/tphone/tphonew/makefile create mode 100644 private/tapi/qa/trapper/itest/tphone/tphonew/sources create mode 100644 private/tapi/qa/trapper/itest/tphone/ttphone.def create mode 100644 private/tapi/qa/trapper/itest/tphone/uline.c create mode 100644 private/tapi/qa/trapper/itest/tphone/version.rc create mode 100644 private/tapi/qa/trapper/itest/tsline/dirs create mode 100644 private/tapi/qa/trapper/itest/tsline/itlgad.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlgap.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlmod.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlmom.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlmot.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlpak.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlpk.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlsap.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlscd.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlscl.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlscqs.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlsct.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlslds.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlucc.c create mode 100644 private/tapi/qa/trapper/itest/tsline/itlupak.c create mode 100644 private/tapi/qa/trapper/itest/tsline/sline.c create mode 100644 private/tapi/qa/trapper/itest/tsline/sline.h create mode 100644 private/tapi/qa/trapper/itest/tsline/sline.rc create mode 100644 private/tapi/qa/trapper/itest/tsline/tsline.def create mode 100644 private/tapi/qa/trapper/itest/tsline/tsline.inc create mode 100644 private/tapi/qa/trapper/itest/tsline/tslinea/makefile create mode 100644 private/tapi/qa/trapper/itest/tsline/tslinea/sources create mode 100644 private/tapi/qa/trapper/itest/tsline/tslinew/makefile create mode 100644 private/tapi/qa/trapper/itest/tsline/tslinew/sources create mode 100644 private/tapi/qa/trapper/itest/tsline/uline.c create mode 100644 private/tapi/qa/trapper/itest/ttest.c create mode 100644 private/tapi/qa/trapper/itest/ttest.def create mode 100644 private/tapi/qa/trapper/itest/ttest.h create mode 100644 private/tapi/qa/trapper/itest/ttest.inc create mode 100644 private/tapi/qa/trapper/itest/ttesta/makefile create mode 100644 private/tapi/qa/trapper/itest/ttesta/sources create mode 100644 private/tapi/qa/trapper/itest/ttestw/makefile create mode 100644 private/tapi/qa/trapper/itest/ttestw/sources create mode 100644 private/tapi/qa/trapper/itest/txline/dirs create mode 100644 private/tapi/qa/trapper/itest/txline/itlcd.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlcde.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlds.c create mode 100644 private/tapi/qa/trapper/itest/txline/itldsf.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlgdcf.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlgr.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlrrr.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlscp.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlsdcf.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlsmc.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlsmm.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlst.c create mode 100644 private/tapi/qa/trapper/itest/txline/itlstl.c create mode 100644 private/tapi/qa/trapper/itest/txline/msgline.c create mode 100644 private/tapi/qa/trapper/itest/txline/txline.def create mode 100644 private/tapi/qa/trapper/itest/txline/txline.inc create mode 100644 private/tapi/qa/trapper/itest/txline/txlinea/makefile create mode 100644 private/tapi/qa/trapper/itest/txline/txlinea/sources create mode 100644 private/tapi/qa/trapper/itest/txline/txlinew/makefile create mode 100644 private/tapi/qa/trapper/itest/txline/txlinew/sources create mode 100644 private/tapi/qa/trapper/itest/txline/uline.c create mode 100644 private/tapi/qa/trapper/itest/txline/xline.c create mode 100644 private/tapi/qa/trapper/itest/txline/xline.def create mode 100644 private/tapi/qa/trapper/itest/txline/xline.h create mode 100644 private/tapi/qa/trapper/itest/txline/xline.rc create mode 100644 private/tapi/qa/trapper/itest/tyline/dirs create mode 100644 private/tapi/qa/trapper/itest/tyline/itlap.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlcp.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlgc.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlgdt.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlgi.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlgpl.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlgtc.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlgtn.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlho.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlrp.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itlta.c create mode 100644 private/tapi/qa/trapper/itest/tyline/itltd.c create mode 100644 private/tapi/qa/trapper/itest/tyline/test1.xls create mode 100644 private/tapi/qa/trapper/itest/tyline/test2.xls create mode 100644 private/tapi/qa/trapper/itest/tyline/tyline.def create mode 100644 private/tapi/qa/trapper/itest/tyline/tyline.inc create mode 100644 private/tapi/qa/trapper/itest/tyline/tylinea/makefile create mode 100644 private/tapi/qa/trapper/itest/tyline/tylinea/sources create mode 100644 private/tapi/qa/trapper/itest/tyline/tylinew/makefile create mode 100644 private/tapi/qa/trapper/itest/tyline/tylinew/sources create mode 100644 private/tapi/qa/trapper/itest/tyline/uline.c create mode 100644 private/tapi/qa/trapper/itest/tyline/yline.c create mode 100644 private/tapi/qa/trapper/itest/tyline/yline.def create mode 100644 private/tapi/qa/trapper/itest/tyline/yline.h create mode 100644 private/tapi/qa/trapper/itest/tyline/yline.rc create mode 100644 private/tapi/qa/trapper/itest/uline/dirs create mode 100644 private/tapi/qa/trapper/itest/uline/uline.c create mode 100644 private/tapi/qa/trapper/itest/uline/uline.def create mode 100644 private/tapi/qa/trapper/itest/uline/uline.h create mode 100644 private/tapi/qa/trapper/itest/uline/uline.inc create mode 100644 private/tapi/qa/trapper/itest/uline/uline.rc create mode 100644 private/tapi/qa/trapper/itest/uline/ulinea/makefile create mode 100644 private/tapi/qa/trapper/itest/uline/ulinea/sources create mode 100644 private/tapi/qa/trapper/itest/uline/ulinew/makefile create mode 100644 private/tapi/qa/trapper/itest/uline/ulinew/sources create mode 100644 private/tapi/qa/trapper/itest/uline/utcline.c create mode 100644 private/tapi/qa/trapper/itest/uline/utiline.c create mode 100644 private/tapi/qa/trapper/itest/uline/utline.c create mode 100644 private/tapi/qa/trapper/itest/uline/utline20.c create mode 100644 private/tapi/qa/trapper/itest/uline/utsline.c create mode 100644 private/tapi/qa/trapper/itest/uline/utxline.c create mode 100644 private/tapi/qa/trapper/itest/uline/utyline.c create mode 100644 private/tapi/qa/trapper/itest/version.rc create mode 100644 private/tapi/qa/trapper/itest/wline/makefile create mode 100644 private/tapi/qa/trapper/itest/wline/readme.txt create mode 100644 private/tapi/qa/trapper/itest/wline/sources create mode 100644 private/tapi/qa/trapper/itest/wline/version.rc create mode 100644 private/tapi/qa/trapper/itest/wline/witlap.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlbt.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlcd.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlcde.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlfw.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgaal.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgad.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgap.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgc.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgdcf.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgdt.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgi.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgr.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlgtc.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlho.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlie.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlpak.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlpatc.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlpk.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlrd.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlsap.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlsdcf.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlst.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlstl.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlsuc.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlta.c create mode 100644 private/tapi/qa/trapper/itest/wline/witltd.c create mode 100644 private/tapi/qa/trapper/itest/wline/witlupak.c create mode 100644 private/tapi/qa/trapper/itest/wline/wittgli.c create mode 100644 private/tapi/qa/trapper/itest/wline/wittrmc.c create mode 100644 private/tapi/qa/trapper/itest/wline/wittrmec.c create mode 100644 private/tapi/qa/trapper/itest/wline/wline.c create mode 100644 private/tapi/qa/trapper/itest/wline/wline.def create mode 100644 private/tapi/qa/trapper/itest/wline/wline.h create mode 100644 private/tapi/qa/trapper/itest/wphone/makefile create mode 100644 private/tapi/qa/trapper/itest/wphone/sources create mode 100644 private/tapi/qa/trapper/itest/wphone/wphone.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wphone.def create mode 100644 private/tapi/qa/trapper/itest/wphone/wphone.h create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpcd.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpgbi.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpgdc.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpgi.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpgid.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpgs.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpi.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpie.c create mode 100644 private/tapi/qa/trapper/itest/wphone/wtpsbi.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlcd.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlcde.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlds.c create mode 100644 private/tapi/qa/trapper/itest/xline/itldsf.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlgdcf.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlgr.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlrrr.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlscp.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlsdcf.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlsmc.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlsmm.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlst.c create mode 100644 private/tapi/qa/trapper/itest/xline/itlstl.c create mode 100644 private/tapi/qa/trapper/itest/xline/makefile create mode 100644 private/tapi/qa/trapper/itest/xline/sources create mode 100644 private/tapi/qa/trapper/itest/xline/xline.c create mode 100644 private/tapi/qa/trapper/itest/xline/xline.def create mode 100644 private/tapi/qa/trapper/itest/xline/xline.h create mode 100644 private/tapi/qa/trapper/itest/xline/xline.rc create mode 100644 private/tapi/qa/trapper/itest/yline/itlap.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlcp.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlgc.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlgdt.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlgi.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlgpl.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlgtc.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlgtn.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlho.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlrp.c create mode 100644 private/tapi/qa/trapper/itest/yline/itlta.c create mode 100644 private/tapi/qa/trapper/itest/yline/itltd.c create mode 100644 private/tapi/qa/trapper/itest/yline/makefile create mode 100644 private/tapi/qa/trapper/itest/yline/sources create mode 100644 private/tapi/qa/trapper/itest/yline/yline.c create mode 100644 private/tapi/qa/trapper/itest/yline/yline.def create mode 100644 private/tapi/qa/trapper/itest/yline/yline.h create mode 100644 private/tapi/qa/trapper/itest/yline/yline.rc create mode 100644 private/tapi/qa/trapper/private.h create mode 100644 private/tapi/qa/trapper/readme.txt create mode 100644 private/tapi/qa/trapper/trapper.c create mode 100644 private/tapi/qa/trapper/trapper.def create mode 100644 private/tapi/qa/trapper/trapper.h create mode 100644 private/tapi/qa/trapper/trapper.ini create mode 100644 private/tapi/qa/trapper/trapper.rc create mode 100644 private/tapi/qa/trapper/trapper/makefile create mode 100644 private/tapi/qa/trapper/trapper/sources (limited to 'private/tapi/qa/trapper') diff --git a/private/tapi/qa/trapper/apilist.xls b/private/tapi/qa/trapper/apilist.xls new file mode 100644 index 000000000..f70caffd5 Binary files /dev/null and b/private/tapi/qa/trapper/apilist.xls differ diff --git a/private/tapi/qa/trapper/dirs b/private/tapi/qa/trapper/dirs new file mode 100644 index 000000000..73bbf0f61 --- /dev/null +++ b/private/tapi/qa/trapper/dirs @@ -0,0 +1,24 @@ +!IF 0 + +Copyright (c) 1989-92 Microsoft Corporation + +Module Name: + + dirs. + +Abstract: + + This file specifies the subdirectories of the current directory that + contain component makefiles. + + +Author: + + Steve Wood (stevewo) 17-Apr-1990 + +NOTE: Commented description of this file is in \nt\public\oak\bin\dirs.tpl + +!ENDIF + +DIRS= itest\ + trapper diff --git a/private/tapi/qa/trapper/fiesta.xls b/private/tapi/qa/trapper/fiesta.xls new file mode 100644 index 000000000..6fa903472 Binary files /dev/null and b/private/tapi/qa/trapper/fiesta.xls differ diff --git a/private/tapi/qa/trapper/itest/cline/cline.c b/private/tapi/qa/trapper/itest/cline/cline.c new file mode 100644 index 000000000..91c93deaa --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/cline.c @@ -0,0 +1,316 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + cline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 15-Jan-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "cline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghCLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +CLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghCLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineAddToConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineGetConfRelatedCalls(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLinePrepareAddToConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineRemoveFromConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineSetupConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineCompleteCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineRedirect(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineSecureCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSwapHold(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestTapiGetLocationInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestDrop(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestMakeCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestMediaCall(TRUE, FALSE)); +} + + + + diff --git a/private/tapi/qa/trapper/itest/cline/cline.def b/private/tapi/qa/trapper/itest/cline/cline.def new file mode 100644 index 000000000..0cdc5ec34 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/cline.def @@ -0,0 +1,24 @@ +LIBRARY cline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + diff --git a/private/tapi/qa/trapper/itest/cline/cline.h b/private/tapi/qa/trapper/itest/cline/cline.h new file mode 100644 index 000000000..820fcd1be --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/cline.h @@ -0,0 +1,183 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + cline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding 15-Jan-1996 + +Revision History: + +--*/ + + +#ifndef CLINE_H +#define CLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineAddToConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetConfRelatedCalls( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePrepareAddToConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRemoveFromConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetupConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineCompleteCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRedirect( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineSecureCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSwapHold( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestTapiGetLocationInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTapiRequestDrop( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestTapiRequestMakeCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestTapiRequestMediaCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + + + +#endif // CLINE_H diff --git a/private/tapi/qa/trapper/itest/cline/cline.rc b/private/tapi/qa/trapper/itest/cline/cline.rc new file mode 100644 index 000000000..c8dae99fb --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/cline.rc @@ -0,0 +1,13 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI CLine API test Library" +#define VER_INTERNALNAME_STR "cline.dll" +#define VER_ORIGINALFILENAME_STR "cline.dll" + +#include "common.ver" + + + diff --git a/private/tapi/qa/trapper/itest/cline/itlatc.c b/private/tapi/qa/trapper/itest/cline/itlatc.c new file mode 100644 index 000000000..bb3e9b444 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlatc.c @@ -0,0 +1,242 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlatc.c + +Abstract: + + This module contains the test functions for lineAddToConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineAddToConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAddToConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineAddToConference"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(fEsp) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdm) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineAddToConference for go/no-go"); + + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported these apis"); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + return fTestPassed; + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + sizeof (LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpCallList->dwTotalSize < + lpTapiLineTestInfo->lpCallList->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallList->dwNeededSize; + FreeTestHeap(); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); +/* + for(n=0; n< (INT)lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } +*/ + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineAddToConference Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineAddToConference Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlcc.c b/private/tapi/qa/trapper/itest/cline/itlcc.c new file mode 100644 index 000000000..2da2301b6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlcc.c @@ -0,0 +1,203 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcc.c + +Abstract: + + This module contains the test functions for lineCompleteCall + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineCompleteCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineCompleteCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineCompleteCall"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineCompleteCall for go/no-go"); + + 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->dwCompletionID); + + // 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); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineCompleteCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineCompleteCall Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlgcrc.c b/private/tapi/qa/trapper/itest/cline/itlgcrc.c new file mode 100644 index 000000000..605e1ed6a --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlgcrc.c @@ -0,0 +1,246 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgcrc.c + +Abstract: + + This module contains the test functions for lineGetConfRelatedCalls + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineGetConfRelatedCalls +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetConfRelatedCalls(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetConfRelatedCalls"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(fEsp) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdm) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported these apis"); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + return fTestPassed; + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetConfRelatedCalls for go/no-go"); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + sizeof (LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpCallList->dwTotalSize < + lpTapiLineTestInfo->lpCallList->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallList->dwNeededSize; + FreeTestHeap(); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); +/* + for(n=0; n< (INT)lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } + */ + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetConfRelatedCalls Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetConfRelatedCalls Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlpatc.c b/private/tapi/qa/trapper/itest/cline/itlpatc.c new file mode 100644 index 000000000..d2b8c7ae7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlpatc.c @@ -0,0 +1,260 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpatc.c + +Abstract: + + This module contains the test functions for linePrepareAddToConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// linePrepareAddToConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePrepareAddToConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test linePrepareAddToConference"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + + + if(fEsp) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported these apis"); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + return fTestPassed; + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test linePrepareAddToConference for go/no-go"); + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEsp) + { + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + sizeof (LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpCallList->dwTotalSize < + lpTapiLineTestInfo->lpCallList->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallList->dwNeededSize; + FreeTestHeap(); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + +/* + for(n=0; n< (INT) lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } + */ + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePrepareAddToConference Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePrepareAddToConference Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlrd.c b/private/tapi/qa/trapper/itest/cline/itlrd.c new file mode 100644 index 000000000..d4790d44f --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlrd.c @@ -0,0 +1,181 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrd.c + +Abstract: + + This module contains the test functions for lineRedirect + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineRedirect +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRedirect(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineRedirect"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineRedirect for go/no-go"); + + lpTapiLineTestInfo->lpszDestAddress = "64738"; + lpTapiLineTestInfo->dwCountryCode = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineRedirect(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRedirect Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRedirect Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlrfc.c b/private/tapi/qa/trapper/itest/cline/itlrfc.c new file mode 100644 index 000000000..a648abb13 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlrfc.c @@ -0,0 +1,272 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrfc.c + +Abstract: + + This module contains the test functions for lineRemoveFromConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineRemoveFromConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRemoveFromConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineRemoveFromConference"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(fEsp) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported these apis"); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + return fTestPassed; + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineRemoveFromConference for go/no-go"); + + + if(fEsp) + { + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if(fEsp) + { + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + sizeof (LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpCallList->dwTotalSize < + lpTapiLineTestInfo->lpCallList->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallList->dwNeededSize; + FreeTestHeap(); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + +/* + for(n=0; n<(INT)lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } + */ + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRemoveFromConference Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRemoveFromConference Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlsc.c b/private/tapi/qa/trapper/itest/cline/itlsc.c new file mode 100644 index 000000000..408bffd96 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlsc.c @@ -0,0 +1,180 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsc.c + +Abstract: + + This module contains the test functions for lineSecureCall + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineSecureCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSecureCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSecureCall"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSecureCall for go/no-go"); + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSecureCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSecureCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + // how to verify the call be secured? + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSecureCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSecureCall Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlsh.c b/private/tapi/qa/trapper/itest/cline/itlsh.c new file mode 100644 index 000000000..b9d0a5f9d --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlsh.c @@ -0,0 +1,263 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsh.c + +Abstract: + + This module contains the test functions for lineSwapHold + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineSwapHold +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSwapHold(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSwapHold"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported it, return."); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + return fTestPassed; + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSwapHold for go/no-go"); + + + // Make second call at same line + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallStatus = (LPLINECALLSTATUS) AllocFromTestHeap ( + sizeof(LINECALLSTATUS)); + lpTapiLineTestInfo->lpCallStatus->dwTotalSize = sizeof(LINECALLSTATUS); + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: Active: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Hold: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSwapHold for go/no-go"); + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSwapHold(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Verify the swap + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: Active: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Hold: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + } + else + { + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSwapHold Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSwapHold Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/itlsuc.c b/private/tapi/qa/trapper/itest/cline/itlsuc.c new file mode 100644 index 000000000..becf1ec14 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/itlsuc.c @@ -0,0 +1,179 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsuc.c + +Abstract: + + This module contains the test functions for lineSetupConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineSetupConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetupConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetupConference"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetupConference for go/no-go"); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetupConference Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetupConference Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/ittgli.c b/private/tapi/qa/trapper/itest/cline/ittgli.c new file mode 100644 index 000000000..0a34019d5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/ittgli.c @@ -0,0 +1,112 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittgli.c + +Abstract: + + This module contains the test functions for tapiGetLocationInfo + +Author: + + Xiao Ying Ding (XiaoD) 30-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 "cline.h" + + + +// tapiGetLocationInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiGetLocationInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwCountrySize, dwCitySize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiGetLocationInfo"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiGetLocationInfo for go/no-go"); + + dwCountrySize = 16; + dwCitySize = 16; + lpTapiLineTestInfo->lpszCountryCode = AllocFromTestHeap(dwCountrySize); + lpTapiLineTestInfo->lpszCityCode = AllocFromTestHeap(dwCitySize); + + if (! DoTapiGetLocationInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + + (lpTapiLineTestInfo->lpszCountryCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCountryCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCountryCode = %s", + lpTapiLineTestInfo->lpszCountryCode); + + (lpTapiLineTestInfo->lpszCityCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCityCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCityCode = %s", + lpTapiLineTestInfo->lpszCityCode); + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiGetLocationInfo Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiGetLocationInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/ittrd.c b/private/tapi/qa/trapper/itest/cline/ittrd.c new file mode 100644 index 000000000..018cfa4b6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/ittrd.c @@ -0,0 +1,91 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrd.c + +Abstract: + + This module contains the test functions for tapiRequestDrop + +Author: + + Xiao Ying Ding (XiaoD) 30-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 "cline.h" + + + +// tapiRequestDrop +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestDrop(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiRequestDrop"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiRequestDrop for go/no-go"); + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + + if (! DoTapiRequestDrop(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + fTestPassed = FALSE; + } + + + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestDrop Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestDrop Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/ittrmc.c b/private/tapi/qa/trapper/itest/cline/ittrmc.c new file mode 100644 index 000000000..0fb493e66 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/ittrmc.c @@ -0,0 +1,191 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrmc.c + +Abstract: + + This module contains the test functions for tapiRequestMakeCall + +Author: + + Xiao Ying Ding (XiaoD) 30-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 "cline.h" + + + +// tapiRequestMakeCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestMakeCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiRequestMakeCall"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiRequestMakeCall for go/no-go"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwMediaMode = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpszAppFilename = "cline test"; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwPriority = 1; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)"cline test"; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + for(n=0; n<10; n++) + { + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + for(n=0; n<10; n++) + { + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOREQUEST)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwMediaMode = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpszAppFilename = "cline test"; + lpTapiLineTestInfo->dwPriority = 0; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMakeCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMakeCall Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/ittrmec.c b/private/tapi/qa/trapper/itest/cline/ittrmec.c new file mode 100644 index 000000000..779da95b9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/ittrmec.c @@ -0,0 +1,98 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrmec.c + +Abstract: + + This module contains the test functions for tapiRequestMediaCall + +Author: + + Xiao Ying Ding (XiaoD) 30-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 "cline.h" + + + +// tapiRequestMediaCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestMediaCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiRequestMediaCall"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiRequestMediaCall for go/no-go"); + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + lpTapiLineTestInfo->lpszDeviceClass = "line/tapi"; + lpTapiLineTestInfo->lpDeviceID = 0; + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->dwSecure = 0; + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpszAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)"xxx"; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; + + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + fTestPassed = FALSE; + } + + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMediaCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMediaCall Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/cline/makefile b/private/tapi/qa/trapper/itest/cline/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/cline/sources b/private/tapi/qa/trapper/itest/cline/sources new file mode 100644 index 000000000..70fa6d746 --- /dev/null +++ b/private/tapi/qa/trapper/itest/cline/sources @@ -0,0 +1,74 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=cline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x66000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES= cline.c \ + itlatc.c \ + itlgcrc.c \ + itlpatc.c \ + itlrfc.c \ + itlsuc.c \ + itlcc.c \ + itlrd.c \ + itlsc.c \ + itlsh.c \ + ittgli.c \ + ittrd.c \ + ittrmc.c \ + ittrmec.c \ + cline.rc + + + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=CLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/dirs b/private/tapi/qa/trapper/itest/dirs new file mode 100644 index 000000000..a7a66100a --- /dev/null +++ b/private/tapi/qa/trapper/itest/dirs @@ -0,0 +1,23 @@ +DIRS= ttesta \ + ttestw \ + wline \ + phone \ + xline \ + yline \ + line \ + line20 \ + iline \ + cline \ + sline \ + testapp \ + txline \ + tline20 \ + tcline \ + tyline \ + tphone \ + wphone \ + tiline \ + tsline \ + testapp \ + uline + diff --git a/private/tapi/qa/trapper/itest/iline/iline.c b/private/tapi/qa/trapper/itest/iline/iline.c new file mode 100644 index 000000000..34b1e2d33 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/iline.c @@ -0,0 +1,335 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + iline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "iline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghILineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +ILineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghILineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineAccept(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineAnswer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineBlindTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineForward(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineReleaseUserUserInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineSendUserUserInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineSetupTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineCompleteTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineNegotiateExtVersion(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineHold(TRUE, FALSE)); +} + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineUnhold(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAppSpecific(TRUE, FALSE)); +} + + + +/* +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineTest(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineTestX(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineTestY(TRUE, FALSE)); +} + +*/ diff --git a/private/tapi/qa/trapper/itest/iline/iline.def b/private/tapi/qa/trapper/itest/iline/iline.def new file mode 100644 index 000000000..9c3b5dcb0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/iline.def @@ -0,0 +1,22 @@ +LIBRARY iline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 diff --git a/private/tapi/qa/trapper/itest/iline/iline.h b/private/tapi/qa/trapper/itest/iline/iline.h new file mode 100644 index 000000000..294d279fc --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/iline.h @@ -0,0 +1,200 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + iline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#ifndef ILINE_H +#define ILINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineAccept( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineAnswer( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineBlindTransfer( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineForward( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineReleaseUserUserInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSendUserUserInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetupTransfer( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineCompleteTransfer( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineNegotiateExtVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineHold( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineUnhold( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineSetAppSpecific( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + + +/* +BOOL +TestLineTest( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineTestX( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineTestY( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +*/ + + + + +#endif // ILINE_H diff --git a/private/tapi/qa/trapper/itest/iline/iline.rc b/private/tapi/qa/trapper/itest/iline/iline.rc new file mode 100644 index 000000000..9c540ebba --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/iline.rc @@ -0,0 +1,13 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI ILine API test Library" +#define VER_INTERNALNAME_STR "iline.dll" +#define VER_ORIGINALFILENAME_STR "iline.dll" + +#include "common.ver" + + + diff --git a/private/tapi/qa/trapper/itest/iline/itlac.c b/private/tapi/qa/trapper/itest/iline/itlac.c new file mode 100644 index 000000000..5a2d3c879 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlac.c @@ -0,0 +1,254 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlac.c + +Abstract: + + This module contains the test functions for lineAccept + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + + + +// lineAccept +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAccept(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + LONG lret; + LPTAPIMSG lpMsg; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineAccept"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manuly test it"); + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); + +// lpTapiLineTestInfo->lpszDestAddress = (LPSTR)lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineAccept for go/no-go"); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAccept(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAccept Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAccept Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlas.c b/private/tapi/qa/trapper/itest/iline/itlas.c new file mode 100644 index 000000000..8f3e0bf81 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlas.c @@ -0,0 +1,250 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlas.c + +Abstract: + + This module contains the test functions for lineAnswer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + + + +// lineAnswer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAnswer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineAnswer"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manuly test it"); + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); + + + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + WaitForAllMessages(); + + + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineAnswer for go/no-go"); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAnswer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAnswer Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAnswer Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlbt.c b/private/tapi/qa/trapper/itest/iline/itlbt.c new file mode 100644 index 000000000..8886de9e4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlbt.c @@ -0,0 +1,179 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlbt.c + +Abstract: + + This module contains the test functions for lineBlindTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineBlindTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineBlindTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineBlindTransfer"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "64738"; + lpTapiLineTestInfo->dwCountryCode = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineBlindTransfer for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineBlindTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineBlindTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineBlindTransfer Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineBlindTransfer Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlct.c b/private/tapi/qa/trapper/itest/iline/itlct.c new file mode 100644 index 000000000..6feafb7fe --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlct.c @@ -0,0 +1,198 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlct.c + +Abstract: + + This module contains the test functions for lineCompleteTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineCompleteTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineCompleteTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEspFlag, fUnimdmFlag; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineCompleteTransfer"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineCompleteTransfer for go/no-go"); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + if(fEspFlag) + { + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineCompleteTransfer Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineCompleteTransfer Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlfw.c b/private/tapi/qa/trapper/itest/iline/itlfw.c new file mode 100644 index 000000000..172006665 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlfw.c @@ -0,0 +1,186 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlfw.c + +Abstract: + + This module contains the test functions for lineForward + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineForward +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineForward(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineForward"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineForward for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpLineAddressStatus = (LPLINEADDRESSSTATUS) AllocFromTestHeap ( + sizeof(LINEADDRESSSTATUS)); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = sizeof(LINEADDRESSSTATUS); + + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineForward Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineForward Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlh.c b/private/tapi/qa/trapper/itest/iline/itlh.c new file mode 100644 index 000000000..d93c71172 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlh.c @@ -0,0 +1,222 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlh.c + +Abstract: + + This module contains the test functions for lineHold + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "iline.h" + + +// lineHold +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized (called before any lines are initialized) +// 2) Valid test case (with ESP) +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// + +BOOL TestLineHold(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + DWORD dwESPDeviceID; + INT n; + BOOL fResult; + BOOL fTestPassed = TRUE; + BOOL fEspFlag = TRUE; + + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + // Open a line with LINECALLPRIVILEGE_OWNER + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineHold <<<<<<<<" + ); + + // Test uninitialized state + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : uninitialized state"); + + if (! DoLineHold( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE + )) + { + TLINE_FAIL(); + } + + } + + + // Place a call on hold and verify ONHOLD state message is sent + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : valid params and state and verify\r\n" \ + ">> LINECALLSTATE/ONHOLD message is sent" + ); + + 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; + + // Initialize and Negotiate, then find an ESP device that + // supports lineHold + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + if (! FindESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + lpTapiLineTestInfo->dwDeviceID = 0; + TLINE_FAIL(); + fTestPassed = TRUE; + } + dwESPDeviceID = lpTapiLineTestInfo->dwDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Put the call on hold + if(fEspFlag) + { + if (! (fResult = DoLineHold(lpTapiLineTestInfo, TAPISUCCESS, FALSE))) + { + TLINE_FAIL(); + } + + // Verify that the LINE_CALLSTATE/ONHOLD message is sent when the call is + // is put on hold + if (fResult) + { + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLD, + 0x0, + 0x0, + TAPIMSG_ALL + ); + } + + // Wait for the async reply + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + if (! DoLineUnhold(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! (fResult = DoLineHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE))) + { + TLINE_FAIL(); + } + } + + + + // Take the call off hold + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Free the memory taken from the heap + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineHold Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineHold Test Failed"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing lineHold <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/iline/itlnev.c b/private/tapi/qa/trapper/itest/iline/itlnev.c new file mode 100644 index 000000000..9f18516b9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlnev.c @@ -0,0 +1,212 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlnev.c + +Abstract: + + This module contains the test functions for lineNegotiateExtVersion + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "iline.h" + + +// lineNegotiateExtVersion +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// LINEERR_BADDEVICEID Y +// LINEERR_INCOMPATIBLEAPIVERSION Y +// LINEERR_INCOMPATIBLEEXTVERSION Y High/Low both too high tested +// High/Low invalide and flipped tested +// High/Low each invalid -- both tested +// LINEERR_INVALAPPHANDLE Y +// LINEERR_INVALPOINTER Y +// LINEERR_NOMEM +// LINEERR_NODEVICE +// LINEERR_NODRIVER +// LINEERR_OPERATIONFAILED +// LINEERR_RESOURCEUNAVAIL +// LINEERR_UNINITIALIZED +// LINEERR_OPERATIONUNAVAIL +// +// Valid Cases Y +// +// hLineApp Y +// dwDeviceID Y +// dwAPIVersion Y +// dwExtLowVersion Y +// dwExtHighVersion Y +// lpdwExtVersion Y + +BOOL TestLineNegotiateExtVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineNegotiateExtVersion"); + + + 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; + + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + +/* + // Try invalid higher version...low version still ok + lpTapiLineTestInfo->dwExtHighVersion = BAD_EXTVERSION; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLNEV_FAIL(); + } + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + // Flip high and low extension version parameters. + // Also, make the high parameter too low to be valid and the low too high. + // This checks that the low is being checked as the low version and the + // high is being checked as the high version. + lpTapiLineTestInfo->dwExtLowVersion = BAD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = BAD_EXTVERSION; + if (! DoLineNegotiateExtVersion( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEEXTVERSION + )) + { + ITLNEV_FAIL(); + } + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + // Check low and high extension versions that are both too high + lpTapiLineTestInfo->dwExtLowVersion = BAD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = BAD_EXTVERSION; + if (! DoLineNegotiateExtVersion( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEEXTVERSION + )) + { + ITLNEV_FAIL(); + } + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + // Check bad device ID + lpTapiLineTestInfo->dwDeviceID = INVLD_DWDEVICEID; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + ITLNEV_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = dwDeviceID; + + // Check invalid line app handle + hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + *lpTapiLineTestInfo->lphLineApp = INVLD_HLINEAPP; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + ITLNEV_FAIL(); + } + *lpTapiLineTestInfo->lphLineApp = hLineApp_Orig; + + // Check null lpdwExtVersion pointer + lpTapiLineTestInfo->lpdwExtVersion = NULL; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + ITLNEV_FAIL(); + } + TapiLineTestInfo.lpdwExtVersion = &dwExtVersion; + + // Check incompatible API Version + dwAPIVersion_Orig = *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineNegotiateExtVersion( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + ITLNEV_FAIL(); + } + *lpTapiLineTestInfo->lpdwAPIVersion = dwAPIVersion_Orig; + +*/ + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineNegotiateExtVersion Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineNegotiateExtVersion Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlruui.c b/private/tapi/qa/trapper/itest/iline/itlruui.c new file mode 100644 index 000000000..761c88409 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlruui.c @@ -0,0 +1,195 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlruui.c + +Abstract: + + This module contains the test functions for lineReleaseUserUserInfo + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineReleaseUserUserInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineReleaseUserUserInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineReleaseUserUserInfo"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineReleaseUserUserInfo for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineReleaseUserUserInfo Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineReleaseUserUserInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlsas.c b/private/tapi/qa/trapper/itest/iline/itlsas.c new file mode 100644 index 000000000..538367d52 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlsas.c @@ -0,0 +1,242 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsas.c + +Abstract: + + This module contains the test functions for lineSetAppSpecific + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "iline.h" + + +#define DWAPPSPECIFICVALUE 0x12349876 + + +// lineSetAppSpecific +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized (called before any lines are initialized) +// 2) Verify dwAppSpecific field of LINECALLINFO structure is set +// 3) Verify LINECALLINFO/APPSPECIFIC message is sent to other apps +// that have call handles +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// + +BOOL TestLineSetAppSpecific(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + BOOL fResult; + BOOL fTestPassed = TRUE; + + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetAppSpecific <<<<<<<<" + ); + + // Test uninitialized state + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : uninitialized state"); + + if (! DoLineSetAppSpecific( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + + } + + // Try a valid test case + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : valid params and state"); + + + + 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; + + // InitializeEx a line app + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the API version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with LINECALLPRIVILEGE_OWNER + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Set the dwAppSpecific field and verify it was set + lpTapiLineTestInfo->dwAppSpecific = DWAPPSPECIFICVALUE; + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : Verify dwAppSpecific field was updated correctly"); + + // Call lineGetCallInfo and verify that the dwAppSpecific field of + // the LINECALLINFO structure has been updated. + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO) + ); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (lpTapiLineTestInfo->lpCallInfo->dwAppSpecific != DWAPPSPECIFICVALUE) + { + TapiLogDetail( + DBUG_SHOW_FAILURE, + "!> dwAppSpecific field was not updated correctly"); + + TLINE_FAIL(); + } + + + // Verify that the LINE_CALLINFO/APPSPECIFIC message is sent to another + // app that has a call handle for this call + AddMessage( + LINE_CALLINFO, + 0x0, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_APPSPECIFIC, + 0x0, + 0x0, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 + ); + + // Wait for the async reply + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + + // Drop the call + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Deallocate the call + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Close the line and shutdown + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Free the memory taken from the heap + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAppSpecific Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAppSpecific Test Failed"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing lineSetAppSpecific <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/iline/itlst.c b/private/tapi/qa/trapper/itest/iline/itlst.c new file mode 100644 index 000000000..cfd3869c0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlst.c @@ -0,0 +1,182 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlst.c + +Abstract: + + This module contains the test functions for lineSetupTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineSetupTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetupTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetupTransfer"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetupTransfer for go/no-go"); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetupTransfer Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetupTransfer Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itlsuui.c b/private/tapi/qa/trapper/itest/iline/itlsuui.c new file mode 100644 index 000000000..938393084 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itlsuui.c @@ -0,0 +1,208 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsuui.c + +Abstract: + + This module contains the test functions for lineSendUserUserInfo + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineSendUserUserInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSendUserUserInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSendUserUserInfo"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSendUserUserInfo for go/no-go"); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSendUserUserInfo Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSendUserUserInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/iline/itluh.c b/private/tapi/qa/trapper/itest/iline/itluh.c new file mode 100644 index 000000000..7dd6e6528 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/itluh.c @@ -0,0 +1,255 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itluh.c + +Abstract: + + This module contains the test functions for lineUnhold + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "iline.h" + + +// lineUnhold +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized (called before any lines are initialized) +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// + +BOOL TestLineUnhold(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + DWORD dwESPDeviceID; + INT n; + BOOL fResult; + BOOL fTestPassed = TRUE; + BOOL fEspFlag = TRUE; + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineUnhold <<<<<<<<" + ); + + // Test uninitialized state + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : uninitialized state"); + + if (! DoLineUnhold( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE + )) + { + TLINE_FAIL(); + } + + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case : valid params and state and verify\r\n" \ + ">> LINECALLSTATE message is sent when line is taken off hold" + ); + + 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; + + // InitializeEx a line app + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the API version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Find an ESP device that supports Hold/Unhold + if (! FindESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + lpTapiLineTestInfo->dwDeviceID = 0; + TLINE_FAIL(); + fTestPassed = TRUE; + } + dwESPDeviceID = lpTapiLineTestInfo->dwDeviceID; + + // Open a line with LINECALLPRIVILEGE_NONE + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Put the call on hold + if(fEspFlag) + { + if (! (fResult = DoLineHold(lpTapiLineTestInfo, TAPISUCCESS, FALSE))) + { + TLINE_FAIL(); + } + + // Verify that the LINE_CALLSTATE/ONHOLD message is sent when the call is + // is put on hold + if (fResult) + { + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLD, + 0x0, + 0x0, + TAPIMSG_ALL + ); + } + + // Wait for the async reply + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Retrieve the held call + if (! DoLineUnhold(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + + + // Verify that a LINE_CALLSTATE message is sent notifying the owner of + // the current state the retrieved call is in. + if (fResult) + { + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphCall, + (DWORD) lpCallbackParams, + 0x0, // Call state might be connected or in another state + 0x0, + 0x0, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST + ); + } + + // Wait for the async reply + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + } + else + { + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + // Drop the call + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Deallocate the call + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Close the line and shutdown + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Free the memory taken from the heap + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineUnhold Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineUnhold Test Failed"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing lineUnhold <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/iline/makefile b/private/tapi/qa/trapper/itest/iline/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/iline/sources b/private/tapi/qa/trapper/itest/iline/sources new file mode 100644 index 000000000..2f478eb06 --- /dev/null +++ b/private/tapi/qa/trapper/itest/iline/sources @@ -0,0 +1,70 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=iline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x68000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES= iline.c \ + itlac.c \ + itlas.c \ + itlbt.c \ + itlfw.c \ + itlruui.c \ + itlsuui.c \ + itlst.c \ + itlct.c \ + itlnev.c \ + itlh.c \ + itluh.c \ + itlsas.c \ + iline.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=ILineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/line/dirs b/private/tapi/qa/trapper/itest/line/dirs new file mode 100644 index 000000000..ed8aadd2c --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/dirs @@ -0,0 +1,3 @@ +DIRS= linea\ + linew + diff --git a/private/tapi/qa/trapper/itest/line/itlc.c b/private/tapi/qa/trapper/itest/line/itlc.c new file mode 100644 index 000000000..a4821928b --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlc.c @@ -0,0 +1,1541 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlc.c + +Abstract: + + This module contains the test functions for lineClose + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "tline.h" + + +#define DWNUMCALLS 1 + +// Macro for handling unexpected failures during the tests +#define ITLC_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + +// lineClose +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines +// 3) Close line and close same line again +// 4) Verify LINE_LINEDEVSTATE/OPEN and CLOSE messages are received +// by a monitor on the same hLineApp +// 5) Verify LINE_LINEDEVSTATE/OPEN and CLOSE messages are received +// by a monitor on different hLineApps +// 6) Verify LINE_LINEDEVSTATE/OPEN and CLOSE messages are received +// by an owner on the same hLineApp +// 7) Verify LINE_LINEDEVSTATE/OPEN and CLOSE messages are received +// by an owner on different hLineApps +// 8) Verify LINE_CALLINFO/NUMMONITORS message sent to call owner +// if the monitor is closed on the same hLineApp as the owner +// 9) Verify LINE_CALLINFO/NUMMONITORS and LINE_CALLINFO/ +// NUMOWNERINCR messages are sent when a monitor becomes a second +// owner. Next, verify LINE_CALLINFO/NUMOWNERDECR message is +// sent when one of the owners is close (on same hLineApp) +// 10) Verify LINE_CALLINFO/NUMMONITORS message sent to call owner +// if the monitor is closed on different hLineApps as the owner +// 11) Verify LINE_CALLINFO/NUMMONITORS and LINE_CALLINFO/ +// NUMOWNERINCR messages are sent when a monitor becomes a second +// owner. Next, verify LINE_CALLINFO/NUMOWNERDECR message is +// sent when one of the owners is close (on different hLineApps) +// +// * = Stand-alone test case +// + +BOOL TestLineClose(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + strcpy(lpTapiLineTestInfo->szTestFunc, "lineClose"); + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + // Allocate more than enough to store a call handle + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 8; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineClose <<<<<<<<" + ); + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized state", dwTestCase+1); + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + } + + + // Try closing a line before one has been opened + // Go ahead and initialize to prevent the possibility of an + // UNINITIALIZED error to be returned + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lineClose before line has been opened", dwTestCase+1); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Try the close before a line has been opened + // lphLine is initialized to point to hLine1, so set it to an invalid + // value (e.g. the hLineApp value) + lpTapiLineTestInfo->hLine1 = (HLINE) *lpTapiLineTestInfo->lphLineApp; + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown the line to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + + // Try a valid close with no active call handles + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpLineDevCaps = AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid lineClose with no active calls", dwTestCase+1); + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Try the valid close with active call handles + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpLineDevCaps = AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid lineClose with an active call process", dwTestCase+1); + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + | LMAKECALL + )) + { + ITLC_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; +// lpTapiLineTestInfo->lpLineDevCaps = AllocFromTestHeap(sizeof(LINEDEVCAPS)); +// lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL | LCLOSE + )) + { + ITLC_FAIL(); + } + + // Attempt to close the line again + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %d: Testing lineClose using hLine that was just closed", dwTestCase+1); + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + ITLC_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Test some invalid line handles with at least one valid open line handle + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line handles", dwTestCase+1); + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpLineDevCaps = AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + ITLC_FAIL(); + } + } + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + + // Begin testing LINE_LINEDEVSTATE messages are sent. + // For the first test, open a line with monitor privilege. + // Set the status messages to allow LINE_LINEDEVSTATE/OPEN & CLOSE + // messages to be received by the monitor. Open another monitor + // using the same hLineApp, and close the second monitor. Verify + // that both the OPEN and CLOSE messages are sent. + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_LINEDEVSTATE/OPEN & CLOSE messages are\r\n" \ + ">> received by monitor (on same hLineApp)", dwTestCase+1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpLineDevCaps = AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Set the status messages to allow it to receive LINE_LINEDEVSTATE + // OPEN and CLOSE messages. + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_OPEN | + LINEDEVSTATE_CLOSE; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_ALL; + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Open a second monitor on with the same hLineApp + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/OPEN message to the list of expected + // messages + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_OPEN, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/OPEN message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Now close the second monitor and verify that LINE_LINEDEVSTATE/CLOSE + // is sent to the other monitor + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + + // Add the LINE_LINEDEVSTATE/CLOSE message to the list of expected + // messages + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_CLOSE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/CLOSE message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + + // For the next test, open a second line with monitor privilege + // using the same line device but with a different hLineApp. + // Close the second monitor. Verify that both the OPEN and + // CLOSE messages are sent to the other monitor. + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_LINEDEVSTATE/OPEN & CLOSE messages are\r\n" \ + ">> received by monitor (on different hLineApp)", dwTestCase+1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Set the status messages to allow it to receive LINE_LINEDEVSTATE + // OPEN and CLOSE messages. + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_OPEN | + LINEDEVSTATE_CLOSE; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_ALL; + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the first hLineApp and hLine values + lpTapiLineTestInfo->hLineApp2 = *lpTapiLineTestInfo->lphLineApp; + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Initialize another hLineApp + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Open a line with monitor privilege using a different hLineApp + // than the existing monitor (Use the same line device + // and device capabilities negotiated before. Assume the device + // still exists and it's capabilities haven't changed). + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/OPEN message to the list of expected + // messages + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_OPEN, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/OPEN message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Now close the second monitor and verify that LINE_LINEDEVSTATE/CLOSE + // is sent to the other monitor + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/CLOSE message to the list of expected + // messages + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_CLOSE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/CLOSE message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Shutdown the hLineApp that was closed + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // Close the first monitor and shutdown the line app instance + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Next test...initialize a line app and open a line with owner + // privilege. Set the status messages for the owner to receive + // LINE_LINEDEVSTATE/OPEN and CLOSE. Verify that OPEN and CLOSE + // messages are sent to the owner when another line is opened and + // and closed (using the same hLineApp). + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_LINEDEVSTATE/OPEN & CLOSE messages are\r\n" \ + ">> received by owner (on same hLineApp)", dwTestCase +1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Set the status messages to allow it to receive LINE_LINEDEVSTATE + // OPEN and CLOSE messages. + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_OPEN | + LINEDEVSTATE_CLOSE; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_ALL; + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the first hLineApp and hLine values + lpTapiLineTestInfo->hLineApp2 = *lpTapiLineTestInfo->lphLineApp; + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Open another line using the same hLineApp and verify a + // LINE_LINEDEVSTATE message is sent to the owner. + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/OPEN message to the list of expected + // messages + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_OPEN, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/OPEN message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Now close the second line and verify that LINE_LINEDEVSTATE/CLOSE + // is sent to the owner + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/CLOSE message to the list of expected + // messages + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_CLOSE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/CLOSE message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown the hLineApp to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // For the next test, open a second line with monitor privilege + // using the same line device but with a different hLineApp. + // Close the monitor. Verify that both the OPEN and + // CLOSE messages are sent to the owner. + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_LINEDEVSTATE/OPEN & CLOSE messages are\r\n" \ + ">> received by owner (on different hLineApp)", dwTestCase+1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Set the status messages to allow it to receive LINE_LINEDEVSTATE + // OPEN and CLOSE messages. + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_OPEN | + LINEDEVSTATE_CLOSE; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_ALL; + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the first hLineApp and hLine values + lpTapiLineTestInfo->hLineApp2 = *lpTapiLineTestInfo->lphLineApp; + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Open another line using the same hLineApp and verify a + // LINE_LINEDEVSTATE message is sent to the owner. + + // Initialize another hLineApp + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Open a line with monitor privilege using a different hLineApp + // than the owner (Use the same line device and device + // capabilities negotiated before. Assume the device + // still exists and it's capabilities haven't changed). + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/OPEN message to the list of expected + // messages the owner should receive + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_OPEN, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/OPEN message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Now close the monitor and verify that LINE_LINEDEVSTATE/CLOSE + // is sent to the owner + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Add the LINE_LINEDEVSTATE/CLOSE message to the list of expected + // messages the owner should receive + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + LINEDEVSTATE_CLOSE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // Wait for the LINE_LINEDEVSTATE/CLOSE message + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Shutdown the hLineApp that was closed + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // Close the owner and shutdown the line app instance + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + + // Verify that the LINE_CALLINFO/NUMMONITORS message is sent to + // a call owner when a monitor on the same line is closed. + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMMONITORS message is\r\n" \ + ">> received by owner after closing a monitor (on same hLineApp)", dwTestCase+1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Store line handle from the owner line before opening the + // second line with monitor privilege + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Make a call with the owner (hLine2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + ITLC_FAIL(); + } + + // Open another line (using the same hLineApp and device) with + // monitor privilege + + // Store the call handle for the owner with hLine2 and hLineApp2 + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + // Verify LINECALLINFO/NUMMONITORS message is sent to the owner + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Now close the line and see if another LINE_CALLINFO/NUMMONITORS + // message is sent to the owner (hLine2, hCall2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + + // Close and shutdown to isolate the test case + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Now test (using the same call and owner) with a monitor opened + // using a different line app instance + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMMONITORS message is received\r\n" \ + ">> by owner after closing a monitor (on different hLineApp)", dwTestCase+1 + ); + +// lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + // XYD, it should be hLineApp2 + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Store line handle from the owner line before opening the + // second line with monitor privilege + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Make a call with the owner (hLine2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + ITLC_FAIL(); + } + + // Open another line (using a different hLineApp) with + // monitor privilege + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + // Verify LINECALLINFO/NUMMONITORS message is sent to the owner + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Now close the line and see if another LINE_CALLINFO/NUMMONITORS + // message is sent to the owner (hLine2, hCall2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Close and shutdown to isolate the test case + + // First, shutdown the closed monitor's hLineApp + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Second, clean up and remove the owner + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Verify LINE_CALLINFO/NUMOWNERINCR & NUMMONITORS msg is sent + // to the owner of a call when a monitor becomes an owner + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMOWNERINCR & NUMMONITORS msg is\r\n" \ + ">> received by owner after changing a monitor\r\n" \ + ">> to an owner (on same hLineApp)", dwTestCase+1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Store line handle from the owner line before opening the + // second line with monitor privilege + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Make a call with the owner (hLine2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + ITLC_FAIL(); + } + + // Open another line (using the same hLineApp and device) with + // monitor privilege + + // Store the call handle for the owner with hLine2 and hLineApp2 + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + // Verify LINECALLINFO/NUMMONITORS message is sent to the owner + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Make the monitor an owner and verify the proper message is sent to + // the original owner. + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + if (DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Verify LINE_CALLINFO/NUMOWNERDECR msg is received \r\n" \ + ">> by owner after removing an owner (on same hLineApp)\r\n" + ); + + // Close the second owner and check for NUMOWNERDECR message + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + } + else + { + ITLC_FAIL(); + } + + // Close and shutdown to isolate the test case + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + ITLC_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Verify LINE_CALLINFO/NUMOWNERINCR & NUMMONITORS msg and + // LINE_CALLINFO/NUMOWNERDECR are sent to owner + // on different hLineApp + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMOWNERINCR & NUMMONITORS msg is received\r\n" \ + ">> by owner after changing a monitor to an owner\r\n" \ + ">> (on different hLineApp)", dwTestCase+1 + ); + + // XYD, hLineApp should be 2 + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; +// lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Store line handle from the owner line before opening the + // second line with monitor privilege + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + + // Make a call with the owner (hLine2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + ITLC_FAIL(); + } + + + // Open another line (using a different hLineApp) with + // monitor privilege + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + ITLC_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + + // Verify LINECALLINFO/NUMMONITORS message is sent to the owner + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + + // Make the monitor an owner + // XYD add, before call, must set hCall to hCall1 + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Verify LINE_CALLINFO/NUMOWNERDECR msg is received \r\n" \ + ">> by owner after removing an owner (on different hLineApp)\r\n" + ); + + // Now close the line and see if LINE_CALLINFO/NUMOWNERDECR + // message is sent to the owner (hLineApp2, hLine2, hCall2) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + ITLC_FAIL(); + } + + // Close and shutdown to isolate the test case + + // First, shutdown the closed monitor's hLineApp + // XYD 2/27/96 +// lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + + // Second, clean up and remove the owner + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + ITLC_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // Test Case: generate a LINE_CLOSE message and try to open + // the line device again. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Generate LINE_CLOSE msg and try to open" + " hLine -- should succeed", + dwTestCase+1); + + // + // Negotiate the API Version + // + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the phone device capabilities + // + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = LINE_CLOSE; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = &info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + // + // Add the LINESTATE_CLOSE message to the list of expected + // messages. + // + + AddMessage(LINE_CLOSE, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG)); + + if(!DoLineDevSpecific(lpTapiLineTestInfo,TAPISUCCESS,TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "TestLineClose: Did not receive LINE_CLOSE message."); + } + + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineClose: 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 lineClose <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itldc.c b/private/tapi/qa/trapper/itest/line/itldc.c new file mode 100644 index 000000000..af61978f7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itldc.c @@ -0,0 +1,523 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itldc.c + +Abstract: + + This module contains the test functions for lineDeallocateCall + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define DWNUMCALLS 1 + + +// lineDeallocateCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// x* 1) Uninitialized +// x 2) Invalid hCalls +// x 3) Deallocate when sole owner and not idle +// It is allowed now. +// x 4) Verify hCall no longer valid by deallocating a second time +// x 5) Verify LINE_CALLINFO/NUMMONITORS sent to call owner after +// deallocating a monitor +// 6) Verify LINE_CALLINFO/NUMMONITORS & NUMOWNERINCR sent +// to call owner when the number of owners is incremented +// 7) Verify LINE_CALLINFO/NUMOWNERDECR msg sent to call owner when +// the number of owners is decremented +// 8) Verify deallocation does not affect the call state of the +// physical call +// + +BOOL TestLineDeallocateCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + BOOL fResult; + BOOL fTestPassed = TRUE; + ESPDEVSPECIFICINFO info; + + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineDeallocateCall <<<<<<<<" + ); + + // Test uninitialized if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineDeallocateCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Start with invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1); + + // Init and open a line + + // Negotiate the current API version + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Get the device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + // Allocate more than enough to store the call handle + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 1; + + // Open a line with owner privilege + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + // Try a set of invalid call handles + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineDeallocateCall( + lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify hCall no longer good (try to dwalloc again)", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Deallocate the call a second time (call handle should now be invalid) + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Verify call handle is invalid after it's been deallocated"); + + if (! DoLineDeallocateCall(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + // Make a call and verify LINECALLINFO/NUMMONITORS msg sent when + // deallocating a monitor + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINECALLINFO/MONITORS sent when deallocating a monitor", dwTestCase + 1); + + // Reinit a line and make a call + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + // BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open another line using the same line device with monitor privilege + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall2) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + // Add the expected LINE_CALLINFO message to the list of expected + // TAPI messages that the owner will receive and wait for it + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Deallocate the monitor and verify LINECALLINFO/NUMMONITORS sent + // to owner as an indication that the total has been decremented + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Drop, deallocate, close, and shutdown the owner (it will cleanup + // the deallocated monitor since it's on the same hLineApp) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Next, verify that the LINE_CALLINFO/NUMOWNERINCR and NUMOWNERDECR + // messages are sent to the original call owner when the second owner + // is created and deallocated. + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINECALLINFO/NUMOWNERINCR msgs sent", dwTestCase + 1); + + + // Reinit a line and make a call + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + // BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open another line using the same line device with monitor privilege + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Acquire a call handle for the second open line + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall2) + // Note: The lpCallList structure has already been allocated + // from the previous scenario. + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + // Add the expected LINE_CALLINFO message to the list of expected + // TAPI messages that the owner will receive and wait for it + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Obtain owner privilege and check for LINE_CALLINFO/NUMOWNERINCR + // message to be sent to original owner + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + if (! (fResult = DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS))) + { + TLINE_FAIL(); + } + + if (fResult) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + } + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINECALLINFO/NUMOWNERDECR msgs sent", dwTestCase + 1); + + // Deallocate the second owner and verify LINECALLINFO/NUMOWNERDECR + // sent to owner as an indication that the total has been decremented + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Drop, deallocate, close, and shutdown the owner (it will cleanup + // the deallocated monitor since it's on the same hLineApp) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Free the memory allocated from the heap during the test cases + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineDeallocateCall: Total Test Case = %ld, Passed = %ld, Failed = %ld", + dwTestCase, dwTestCasePassed, dwTestCaseFailed); + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ Total Test Case = %ld, Passed = %ld, Failed = %ld", + dwglTestCase, dwglTestCasePassed, dwglTestCaseFailed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing lineDeallocateCall <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itldial.c b/private/tapi/qa/trapper/itest/line/itldial.c new file mode 100644 index 000000000..52d9b2727 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itldial.c @@ -0,0 +1,774 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itldial.c + +Abstract: + + This module contains the test functions for lineDial + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/28/96 Added unicode support + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define DWNUMCALLS 1 + + +// lineDial +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Attempt to dial without owner privilege +// 3) Invalid hCalls (test array of gdwInvalidHandles) +// 4) Invalid lpszDestAddress pointers (test array of gdwInvalidPointers) +// 5) Call lineDial before a line has been opened +// 6) Valid test cases +// +// * = Stand-alone test case +// + +BOOL TestLineDial(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + BOOL fResult; + + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + ESPDEVSPECIFICINFO info; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + // Allocate more than enough to store a call handle + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 1; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineDial <<<<<<<<" + ); + + // Test uninitialized case. + // Note: It is assumed that the parameter fStandAlone correctly + // indicates if there are any other TAPI apps or threads + // currently running. + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + // Init and get dev caps + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify lineDial fails when a line hasn't been opened", dwTestCase + 1 + ); + + // Allocate linedevcaps + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + // Try dialing before a line has been opened + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Try dialing after line has been opened but before calling lineMakeCall + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify lineDial fails after lineOpen but before lineMakeCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Test invalid lpszDestAddress pointers + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDestAddress pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDestAddress pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + +/* + // Perform a valid test + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCountryCode, -1", dwTestCase + 1 + ); + + // Prep again for lineDrop test +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = NULL; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + ); + + if (! fResult) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + lpTapiLineTestInfo->dwCountryCode = 0xffffffff; + + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCOUNTRYCODE, TRUE)) + { + TLINE_FAIL(); + } + + // Drop the call, deallocate it, and start over. + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); +*/ + + lpTapiLineTestInfo->dwCountryCode = 0; + + // Test invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *lpTapiLineTestInfo->lphCall; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[n]; + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + *lpTapiLineTestInfo->lphCall = lpTapiLineTestInfo->hCall_Orig; + + // Drop the call, deallocate it, and start over. + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Perform a valid test + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, with valid params and state", dwTestCase + 1 + ); + + // Prep again for lineDrop test +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = NULL; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + ); + + if (! fResult) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if (! DoLineDial(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Drop the call, deallocate it, and start over. + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Verify lineDial fails when not the owner of the call + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify lineDial fails when not the owner of the call", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = NULL; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + // Open a second line (same device) with monitor privilege + + // Store the owner's line handle + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + lpTapiLineTestInfo->hCall2 = *lpTapiLineTestInfo->lphCall; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall1) + // Note: The lpCallList structure has already been allocated + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + + // Deallocate the call handle and close the monitor line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE + )) + { + TLINE_FAIL(); + } + + // Drop and clean up the owner line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Free the memory allocated during the tests + 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.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + + if (! DoLineDial(lpTapiLineTestInfo, info.u.EspResult.lResult, TRUE)) + { + TLINE_FAIL(); + } + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL + ); + + } + fTestPassed = ShowTestCase(fTestPassed); + + // Drop the call, deallocate it, and start over. + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + 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->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + 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.u.EspResult.lResult = LINEERR_ADDRESSBLOCKED; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + + if (! DoLineDial(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; + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL + ); + + } + fTestPassed = ShowTestCase(fTestPassed); + + // Drop the call, deallocate it, and start over. + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineDial: 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 lineDial <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itldrop.c b/private/tapi/qa/trapper/itest/line/itldrop.c new file mode 100644 index 000000000..784bd281c --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itldrop.c @@ -0,0 +1,781 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itldrop.c + +Abstract: + + This module contains the test functions for lineDrop + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define DWNUMCALLS 1 +#define NUMTOTALSIZES 5 + + + +// lineDrop +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Attempt to drop a call when not the owner +// 3) Invalid hCalls +// 4) Invalid lpUserUserInfo pointers +// 5) Combinations of allocation sizes and dwTotalSize values for +// lpUserUserInfo +// 6) Valid test case when lpUserUserInfo == NULL +// 7) Valid test case when lpUserUserInfo != NULL +// +// * = Stand-alone test case +// + +BOOL TestLineDrop(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + DWORD dwAllMediaModes; + CHAR szValidUUInfo[] = "Testing valid UserUserInfo string"; + INT n; + DWORD dwFixedSize = strlen(szValidUUInfo); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + ESPDEVSPECIFICINFO info; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Allocate more than enough to store a call handle + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 1; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineDrop <<<<<<<<" + ); + + // Test uninitialized case. + // Note: It is assumed that the parameter fStandAlone correctly + // indicates if there are any other TAPI apps or threads + // currently running. + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + + // Test invalid hCall values + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *lpTapiLineTestInfo->lphCall; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[n]; + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphCall = lpTapiLineTestInfo->hCall_Orig; + + // Drop the call, deallocate it, and start over. + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpUserUserInfo pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpUserUserInfo pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwSize = 128; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LGETDEVCAPS | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +// XYD, it should test invail lpUserUserInfo, not lpszDestAddress +// lpTapiLineTestInfo->lpszDestAddress = (LPSTR) gdwInvalidPointers[n]; + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) gdwInvalidPointers[n]; + if (lpTapiLineTestInfo->lpsUserUserInfo != NULL) // NULL is valid + { + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + +//XYD lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad UserUserInfo dwSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = szValidUUInfo; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineDrop(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = dwFixedSize; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad UserUserInfo dwSize, -1 (lpsUserUserInfo != NULL)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = szValidUUInfo; + lpTapiLineTestInfo->dwSize = (DWORD) strlen(szValidUUInfo); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwSize = 0xffffffff; + + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = 0; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + // Open a line. Open the same line device + // using the same hLineApp with monitor privilege. Make a call + // with the first hLine. Have the monitor get the call handle of + // the outbound call. Try dropping the call with the monitor's + // call handle (should return LINEERR_NOTOWNER). + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify lineDrop fails when not the owner of the call", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open a second line (same device) with monitor privilege + + // Store the owner's line handle + lpTapiLineTestInfo->hLine2 = *lpTapiLineTestInfo->lphLine; + lpTapiLineTestInfo->hCall2 = *lpTapiLineTestInfo->lphCall; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall1) + // Note: The lpCallList structure has already been allocated + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Deallocate the call handle and close the monitor line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE + )) + { + TLINE_FAIL(); + } + + // Drop and clean up the owner line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +// XYD: should add dwSize test case here + + // Test valid params and state (lpUserUserInfo == NULL) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state (lpsUserUserInfo == NULL)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; +// lpTapiLineTestInfo->lpsUserUserInfo = NULL; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test valid params and state (lpUserUserInfo == valid string) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state (lpsUserUserInfo != NULL)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = szValidUUInfo; + lpTapiLineTestInfo->dwSize = (DWORD) strlen(szValidUUInfo); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Free the memory allocated during the tests + 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(); + } + + if ( ! DoLineDrop(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_INVALCALLSTATE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineDrop(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, + "@@ lineDrop: 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 lineDrop <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlgac.c b/private/tapi/qa/trapper/itest/line/itlgac.c new file mode 100644 index 000000000..399304964 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgac.c @@ -0,0 +1,919 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgac.c + +Abstract: + + This module contains the test functions for lineGetAddressCaps + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "ttest.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + +// lineGetAddressCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid Device ID (-1, dwNumDevs) +// 3) Invalid Address ID (-1, dwNumAddresses) +// 4) Invalid hLineApps +// 5) Incompatible API version (too low, too high) +// 6) Incompatible extension version +// 7) Invalid lpLineAddressCaps pointers +// 8) Test combinations of allocations and dwTotalSizes +// (some valid and some invalid) +// +// * = Stand-alone test case +// + +BOOL TestLineGetAddressCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + CHAR szTestFunc[] = "lineGetAddressCaps"; + size_t VersionSize; + LPLINEADDRESSCAPS lpLineAddressCaps; + DWORD dwFixedSize1 = 44*sizeof(DWORD); + DWORD dwFixedSize2 = 45*sizeof(DWORD); + DWORD dwTotalSizes1[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize1 - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + DWORD dwTotalSizes2[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize2 - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + DWORD dwFixedSize = sizeof(LINEADDRESSCAPS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + strcpy(lpTapiLineTestInfo->szTestFunc, szTestFunc); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap(sizeof(LINEEXTENSIONID)); + + // Allocate fixed size for lpLineAddressCaps pointer during + // these initial test sets + lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps = + (LPLINEADDRESSCAPS) lpLineAddressCaps; + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + + // Allocate fixed size for lpLineDevCaps pointer + lpTapiLineTestInfo->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetAddressCaps <<<<<<<<" + ); + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized state", dwTestCase + 1); + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + } + + + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + +// Try working with any device +#if 0 + // Find an ESP line device + if (! FindESPLineDevice(lpTapiLineTestInfo)) + { + TLINE_FAIL(); + } +#endif + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid lplineAddressCaps pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid invalid lpLineAddressCaps pointers", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpLineAddressCaps = + (LPLINEADDRESSCAPS) gdwInvalidPointers[n]; + if (! DoLineGetAddressCaps( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the lplineAddressCaps pointer + lpTapiLineTestInfo->lpLineAddressCaps = lpLineAddressCaps; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineGetAddressCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineGetAddressCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible extension version + // TODO: Error will never occur if ESP line device is used. + // ESP just sets the extension version equal to the + // high value passed to lineNegotiateExtVersion API function... + // A test provider (such as a modified version of ESP) + // could be used to enforce certain version values to be valid. +#if 0 + lpTapiLineTestInfo->dwExtVersion_Orig = + *lpTapiLineTestInfo->lpdwExtVersion; + *(lpTapiLineTestInfo->lpdwExtVersion) = BAD_EXTVERSION; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEEXTVERSION)) + { + TLINE_FAIL(); + } + *(lpTapiLineTestInfo->lpdwExtVersion) = + lpTapiLineTestInfo->dwExtVersion_Orig; +#endif + + // Check invalid address ID (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = DWMINUSONE; + if (! DoLineGetAddressCaps( + lpTapiLineTestInfo, + LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid address ID (dwNumAddresses) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (dwNumAddresses)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineGetAddressCaps( + lpTapiLineTestInfo, + LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Set dwAddressID to 0 + lpTapiLineTestInfo->dwAddressID = 0; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize for 1.3 API version", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion = 0x00010003; + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap ( + dwFixedSize1); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = + dwTotalSizes1[n]; + if(dwTotalSizes1[n] < dwFixedSize1) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes1[n]); + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize for 1.4 API version", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion = 0x00010004; + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap ( + dwFixedSize2); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = + dwTotalSizes2[n]; + if(dwTotalSizes2[n] < dwFixedSize2) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes2[n]); + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize for 2.0 API version", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap ( + dwFixedSize); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = dwFixedSize; + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwExtVersion", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwExtVersion = BAD_EXTVERSION; + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_INCOMPATIBLEEXTVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwExtVersion = 0x00000000; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Free the local heap allocations + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify retutrn data for different APIversion", dwTestCase + 1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion = 0x00010004; + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap ( + dwFixedSize2); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = dwFixedSize2; + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + "dwAddressFeatures = %lx", + lpTapiLineTestInfo->lpLineAddressCaps->dwAddressFeatures); + + fTestPassed = ShowTestCase(fTestPassed); + + + + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap ( + dwFixedSize); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = dwFixedSize; + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + "dwAddressFeatures = %lx, dwCallFeatures2 = %lx, dwAvaiMediaModes = %lx", + lpTapiLineTestInfo->lpLineAddressCaps->dwAddressFeatures, + lpTapiLineTestInfo->lpLineAddressCaps->dwCallFeatures2, + lpTapiLineTestInfo->lpLineAddressCaps->dwAvailableMediaModes); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Free the local heap allocations + FreeTestHeap(); + + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEADDRESSCAPS); + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEADDRESSCAPS); + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetAddressCaps: 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 lineGetAddressCaps <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlgaid.c b/private/tapi/qa/trapper/itest/line/itlgaid.c new file mode 100644 index 000000000..a4bb2cad8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgaid.c @@ -0,0 +1,796 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgaid.c + +Abstract: + + This module contains the test functions for lineGetAddressID + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + +#define ALL_DWSELECTS (LINECALLSELECT_LINE | \ + LINECALLSELECT_ADDRESS | \ + LINECALLSELECT_CALL) + + +#define ALL_LINEADDRESSMODES (LINEADDRESSMODE_DIALABLEADDR) + + +// +// lineGetAddressID +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines +// 3) Invalid lpdwAddressID pointers +// 4) Invalid bit flag combinations for dwAddressMode +// 5) Invalid lpsAddress pointers +// 6) Invalid dwSizes +// 7) Valid cases +// +// * = Stand-alone test case +// + +BOOL TestLineGetAddressID(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LONG lExpected; + DWORD dwESPDeviceID; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + DWORD dwFixedSize = wcslen(wszValidAddress); +#else + CHAR szValidAddress[] = "55555"; + DWORD dwFixedSize = strlen(szValidAddress); +#endif + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEspFlag = TRUE; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + strcpy(lpTapiLineTestInfo->szTestFunc, "lineGetAddressID"); + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetAddressID <<<<<<<<" + ); + + // Test uninitialized case if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + // Start with invalid hLines + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1); + + // Init and open a line + + // Negotiate the current API version + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Get the device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX + )) + { + TLINE_FAIL(); + } + + if (! FindESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + lpTapiLineTestInfo->dwDeviceID = 0; + TLINE_FAIL(); + fTestPassed = TRUE; + } + + // Try opening the ESP device (Unimodem doesn't support DIALABLEADDR) + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Save the dwDeviceID of the ESP device + dwESPDeviceID = lpTapiLineTestInfo->dwDeviceID; + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Test invalid lpdwAddressID pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwAddressID pointers", dwTestCase + 1); + + // Init and open a line + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + lpTapiLineTestInfo->dwDeviceID = dwESPDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwAddressID = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineGetAddressID( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the lpdwAddressID pointer + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Test invalid lpsAddress pointers +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwsAddress pointers", dwTestCase + 1); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpsAddress pointers", dwTestCase + 1); +#endif + + // Init and open a line + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + lpTapiLineTestInfo->dwDeviceID = dwESPDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpsAddress = (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGetAddressID( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the lpsAddress pointer +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; +#endif + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize", dwTestCase + 1); + + // Init and open a line + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwDeviceID = dwESPDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] == 0) + { +#ifdef WUNICODE + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; +#else + lExpected = LINEERR_INVALPOINTER; +#endif + } + else if(dwTotalSizes[n] > 0 && dwTotalSizes[n] < dwFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAddressID(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = dwFixedSize; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressMode (-1)", dwTestCase + 1); + + // Init and open a line + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = 0xFFFFFFFF; + lpTapiLineTestInfo->dwDeviceID = dwESPDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_INVALADDRESSMODE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwAddressMode", dwTestCase + 1); + + // Init and open a line + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwDeviceID = dwESPDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALADDRESSMODE; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + + if (! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGetAddressID, + (LPDWORD) &lpTapiLineTestInfo->dwAddressMode, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_UNION, + FIELDSIZE_32, + ALL_LINEADDRESSMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xFFFFFFFF, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test valid params and state + // TODO: The valid bit flag test should be used here + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state", dwTestCase + 1); + + // Init and open a line + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwAddressID = &lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + lpTapiLineTestInfo->dwDeviceID = dwESPDeviceID; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGetAddressID(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 + )) + { + 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(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + + if ( ! DoLineGetAddressID(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = wszValidAddress; + lpTapiLineTestInfo->dwSize = wcslen(wszValidAddress); +#else + lpTapiLineTestInfo->lpsAddress = szValidAddress; + lpTapiLineTestInfo->dwSize = strlen(szValidAddress); +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + + if ( ! DoLineGetAddressID(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetAddressID: 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 lineGetAddressID <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itlgas.c b/private/tapi/qa/trapper/itest/line/itlgas.c new file mode 100644 index 000000000..f08e79e0a --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgas.c @@ -0,0 +1,615 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgas.c + +Abstract: + + This module contains the test functions for lineGetAddressStatus + +Author: + + Oliver Wallace (OliverW) 10-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + +// lineGetAddressStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines (test array of gdwInvalidHandles in itest.h) +// 3) Invalid dwAddressID (-1, dwNumAddresses for a line device) +// 4) Invalid lpAddressStatus pointers (test array of gdwInvalidPointers +// in itest.h) +// 5) Test various allocation sizes and dwTotalSize values for +// lpAddressStatus (see test case in this file for details) +// +// * = Stand-alone test case +// + +BOOL TestLineGetAddressStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPLINEADDRESSSTATUS lpLineAddressStatus; + size_t AddressStatusSize = sizeof(LINEADDRESSSTATUS); + DWORD dwFixedSize = sizeof(LINEADDRESSSTATUS); + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + LONG lExpected; + INT n; + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetAddressStatus <<<<<<<<" + ); + + // Test uninitialized case. + // Note: It is assumed that the parameter fStandAlone correctly + // indicates if there are any other TAPI apps or threads + // currently running. + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineGetAddressStatus( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Allocate the minimum amount of memory needed for the + // LINEADDRESSSTATUS structure so that some of the initial tests + // do not return INVALPOINTER errors due to the unassigned value of + // lpLineAddressStatus + if (! (lpTapiLineTestInfo->lpLineAddressStatus = + (LPLINEADDRESSSTATUS) AllocFromTestHeap( + sizeof(LINEADDRESSSTATUS) + ))) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = + sizeof(LINEADDRESSSTATUS); + + // Allocate the fixed size for the LINEDEVCAPS structure + if (! (lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) + AllocFromTestHeap(sizeof(LINEDEVCAPS)))) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = + sizeof(LINEDEVCAPS); + + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Test some invalid hLines + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetAddressStatus( + lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwAddressID, 0", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Test some invalid hLines + lpTapiLineTestInfo->dwAddressID = 0; + if (! DoLineGetAddressStatus( + lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwAddressID, dwNumAddresses", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Test some invalid hLines + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineGetAddressStatus( + lpTapiLineTestInfo, + LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = 0; + + + // Test invalid dwAddressID (-1) + 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; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (-1)", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = 0xFFFFFFFF; + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpLineAddressStatus pointers + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpLineAddressStatus pointers", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Back up the original valid lpLineAddressStatus pointer + lpLineAddressStatus = lpTapiLineTestInfo->lpLineAddressStatus; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpLineAddressStatus = + (LPLINEADDRESSSTATUS) gdwInvalidPointers[n]; + if (! DoLineGetAddressStatus( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the line address status pointer + lpTapiLineTestInfo->lpLineAddressStatus = lpLineAddressStatus; + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = dwFixedSize; + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = dwFixedSize; + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Close and shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->lpLineAddressStatus = + (LPLINEADDRESSSTATUS) AllocFromTestHeap( + sizeof(LINEADDRESSSTATUS) ); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = + sizeof(LINEADDRESSSTATUS); + + if ( ! DoLineGetAddressStatus(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineAddressStatus = + (LPLINEADDRESSSTATUS) AllocFromTestHeap( + sizeof(LINEADDRESSSTATUS) ); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = + sizeof(LINEADDRESSSTATUS); + + if ( ! DoLineGetAddressStatus(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetAddressStatus: 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 lineGetAddressStatus <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlgci.c b/private/tapi/qa/trapper/itest/line/itlgci.c new file mode 100644 index 000000000..fea3358e5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgci.c @@ -0,0 +1,553 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgci.c + +Abstract: + + This module contains the test functions for lineGetCallInfo + +Author: + + Oliver Wallace (OliverW) 17-Sep-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + + +// lineGetCallInfo +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hCalls +// 3) Invalid lpCallInfo pointers +// 4) Combinations of allocations and dwTotalSizes for lpCallInfo +// +// * = Stand-alone test + +BOOL TestLineGetCallInfo(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPLINECALLINFO lpCallInfo; + size_t CallInfoSize = sizeof(LINECALLINFO); + DWORD dwFixedSize = sizeof(LINECALLINFO); + DWORD dwTotalSizes[] = { + 0x0, + dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + INT n; + LONG lExpected; + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + strcpy(lpTapiLineTestInfo->szTestFunc, "lineGetCallInfo"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetCallInfo <<<<<<<<" + ); + + // Call lineSetCallPrivilege before any lines are initialized + // Note: This test must be run in a stand-alone mode + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineGetCallInfo( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + CallInfoSize + 256); + lpCallInfo->dwTotalSize = (DWORD) (CallInfoSize + 256); + lpTapiLineTestInfo->lpCallInfo = lpCallInfo; + + + // Try a valid case + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallInfo = lpCallInfo; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Stop, Drop, and Close to isolate test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Try invalid hCalls + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallInfo = lpCallInfo; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Back up the active call handle before testing invalid ones + lpTapiLineTestInfo->hCall_Orig = *lpTapiLineTestInfo->lphCall; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphCall = + (HCALL) gdwInvalidHandles[n]; + if (! DoLineGetCallStatus(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the valid call handle + *lpTapiLineTestInfo->lphCall = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Try invalid lpCallInfo pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallInfo pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallInfo = lpCallInfo; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Backup the lpCallInfo pointer before testing invalid pointers + lpCallInfo = lpTapiLineTestInfo->lpCallInfo; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallInfo = + (LPLINECALLINFO) gdwInvalidPointers[n]; + if (! DoLineGetCallInfo(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpCallInfo = lpCallInfo; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallInfo = lpCallInfo; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetCallInfo(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = dwFixedSize; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + CallInfoSize + 256); + lpCallInfo->dwTotalSize = (DWORD) (CallInfoSize + 256); + + if ( ! DoLineGetCallInfo(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + CallInfoSize + 256); + lpCallInfo->dwTotalSize = (DWORD) (CallInfoSize + 256); + + if ( ! DoLineGetCallInfo(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetCallInfo: 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 lineGetCallInfo <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itlgcs.c b/private/tapi/qa/trapper/itest/line/itlgcs.c new file mode 100644 index 000000000..cbd044d38 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgcs.c @@ -0,0 +1,559 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgcs.c + +Abstract: + + This module contains the test functions for lineGetCallStatus + +Author: + + Oliver Wallace (OliverW) 17-Sep-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + +// lineGetCallStatus +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hCalls +// 3) Invalid lpCallStatus pointers +// 4) Combinations of allocations and dwTotalSizes for lpCallStatus +// +// * = Stand-alone test + +BOOL TestLineGetCallStatus(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPLINECALLSTATUS lpCallStatus; + size_t CallStatusSize = sizeof(LINECALLSTATUS); + DWORD dwFixedSize = sizeof(LINECALLSTATUS); + DWORD dwTotalSizes[] = { + 0x0, + dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + INT n; + LONG lExpected; + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + strcpy(lpTapiLineTestInfo->szTestFunc, "lineGetCallStatus"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetCallStatus <<<<<<<<" + ); + + // Call lineSetCallPrivilege before any lines are initialized + // Note: This test must be run in a stand-alone mode + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineGetCallStatus( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + lpCallStatus = (LPLINECALLSTATUS) AllocFromTestHeap( + CallStatusSize + 256); + lpCallStatus->dwTotalSize = (DWORD) (CallStatusSize + 256); + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + + // Test valid state and params + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid state and params", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Stop, Drop, and Close to isolate test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Try invalid hCalls + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Backup the valid call handle + lpTapiLineTestInfo->hCall_Orig = *lpTapiLineTestInfo->lphCall; + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphCall = + (HCALL) gdwInvalidHandles[n]; + if (! DoLineGetCallStatus(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the valid call handle +//XYD *lpTapiLineTestInfo->lphCall = lpTapiLineTestInfo->hCall_Orig; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Try invalid lpCallStatus pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallStatus pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallStatus = + (LPLINECALLSTATUS) gdwInvalidPointers[n]; + if (! DoLineGetCallStatus(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the LineCallStatus pointer + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallStatus->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetCallStatus(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallStatus->dwTotalSize = dwFixedSize; + // Restore the LineCallStatus pointer + lpTapiLineTestInfo->lpCallStatus = lpCallStatus; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lpCallStatus = (LPLINECALLSTATUS) AllocFromTestHeap( + CallStatusSize + 256); + lpCallStatus->dwTotalSize = (DWORD) (CallStatusSize + 256); + + if ( ! DoLineGetCallStatus(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallStatus = (LPLINECALLSTATUS) AllocFromTestHeap( + CallStatusSize + 256); + lpCallStatus->dwTotalSize = (DWORD) (CallStatusSize + 256); + + if ( ! DoLineGetCallStatus(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetCallStatus: 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 lineGetCallStatus <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itlgdc.c b/private/tapi/qa/trapper/itest/line/itlgdc.c new file mode 100644 index 000000000..a0dd56b66 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgdc.c @@ -0,0 +1,853 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdc.c + +Abstract: + + This module contains the test functions for lineGetDevCaps + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + +// lineGetDevCaps +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid lpLineDevCaps pointers +// 3) Invalid dwDeviceID (dwNumDevs, -1) +// 4) Invalid hLineApps +// 5) Incompatible API version (too low, too high) +// 6) Test various allocation sizes and dwTotalSizes for +// lpLineDevCaps +// 7) Incompatible extension version (not tested yet) +// 8) Verify that lineGetDevCaps succeeds with valid parameters +// for dwDeviceIDs from 0 through dwNumDevs - 1 +// 10) Solicit SPI errors (NODEVICE, NODRIVER, NOMEM, OPERATIONFAILED, +// RESOURCEUNAVAIL, OPERATIONUNAVAIL) (not done yet...will be done +// in separate SP/device specific tests) +// 11) Verify returned data on success (not done yet...will be done +// in separate SP/device specific tests +// +// * = Test must be run as a stand-alone test case + +BOOL TestLineGetDevCaps(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; +#ifdef WUNICODE + WCHAR *pwszProviderInfo; + WCHAR *pwszLineName; + WCHAR *wszEspInfo = L"ESP v2.0"; + WCHAR *wszUnimdmInfo = L"Windows Telephony Service Provider for Universal Modem Driver"; + WCHAR *wszEspLineName = L"ESP Line 0"; + WCHAR *wszUnimdmLineName = L"Zoom VFX 28.8"; +#else + char *pszProviderInfo; + char *pszLineName; + char *szEspInfo = "ESP v2.0"; + char *szUnimdmInfo = "Windows Telephony Service Provider for Universal Modem Driver"; + char *szEspLineName = "ESP Line 0"; + char *szUnimdmLineName = "Zoom VFX 28.8"; +#endif + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPVOID lpLineDevCaps; + size_t VersionSize; + BOOL fResult; + DWORD dwFixedSize = sizeof(LINEDEVCAPS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap(sizeof(LINEEXTENSIONID)); + + // Allocated fixed size for lpLineDevCaps pointer during + // these initial test sets + lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) lpLineDevCaps; + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetDevCaps <<<<<<<<" + ); + + // Test for LINEERR_UNINITIALIZED if this is the only TAPI app running + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpLineDevCaps pointers", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Check invalid lpLineDevCaps pointers + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpLineDevCaps = + (LPLINEDEVCAPS) gdwInvalidPointers[n]; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the lpLineDevCaps pointer + lpTapiLineTestInfo->lpLineDevCaps = lpLineDevCaps; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwExtVersion", dwTestCase + 1); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +/* + if (! FindESPLineDevice(lpTapiLineTestInfo)) + { + TLINE_FAIL(); + } + + // Negotiate an extension version for the device + *(lpTapiLineTestInfo->lpdwExtVersion) = GOOD_EXTVERSION; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check incompatible extension version + // Currently this test will not fail because strict ext version + // checking not supported by SP + lpTapiLineTestInfo->dwExtVersion_Orig = + *(lpTapiLineTestInfo->lpdwExtVersion); +*/ + *(lpTapiLineTestInfo->lpdwExtVersion) = BAD_EXTVERSION; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEEXTVERSION)) + { + TLINE_FAIL(); + } + *lpTapiLineTestInfo->lpdwExtVersion = 0x00000000; +// lpTapiLineTestInfo->dwExtVersion_Orig; + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *lpTapiLineTestInfo->lpdwNumDevs; + if (! DoLineGetDevCaps(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Restore dwDeviceID + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + if (! DoLineGetDevCaps(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore dwDeviceID + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLineApp handles", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles; + if (! DoLineGetDevCaps(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLineApp = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *(lpTapiLineTestInfo->lpdwAPIVersion); + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOHIGH_APIVERSION; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore API version to version previously negotiated + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *(lpTapiLineTestInfo->lpdwAPIVersion); + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore API version to version previously negotiated + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) lpLineDevCaps; + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = dwFixedSize; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = dwFixedSize; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // zero the memory used from the heap + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, compare Provider strings", dwTestCase + 1); + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = dwFixedSize; + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + BIGBUFSIZE); +// lpTapiLineTestInfo->lpLineDevCaps->dwNeededSize); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = + BIGBUFSIZE; +// lpTapiLineTestInfo->lpLineDevCaps->dwNeededSize; + + if (! DoLineGetDevCaps( + lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + pwszProviderInfo = (WCHAR *)(((LPBYTE) lpTapiLineTestInfo->lpLineDevCaps) + + lpTapiLineTestInfo->lpLineDevCaps->dwProviderInfoOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %ws", + pwszProviderInfo); + + pwszLineName = (WCHAR *)(((LPBYTE) lpTapiLineTestInfo->lpLineDevCaps) + + lpTapiLineTestInfo->lpLineDevCaps->dwLineNameOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### LineName = %ws", + pwszLineName); +#else + pszProviderInfo = ((char *) lpTapiLineTestInfo->lpLineDevCaps) + + lpTapiLineTestInfo->lpLineDevCaps->dwProviderInfoOffset; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %s", + pszProviderInfo); + + pszLineName = (char *)(((LPBYTE) lpTapiLineTestInfo->lpLineDevCaps) + + lpTapiLineTestInfo->lpLineDevCaps->dwLineNameOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### LineName = %s", + pszLineName); +#endif + +#ifdef WUNICODE + if (!lstrcmpW(pwszProviderInfo, wszEspInfo)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The provider is ESP"); + fTestPassed = TRUE; + } + else if (!lstrcmpW(pwszProviderInfo, wszUnimdmInfo)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The provider is UNIMDM"); + fTestPassed = TRUE; + } + else + fTestPassed = FALSE; +#else + if (!lstrcmpA(pszProviderInfo, szEspInfo)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The provider is ESP"); + fTestPassed = TRUE; + } + else if (!lstrcmpA(pszProviderInfo, szUnimdmInfo)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The provider is UNIMDM"); + fTestPassed = TRUE; + } + else + fTestPassed = FALSE; +#endif + + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, compare LineName strings", dwTestCase + 1); + + +#ifdef WUNICODE + if (!lstrcmpW(pwszLineName, wszEspLineName)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The LineName is ESP"); + fTestPassed = TRUE; + } + else if (!lstrcmpW(pwszLineName, wszUnimdmLineName)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The LineName is UNIMDM"); + fTestPassed = TRUE; + } + else + fTestPassed = FALSE; +#else + if (!lstrcmpA(pszLineName, szEspLineName)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The LineName is ESP"); + fTestPassed = TRUE; + } + else if (!lstrcmpA(pszLineName, szUnimdmLineName)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "The LineName is UNIMDM"); + fTestPassed = TRUE; + } + else + fTestPassed = FALSE; +#endif + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // zero the memory used from the heap + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + 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->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if ( ! DoLineGetDevCaps(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_NODRIVER; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if ( ! DoLineGetDevCaps(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetDevCaps: 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 lineGetDevCaps <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/line/itlgid.c b/private/tapi/qa/trapper/itest/line/itlgid.c new file mode 100644 index 000000000..eb7abec08 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgid.c @@ -0,0 +1,965 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgid.c + +Abstract: + + This module contains the test functions for lineGetID + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + +#define ALL_DWSELECTS (LINECALLSELECT_LINE | \ + LINECALLSELECT_ADDRESS | \ + LINECALLSELECT_CALL) + + +// +// lineGetID +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines +// 3) Invalid hCalls +// 4) Invalid bit flag combinations for dwSelect +// 5) Invalid lpDeviceID pointers +// 6) Invalid lpszDeviceClass pointers +// 7) Combinations of invalid and valid allocations with various +// dwTotalSize values +// 8) Valid bit flag combinations for dwSelect +// +// * = Stand-alone test case +// + +BOOL TestLineGetID(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPVARSTRING lpDeviceID; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; + WCHAR wszDeviceClass[] = L"wave"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; + CHAR szDeviceClass[] = "wave"; +#endif + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + size_t VarStringSize = sizeof(VARSTRING); + DWORD dwFixedSize = sizeof(VARSTRING); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + strcpy(lpTapiLineTestInfo->szTestFunc, "lineGetID"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetID <<<<<<<<" + ); + + // Test uninitialized case if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + 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); + lpDeviceID = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpDeviceID->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + // Test invalid line handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (-1)", dwTestCase + 1); + + + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN +// LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = DWMINUSONE; + + if (! DoLineGetID( + lpTapiLineTestInfo, + LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (dwNumAddresses)", dwTestCase + 1); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineGetID( + lpTapiLineTestInfo, + LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwAddressID = 0; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test invalid lpDeviceID pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpDeviceID pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpDeviceID = (LPVARSTRING) gdwInvalidPointers[n]; + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpDeviceID = &(lpTapiLineTestInfo->DeviceID); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test invalid lpszDeviceClass pointers +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + lpTapiLineTestInfo->lpwszDeviceClass_Orig; +#else + lpTapiLineTestInfo->lpszDeviceClass = + lpTapiLineTestInfo->lpszDeviceClass_Orig; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = &(lpTapiLineTestInfo->DeviceID); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetID(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = dwFixedSize; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid bit flag combinations for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGetID, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + LINEERR_INVALCALLSELECT, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test valid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid bit flag combinations for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineGetID, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, +/* XYD, NA and MUTEX should exchange the position + FIELDTYPE_NA, + FIELDTYPE_MUTEX, +*/ + FIELDTYPE_MUTEX, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = &(lpTapiLineTestInfo->DeviceID); + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = dwFixedSize; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineGetID(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + lpTapiLineTestInfo->lpDeviceID = &(lpTapiLineTestInfo->DeviceID); + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = dwFixedSize; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#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(); + } + + if ( ! DoLineGetID(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->lpDeviceID = &(lpTapiLineTestInfo->DeviceID); + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = dwFixedSize; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szDeviceClass; +#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_NODEVICE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + if ( ! DoLineGetID(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetID: 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 lineGetID <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itlglds.c b/private/tapi/qa/trapper/itest/line/itlglds.c new file mode 100644 index 000000000..13ba8c35c --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlglds.c @@ -0,0 +1,546 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlglds.c + +Abstract: + + This module contains the test functions for lineGetLineDevStatus + +Author: + + Oliver Wallace (OliverW) 10-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMTOTALSIZES 5 + + +// lineGetLineDevStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines (test array of dwInvalidHandles in itest.h) +// 3) Invalid lpLineDevStatus pointers (test array of dwInvalidPointers +// in itest.h) +// 4) Test various combinations of allocation sizes and dwTotalSizes +// (see test case in this file for details) +// +// * = Stand-alone test case +// + +BOOL TestLineGetLineDevStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + size_t DevStatusSize = sizeof(LINEDEVSTATUS); + size_t dwDevStatusTotalSize = DevStatusSize + 256; + LPLINEDEVSTATUS lpLineDevStatus; + DWORD dwFixedSize = sizeof(LINEDEVSTATUS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + INT n; + + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetLineDevStatus <<<<<<<<" + ); + + // Test uninitialized case. + // Note: It is assumed that the parameter fStandAlone correctly + // indicates if there are any other TAPI apps or threads + // currently running. + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineGetLineDevStatus( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Allocate the minimum amount of memory needed for the + // LINEDEVSTATUS structure, so these initial tests don't fail + // because lpLineDevStatus hasn't been allocated + if (! (lpLineDevStatus = + (LPLINEDEVSTATUS) AllocFromTestHeap(DevStatusSize + 256))) + { + TLINE_FAIL(); + } + + lpLineDevStatus->dwTotalSize = DevStatusSize + 256; + lpTapiLineTestInfo->lpLineDevStatus = lpLineDevStatus; + + 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); + + + + // Test some invalid hLines + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLines", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->lpLineDevStatus = lpLineDevStatus; + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = dwDevStatusTotalSize; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetLineDevStatus( + lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpLineDevStatus pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpLineDevStatus pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->lpLineDevStatus = lpLineDevStatus; + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = dwDevStatusTotalSize; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpLineDevStatus = + (LPLINEDEVSTATUS) gdwInvalidPointers[n]; + if (! DoLineGetLineDevStatus( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineDevStatus = lpLineDevStatus; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSizes", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + dwFixedSize); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = dwFixedSize; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + // Test valid state and params + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->lpLineDevStatus = lpLineDevStatus; + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = dwDevStatusTotalSize; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (lpTapiLineTestInfo->lpLineDevStatus->dwNeededSize > + lpTapiLineTestInfo->lpLineDevStatus->dwUsedSize + ) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Reallocating and trying valid case again with\r\n" \ + ">> allocation of lpLineDevStatus->dwTotalSize == dwNeededSize" + ); + + // Reallocate and try again with enough memory for TAPI and SP + // to fill all the fields in + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) + AllocFromTestHeap((size_t) lpLineDevStatus->dwNeededSize); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = + lpLineDevStatus->dwNeededSize; + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Free test resources allocated from the test heap during the tests + FreeTestHeap(); + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + + if ( ! DoLineGetLineDevStatus(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_INVALLINEHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + + if ( ! DoLineGetLineDevStatus(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetLineDevStatus: 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 lineGetLineDevStatus <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlgnc.c b/private/tapi/qa/trapper/itest/line/itlgnc.c new file mode 100644 index 000000000..bdc2b65bb --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgnc.c @@ -0,0 +1,954 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgnc.c + +Abstract: + + This module contains the test functions for lineGetNewCalls + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define DWNUMCALLS 1 +#define NUMTOTALSIZES 5 +#define ALL_DWSELECT (LINECALLSELECT_LINE | \ + LINECALLSELECT_ADDRESS) + + + +// lineGetNewCalls +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hLines +// 3) Invalid dwAddressID (-1, dwNumAddresses) +// 4) Test invalid bit flags for dwSelect +// 5) Test valid bit flags for dwSelect +// 6) Invalid lpCallList pointers +// 7) Test combinations of allocation sizes and dwTotalSizes for +// lpCallList (some valid, some invalid -- See test case below +// for details) +// +// * = Stand-alone test + +BOOL TestLineGetNewCalls(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + LPLINECALLLIST lpCallList; + INT n; + BOOL fResult; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwFixedSize = sizeof(LINECALLLIST); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + DWORD dwZeroCallSize; + DWORD dwOneCallSize; + + InitTestNumber(); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + + + // Allocate more than enough to store a call handle + dwZeroCallSize = dwFixedSize; + dwOneCallSize = dwFixedSize + sizeof(HCALL); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwOneCallSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwOneCallSize; + lpCallList = lpTapiLineTestInfo->lpCallList; + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetNewCalls <<<<<<<<" + ); + + // Test that lineGetNewCalls returns LINEERR_UNINITIALIZED when + // there are no lines are initialized. + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineGetNewCalls(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + // Setup and make a call + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // try valid case of having a monitor acquire a handle to existing call + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid hLines + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLines", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetNewCalls( + lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid dwAddressID (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (-1)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Try dwAddressID == -1 + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = 0xFFFFFFFF; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid dwAddressID (dwNumAddresses) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (dwNumAddresses)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Try dwAddressID == dwNumAddresses + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpCallList pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallList pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Try invalid lpCallList pointers + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) gdwInvalidPointers[n]; + if (! DoLineGetNewCalls( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallList = lpCallList; + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpCallList = lpCallList; + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetNewCalls(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwOneCallSize; + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpCallList = lpCallList; + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGetNewCalls, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + LINEERR_INVALCALLSELECT, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DWSELECT, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpCallList = lpCallList; + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineGetNewCalls, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + FIELDTYPE_MUTEX, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_DWSELECT, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwOneCallSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwOneCallSize; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify only room for one call", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // try valid case of having a monitor acquire a handle to existing call + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx, dwNeededSize = %lx, dwUsedSize = %lx", + lpTapiLineTestInfo->lpCallList->dwTotalSize, + lpTapiLineTestInfo->lpCallList->dwNeededSize, + lpTapiLineTestInfo->lpCallList->dwUsedSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "hCall2 = %lx", + (LPBYTE) lpTapiLineTestInfo->lpCallList + + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + if(lpTapiLineTestInfo->lpCallList->dwNeededSize == + lpTapiLineTestInfo->lpCallList->dwTotalSize) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDEALLOCATECALL | LCLOSE + )) + { + TLINE_FAIL(); + } + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwZeroCallSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwZeroCallSize; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify only room for zero call", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Open the same line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // try valid case of having a monitor acquire a handle to existing call + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx, dwNeededSize = %lx, dwUsedSize = %lx", + lpTapiLineTestInfo->lpCallList->dwTotalSize, + lpTapiLineTestInfo->lpCallList->dwNeededSize, + lpTapiLineTestInfo->lpCallList->dwUsedSize); + + + // Drop the call, deallocate the monitor and owner, and close both + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + if(! DoLineDeallocateCall (lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Close the owner + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Free the memory taken from the heap + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetNewCalls: 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 lineGetNewCalls <<<<<<<<" + ); + + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/line/itlgnr.c b/private/tapi/qa/trapper/itest/line/itlgnr.c new file mode 100644 index 000000000..9724c9bc9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgnr.c @@ -0,0 +1,434 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgnr.c + +Abstract: + + This module contains the test functions for lineGetNumRings + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define NUMNUMRINGS 11 + + +// lineGetNumRings +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines +// 3) Invalid dwAddressID (-1, dwNumAddresses) +// 4) Invalid lpdwNumRings +// 5) Test several valid lineSetNumRings/lineGetNumRings +// +// * = Stand-alone test case +// + +BOOL TestLineGetNumRings(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + DWORD dwNumRings[NUMNUMRINGS] = { + 0, + 1, + 10, + 100, + 1000, + 10000, + 0x7FFF, + 0x8000, + 0x8001, + 0xFFFFFFFE, + 0xFFFFFFFF + }; + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + CHAR szTestFunc[] = "lineGetNumRings"; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + strcpy(lpTapiLineTestInfo->szTestFunc, "lineGetNumRings"); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetNumRings <<<<<<<<" + ); + + // Test uninitialized state + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineGetNumRings(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + // Test some invalid hLines + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLines", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetNumRings( + lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpdwNumRings pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwNumRings pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwNumRings = (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineGetNumRings(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpdwNumRings = &lpTapiLineTestInfo->dwNumRings; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid dwAddressID (dwNumAddresses) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (dwNumAddresses)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineGetNumRings(lpTapiLineTestInfo, LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid dwAddressID (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (-1)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = DWMINUSONE; + if (! DoLineGetNumRings(lpTapiLineTestInfo, LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test SetNumRings/GetNumRings combinations to verify that it's + // working properly + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid Set/GetNumRings combinations", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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 | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwNumRings_Orig = *lpTapiLineTestInfo->lpdwNumRings; + for (n = 0; n < NUMNUMRINGS; n++) + { + *lpTapiLineTestInfo->lpdwNumRings = dwNumRings[n]; + if (! DoLineSetNumRings(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetNumRings(lpTapiLineTestInfo, TAPISUCCESS) || + *lpTapiLineTestInfo->lpdwNumRings != dwNumRings[n]) + { + TLINE_FAIL(); + } + + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + 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 | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwNumRings_Orig = *lpTapiLineTestInfo->lpdwNumRings; + for (n = 0; n < NUMNUMRINGS; n++) + { + *lpTapiLineTestInfo->lpdwNumRings = dwNumRings[n]; + if (! DoLineSetNumRings(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwNumRings = 0; + lpTapiLineTestInfo->lpdwNumRings = &lpTapiLineTestInfo->dwNumRings; + if (! DoLineGetNumRings(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(*lpTapiLineTestInfo->lpdwNumRings == dwNumRings[n]) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetNumRings: 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 lineGetNumRings <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlgpl.c b/private/tapi/qa/trapper/itest/line/itlgpl.c new file mode 100644 index 000000000..eb0f0578f --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgpl.c @@ -0,0 +1,168 @@ +G/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgpl.c + +Abstract: + + This module contains the test functions for lineGetProviderList + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +// lineGetProviderList +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// 1) Valid test case +// + +BOOL TestLineGetProviderList(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + DWORD dwProviderListSize = sizeof(LINEPROVIDERLIST); + INT n; + BOOL fResult; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetProviderList <<<<<<<<" + ); + + // Try a valid test case under initialized conditions + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state under initialized conditions", 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; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Allocating and testing fixed size for LPLINEPROVIDERLIST"); + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) + AllocFromTestHeap(dwProviderListSize); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = dwProviderListSize; + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check the needed size versus the used size. + // If the needed size is greater than the used size, reallocate enough + // to store the entire provider list and call lineGetProviderList again. + if (lpTapiLineTestInfo->lpProviderList->dwNeededSize > + lpTapiLineTestInfo->lpProviderList->dwUsedSize) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Reallocating and testing based on dwNeededSize"); + + dwProviderListSize = lpTapiLineTestInfo->lpProviderList->dwNeededSize; + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) + AllocFromTestHeap(dwProviderListSize); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = dwProviderListSize; + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + +// TODO: Check the provider list with what's currently in the registry. +// Display the list and describe any descrepencies. +// Note: The checking can only be guaranteed to be accurate when +// this is the only TAPI thread/app running or if this operation +// is atomic. + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Free the memory taken from the heap + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetProviderList: 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 lineGetProviderList <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/line/itlgsm.c b/private/tapi/qa/trapper/itest/line/itlgsm.c new file mode 100644 index 000000000..8570968f2 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlgsm.c @@ -0,0 +1,505 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgsm.c + +Abstract: + + This module contains the test functions for lineGetStatusMessages + +Author: + + Oliver Wallace (OliverW) 10-Sep-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define ALL_LINEDEVSTATES (LINEDEVSTATE_OTHER | \ + LINEDEVSTATE_RINGING | \ + LINEDEVSTATE_CONNECTED | \ + LINEDEVSTATE_DISCONNECTED | \ + LINEDEVSTATE_MSGWAITON | \ + LINEDEVSTATE_INSERVICE | \ + LINEDEVSTATE_OUTOFSERVICE | \ + LINEDEVSTATE_MAINTENANCE | \ + LINEDEVSTATE_OPEN | \ + LINEDEVSTATE_CLOSE | \ + LINEDEVSTATE_NUMCALLS | \ + LINEDEVSTATE_NUMCOMPLETIONS | \ + LINEDEVSTATE_TERMINALS | \ + LINEDEVSTATE_ROAMMODE | \ + LINEDEVSTATE_BATTERY | \ + LINEDEVSTATE_SIGNAL | \ + LINEDEVSTATE_DEVSPECIFIC | \ + LINEDEVSTATE_REINIT | \ + LINEDEVSTATE_LOCK | \ + LINEDEVSTATE_CAPSCHANGE | \ + LINEDEVSTATE_CONFIGCHANGE | \ + LINEDEVSTATE_TRANSLATECHANGE | \ + LINEDEVSTATE_COMPLCANCEL | \ + LINEDEVSTATE_REMOVED) + +#define ALL_ADDRESSSTATES (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE) + + +// lineGetStatusMessages +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hLines +// 3) Test invalid dwLineStates pointers +// 4) Test invalid dwAddressStates pointers +// 5) Solicit SPI errors (NOMEM, OPERATIONFAILED, RESOURCEUNAVAIL, +// OPERATIONUNAVAIL) (not implemented here) +// 6) Perform a couple of lineSetStatusMessages/lineGetStatusMessages +// combinations (eventually, more combinations should be tested) +// +// * = Stand-alone test + +BOOL TestLineGetStatusMessages(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + CHAR szTestFunc[] = "lineGetStatusMessages"; + DWORD dwLineStates; + + InitTestNumber(); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + strcpy(lpTapiLineTestInfo->szTestFunc, szTestFunc); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetStatusMessages <<<<<<<<" + ); + + + // Call lineGetStatusMessages before any lines are initialized + // Note: This test must be run in a stand-alone mode + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineGetStatusMessages( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwLineStates = 0x00000000; + lpTapiLineTestInfo->dwAddressStates = 0x00000000; + + + // Test invalid line handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLines", dwTestCase + 1 + ); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Store the valid line handle and try some invalid ones + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineGetStatusMessages( + lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE + )) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore valid line handle + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpdwLineStates pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwLineStates pointers", dwTestCase + 1 + ); + + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwLineStates = 0x00000000; + lpTapiLineTestInfo->dwAddressStates = 0x00000000; + lpTapiLineTestInfo->lpdwAddressStates = + &lpTapiLineTestInfo->dwAddressStates; + + // XYD add 2/27/96 + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwLineStates = (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineGetStatusMessages( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpdwLineStates pointer + lpTapiLineTestInfo->lpdwLineStates = &lpTapiLineTestInfo->dwLineStates; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwLineStates == lpdwAddressStates", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwLineStates = 0x00000000; + lpTapiLineTestInfo->dwAddressStates = 0x00000000; + lpTapiLineTestInfo->lpdwAddressStates = + &lpTapiLineTestInfo->dwAddressStates; + + // XYD add 2/27/96 + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpdwLineStates = (LPDWORD) lpTapiLineTestInfo->lpdwAddressStates; + if (! DoLineGetStatusMessages( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpdwLineStates pointer + lpTapiLineTestInfo->lpdwLineStates = &lpTapiLineTestInfo->dwLineStates; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpdwAddressStates pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwAddressStates pointers", dwTestCase + 1 + ); + + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwLineStates = 0x00000000; + lpTapiLineTestInfo->dwAddressStates = 0x00000000; + lpTapiLineTestInfo->lpdwLineStates = + &lpTapiLineTestInfo->dwLineStates; + + // XYD add 2/27/96 + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwAddressStates = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineGetStatusMessages( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER + )) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpdwAddressStates pointer + lpTapiLineTestInfo->lpdwAddressStates = + &lpTapiLineTestInfo->dwAddressStates; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Perform a sanity check by performing a couple of Get/SetStatusMessages + // calls. + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid Get/SetStatusMessages combinations and verify\r\n" \ + ">> the returned data", dwTestCase + 1 + ); + + 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; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DISCONNECTED | + LINEDEVSTATE_CONNECTED; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_NUMCALLS; + + // XYD add 2/27/96 + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Store the values used + lpTapiLineTestInfo->dwLineStates_Orig = lpTapiLineTestInfo->dwLineStates; + lpTapiLineTestInfo->dwAddressStates_Orig = + lpTapiLineTestInfo->dwAddressStates; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // XYD, add REINIT to dwLineStates + if(! (lpTapiLineTestInfo->dwLineStates_Orig & LINEDEVSTATE_REINIT)) + dwLineStates = lpTapiLineTestInfo->dwLineStates_Orig | LINEDEVSTATE_REINIT; + + // Verify the results by calling lineGetStatusMessages + if (! DoLineGetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS) || + *lpTapiLineTestInfo->lpdwAddressStates != + lpTapiLineTestInfo->dwAddressStates_Orig || + *lpTapiLineTestInfo->lpdwLineStates != + // lpTapiLineTestInfo->dwLineStates_Orig + dwLineStates + ) + { + TLINE_FAIL(); + } + + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "Set: dwAddressState = %lx, dwLineStates = %lx", + lpTapiLineTestInfo->dwAddressStates_Orig, + lpTapiLineTestInfo->dwLineStates_Orig); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "Get: dwAddressState = %lx, dwLineStates = %lx", + *lpTapiLineTestInfo->lpdwAddressStates, + *lpTapiLineTestInfo->lpdwLineStates); + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid Get/SetStatusMessages combinations and verify\r\n" \ + ">> the returned data", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwLineStates = ALL_LINEDEVSTATES; + lpTapiLineTestInfo->dwAddressStates = ALL_ADDRESSSTATES; + // Store the values used + lpTapiLineTestInfo->dwLineStates_Orig = lpTapiLineTestInfo->dwLineStates; + lpTapiLineTestInfo->dwAddressStates_Orig = + lpTapiLineTestInfo->dwAddressStates; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Verify the results by calling lineGetStatusMessages + if (! DoLineGetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS) || + *lpTapiLineTestInfo->lpdwAddressStates != + lpTapiLineTestInfo->dwAddressStates_Orig || + *lpTapiLineTestInfo->lpdwLineStates != + lpTapiLineTestInfo->dwLineStates_Orig + ) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetStatusMessages: 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 lineGetStatusMessages <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itli.c b/private/tapi/qa/trapper/itest/line/itli.c new file mode 100644 index 000000000..14b7a6d67 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itli.c @@ -0,0 +1,561 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itli.c + +Abstract: + + This module contains the test functions for lineInitialize + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "tcore.h" +#include "doline.h" +#include "tline.h" + + +#define ESPDEVSPECIFIC_KEY ((DWORD) 'DPSE') + +#define ESP_DEVSPEC_MSG 1 + +// lineInitialize +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1) Invalid lphLineApp pointers +// 2) Invalid lpdwNumDevs pointers +// 3) Invalid lpfnCallback pointers +// 3) Invalid hInstance handles +// 4) Null lpszAppName +// 5) Invalid lpszAppName strings +// 6) Verify hLineApp can be used +// 7) Verify 0..dwNumDevs can be used +// 8) Verify valid params: lphLineApp, hInstance, lpfnCallback, lpwszAppName, lpdwNumDevs +// + +BOOL +TestLineInitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; +/* +#ifdef WUNICODE + WCHAR wszValidAppName[] = L"ValidApp"; + LPWSTR lpwszAppName = wszValidAppName; +#else +*/ + CHAR szValidAppName[] = "ValidApp"; + LPSTR lpszAppName = szValidAppName; +//#endif + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams; + TAPIRESULT lastTapiResult; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineInitialize <<<<<<<<" + ); + + // test a valid case +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state -- lpwszAppName not null", dwTestCase + 1); +#else +*/ + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state -- lpszAppName not null", dwTestCase + 1); +//#endif + if (! DoLineInitialize(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shut it down + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check invalid lphLineApp pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphLineApp pointers", dwTestCase + 1); + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphLineApp = + (LPHLINEAPP) gdwInvalidPointers[n]; + if (! DoLineInitialize( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lphLineApp pointer + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lphLineApp == lpdwNumDevs", dwTestCase + 1); + lpTapiLineTestInfo->lphLineApp = (LPHLINEAPP)lpTapiLineTestInfo->lpdwNumDevs; + if (! DoLineInitialize( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lphLineApp pointer + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + // Check invalid lpfnCallback pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpfnCallback pointers", dwTestCase + 1); + lpTapiLineTestInfo->lpfnCallback_Orig = lpTapiLineTestInfo->lpfnCallback; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpfnCallback = + (LINECALLBACK) gdwInvalidPointers[n]; + if (! DoLineInitialize( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpfnCallback pointer + lpTapiLineTestInfo->lpfnCallback = lpTapiLineTestInfo->lpfnCallback_Orig; + + // Test an invalid lpdwNumDevs pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwNumDevs pointers", dwTestCase + 1); + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwNumDevs = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineInitialize( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpdwNumDevs pointer + lpTapiLineTestInfo->lpdwNumDevs = &(lpTapiLineTestInfo->dwNumDevs); + + // test invalid instance handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hInstance values", dwTestCase + 1); + lpTapiLineTestInfo->hInstance_Orig = lpTapiLineTestInfo->hInstance; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + lpTapiLineTestInfo->hInstance = (HINSTANCE) gdwInvalidHandles[n]; + if(n == 0) // XYD, it is allowed hInstance = NULL + { + if (! DoLineInitialize(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineInitialize(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore original hInstance + lpTapiLineTestInfo->hInstance = lpTapiLineTestInfo->hInstance_Orig; + +// TODO: Pass it bogus strings (e.g. a BINARY) +// // test an invalid app name +// lpTapiLineTestInfo->lpszAppName = INVLD_APPNAME; +// if (! DoLineInitialize(lpTapiLineTestInfo, LINEERR_INVALAPPNAME)) +// { +// TLINE_FAIL(); +// } +// lpTapiLineTestInfo->lpszAppName = lpszAppName; + + // test a null app name (should work) +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state -- lpwszAppName null", dwTestCase + 1); + lpTapiLineTestInfo->lpwszAppName = NULL; +#else +*/ + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state -- lpszAppName null", dwTestCase + 1); + lpTapiLineTestInfo->lpszAppName = NULL; +//#endif + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + if (! DoLineInitialize(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpszAppName pointer +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppName = lpwszAppName; +#else +*/ + lpTapiLineTestInfo->lpszAppName = lpszAppName; +//#endif + + // Verify that the initialized line app instance can be used + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verifying hLineApp can be used", dwTestCase + 1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Initialize another line and verify that 0..dwNumDevs can be used + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verifying 0..dwNumDevs can be used", dwTestCase + 1); + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp2); + if (! DoLineInitialize(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + for (n = *lpTapiLineTestInfo->lpdwNumDevs - 1; n >= 0; n--) + { + lpTapiLineTestInfo->dwDeviceID = n; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown the hLineApp + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown down the other initialized hLineApp + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test invalid app name pointers +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppName pointers", dwTestCase + 1); +#else +*/ + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppName pointers", dwTestCase + 1); +//#endif + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppName = + (LPWSTR) gdwInvalidPointers[n]; +#else +*/ + lpTapiLineTestInfo->lpszAppName = + (LPSTR) gdwInvalidPointers[n]; +//#endif + + // Okay. It's expensive to check every time for the NULL value + // in the array of pointer values to test, but efficiency isn't the + // point of these tests. Doing it this way allows the NULL pointer + // value to be in the array without having to worry about where it + // is in the array of bad pointers. +/* +#ifdef WUNICODE + if (lpTapiLineTestInfo->lpwszAppName && ! DoLineInitialize( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } +#else +*/ + if (lpTapiLineTestInfo->lpszAppName && ! DoLineInitialize( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } +//#endif + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpszAppName pointer +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppName = lpwszAppName; +#else +*/ + lpTapiLineTestInfo->lpszAppName = lpszAppName; +//#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Force REINIT & verify lineInit Fail", dwTestCase + 1); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + if(! DoLineInitialize(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_LINEDEVSTATE; + info.u.EspMsg.dwParam1 = LINEDEVSTATE_REINIT; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_REINIT; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine1, + (DWORD) lpCallbackParams, + LINEDEVSTATE_REINIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "TestLineInitailize: Did not receive REINIT message."); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + + if(! DoLineInitialize(lpTapiLineTestInfo, LINEERR_REINIT)) + { + TLINE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +/***********************(javedr - start)**********************************/ +// Most of these cases are covered above by isolating each parameter. +// This case just tests the lineInitialize parameteres in one shot. +// Check valid lphLineApp pointers +// Test valid hInstance handles +// Check valid lpfnCallback pointers - N/A (see below) +// Test valid app name - lpszAppName +// Test valid lpdwNumDevs + +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params test: lphLineApp, hInstance, lpfnCallback, lpwszAppName, lpdwNumDevs", dwTestCase + 1); +#else +*/ + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params test: lphLineApp, hInstance, lpfnCallback, lpszAppName, lpdwNumDevs", dwTestCase + 1); +//#endif + // Initailize args to isolate test case + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + // Set all args to valid values + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + lpTapiLineTestInfo->hInstance = NULL; //default value is NULL + // No need to do this since TapiLineTestInit() in tcore.c is already doing this. + // lpTapiLineTestInfo->lpfnCallback = TapiCallback; +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppName = lpwszAppName; +#else +*/ + lpTapiLineTestInfo->lpszAppName = lpszAppName; +//#endif + lpTapiLineTestInfo->lpdwNumDevs = &(lpTapiLineTestInfo->dwNumDevs); + if (! DoLineInitialize(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // // Shutdown to isolate the test case + if (!DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +/*************************(javedr - end)********************************/ + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineInitialize: 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 lineInitialize <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/line/itlmc.c b/private/tapi/qa/trapper/itest/line/itlmc.c new file mode 100644 index 000000000..9813f7748 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlmc.c @@ -0,0 +1,1198 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmc.c + +Abstract: + + This module contains the test functions for lineMakeCall + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "tline.h" + +#define DESTADDRESSSIZE 20 +#define NUMTOTALSIZES 5 + + + +// lineMakeCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines (test array of gdwInvalidHandles in itest.h) +// 3) Invalid lphCall pointers (test array of gdwInvalidPointers +// in itest.h) +// 4) Invalid lpCallParams pointers (test array of gdwInvalidPointers +// in itest.h) +// 5) Test combinations of allocation sizes and dwTotalSize values +// (see test case in this file for list) +// 6) Verify hCall is invalid if lineMakeCall fails (try lineDrop) +// 7) Verify LINE_CALLSTATE messages are sent to monitors when a call +// is made. +// +// * = Stand-alone test case +// + +BOOL TestLineMakeCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + + BOOL fResult; + INT CallParamsSize = sizeof(LINECALLPARAMS); + INT nAllocIndex; + INT nTotalSizeIndex; + INT nCallParamsIndex; + INT nAddressIndex; + INT n; + DWORD dwAllocSize, dwTotalSize; + DWORD adwTotalSizes[] = { + 0, + 0x4, + 0x8, + 0xC, + 0x10, + CallParamsSize - 1, + CallParamsSize, + CallParamsSize + 1, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + LPLINECALLPARAMS alpCallParams[] = { + NULL + // alpTapiLineTestInfo->lpCallParams + }; +#ifdef WUNICODE + LPWSTR alpwszAddresses[] = { + NULL, + L"55555" + }; +#else + LPSTR alpszAddresses[] = { + NULL, + "55555" + }; +#endif + + INT nNumTotalSizes = sizeof(adwTotalSizes) / sizeof(adwTotalSizes[0]); +#ifdef WUNICODE + INT nNumAddresses = sizeof(alpwszAddresses) / sizeof(alpwszAddresses[0]); +#else + INT nNumAddresses = sizeof(alpszAddresses) / sizeof(alpszAddresses[0]); +#endif + INT nNumCallParams = sizeof(alpCallParams) / sizeof(alpCallParams[0]); + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwFixedSize = sizeof(LINECALLPARAMS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineMakeCall <<<<<<<<" + ); + + // Test uninitialized case. + // Note: It is assumed that the parameter fStandAlone correctly + // indicates if there are any other TAPI apps or threads + // currently running. + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Initialize a line and open it + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with owner privilege +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Try some invalid hLines + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line handles", dwTestCase + 1 + ); + lpTapiLineTestInfo->hLine2 = *(lpTapiLineTestInfo->lphLine); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the original valid line handle + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine2; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Try some invalid call handle pointers + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid call handle pointers", dwTestCase + 1 + ); + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphCall = (LPHCALL) gdwInvalidPointers[n]; + + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Perform a valid test + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCountryCode, -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwCountryCode = 0xffffffff; + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwCountryCode = 0; + + // Drop the call, deallocate it, and start over. + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + + + // Test invalid pointer values for lpCallParams + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallParams pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + // Skip the null case (because it's valid) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + if ((LPLINECALLPARAMS) gdwInvalidPointers[n] != NULL) + { + lpTapiLineTestInfo->lpCallParams = + (LPLINECALLPARAMS) gdwInvalidPointers[n]; + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lpCallParams + lpTapiLineTestInfo->lpCallParams = &lpTapiLineTestInfo->CallParams; + + // Verify the call handle is invalid when lineMakeCall fails + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verifying call handle is invalid when lineMakeCall fails", + dwTestCase +1 + ); + + lpTapiLineTestInfo->lpCallStatus = (LPLINECALLSTATUS) AllocFromTestHeap( + sizeof(LINECALLSTATUS)); + lpTapiLineTestInfo->lpCallStatus->dwTotalSize = sizeof(LINECALLSTATUS); + + if (! DoLineGetCallStatus( + lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineMakeCall(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = dwFixedSize; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Test Case 7: combinations of NULL and valid lpCallParams & lpszDestAddress + // Note: All test cases are valid + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Testing combinations of lpCallParams and destination addresses", + dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + for (nCallParamsIndex = 0; + nCallParamsIndex < nNumCallParams; + nCallParamsIndex++) + { + for (nAddressIndex = 0; nAddressIndex < nNumAddresses; nAddressIndex++) + { + lpTapiLineTestInfo->lpCallParams = alpCallParams[nCallParamsIndex]; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = alpwszAddresses[nAddressIndex]; +#else + lpTapiLineTestInfo->lpszDestAddress = alpszAddresses[nAddressIndex]; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Go ahead and drop the call to free the line + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Deallocate the call handle + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwOrigAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = alpwszAddresses[nAddressIndex]; +#else + lpTapiLineTestInfo->lpszDestAddress = alpszAddresses[nAddressIndex]; +#endif + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = alpwszAddresses[nAddressIndex]; +#else + lpTapiLineTestInfo->lpszDestAddress = alpszAddresses[nAddressIndex]; +#endif + + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = alpwszAddresses[nAddressIndex]; +#else + lpTapiLineTestInfo->lpszDestAddress = alpszAddresses[nAddressIndex]; +#endif + + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = BIGBUFSIZE; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = alpwszAddresses[nAddressIndex]; +#else + lpTapiLineTestInfo->lpszDestAddress = alpszAddresses[nAddressIndex]; +#endif + + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0xffffffff, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = alpwszAddresses[nAddressIndex]; +#else + lpTapiLineTestInfo->lpszDestAddress = alpszAddresses[nAddressIndex]; +#endif + + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + 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 + )) + { + 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(); + } + + if ( ! DoLineMakeCall(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 + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_CALLUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineMakeCall(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, + "@@ lineMakeCall: 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 lineMakeCall <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlmc1.c b/private/tapi/qa/trapper/itest/line/itlmc1.c new file mode 100644 index 000000000..735f1fe74 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlmc1.c @@ -0,0 +1,8931 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmc1.c + +Abstract: + + This module contains the test functions for lineMakeCall Addtion + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "tline.h" + +#define NUMTOTALSIZES 5 + + +// lineMakeCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// + +BOOL TestLineMakeCall1(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams = NULL; + DWORD dwAllocSize, dwTotalSize; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n****************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineMakeCall"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwOrigAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDisplayableAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCalledPartyAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwComment Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwUserUserInfo Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwHighLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwLowLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDevSpecificAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwTargetAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwSendingFlowspec Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwReceivingFlowspec Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceClass Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceConfig Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallData Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallingPartyID Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineMakeCall1: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineMakeCall <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlmc2.c b/private/tapi/qa/trapper/itest/line/itlmc2.c new file mode 100644 index 000000000..4185bb33c --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlmc2.c @@ -0,0 +1,8932 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmc2.c + +Abstract: + + This module contains the test functions for lineMakeCall Addtion + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "tline.h" + +#define NUMTOTALSIZES 5 + + +// lineMakeCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// + +BOOL TestLineMakeCall2(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams = NULL; + DWORD dwAllocSize, dwTotalSize; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n****************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineMakeCall"); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwOrigAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDisplayableAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCalledPartyAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwComment Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwUserUserInfo Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwHighLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwLowLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDevSpecificAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwTargetAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwSendingFlowspec Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwReceivingFlowspec Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceClass Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceConfig Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallData Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallingPartyID Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwAllocSize + 16; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = 0xffffffff; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineMakeCall1: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineMakeCall <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlnapiv.c b/private/tapi/qa/trapper/itest/line/itlnapiv.c new file mode 100644 index 000000000..f73d6ffe7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlnapiv.c @@ -0,0 +1,625 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlnapiv.c + +Abstract: + + This module contains the test functions for lineNegotiateAPIVersion + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + + +// lineNegotiateAPIVersion +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Valid (low == too low, high = valid high) +// 3) Valid (low == valid low, high = too high) +// 4) Valid (low == too low, high = too high) +// 5) Invalid (low == too high, high = too low) +// 6) Invalid (low == too high, high = way too high) +// 7) Invalid (low == too low, high = way too low) +// 8) Invalid hLineApps +// 9) Invalid lpExtensionID pointers +// 10) Invalid lpdwAPIVersion pointers +// 11) Invalid dwDeviceID (-1, dwNumDevs) +// +// * = Stand-alone test case +// + +BOOL TestLineNegotiateAPIVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + CHAR szTestFunc[] = "lineNegotiateAPIVersion"; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + strcpy(lpTapiLineTestInfo->szTestFunc, szTestFunc); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineNegotiateAPIVersion <<<<<<<<" + ); + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized state", dwTestCase + 1); + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + } + + 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; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state", dwTestCase + 1); + + // Initialize a line app instance + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test a valid negotiation + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid version range that overlaps with valid version", dwTestCase + 1); + + // Initialize another hLineApp + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test a version range that overlaps with existing versions of TAPI + lpTapiLineTestInfo->dwAPILowVersion = TOOLOW_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid range that overlaps on the high end", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test a range that is exceedingly high (but still overlaps + // with a compatible version + lpTapiLineTestInfo->dwAPIHighVersion = TOOHIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid API version range", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + // Initialize a line app instance + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test an incompatible version range (for all versions of the API) + lpTapiLineTestInfo->dwAPILowVersion = TOOHIGH_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = WAYTOOHIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: high version too low and low version too high", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Flip high and low and see if the result is an incompatible version + // and make sure both values are incompatible versions + lpTapiLineTestInfo->dwAPILowVersion = TOOHIGH_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = TOOLOW_APIVERSION; + if (! DoLineNegotiateAPIVersion( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // TODO: Test for specific versions + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwDeviceID (-2)", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check bad device ID (-2) 0xFFFFFFFF is valid in TAPI 2.0 + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = 0xFFFFFFFE; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwDeviceID (dwNumDevs)", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check bad device ID (dwNumDevs) + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *lpTapiLineTestInfo->lpdwNumDevs; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLineApp handles", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check invalid line app handles + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLineApp = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineNegotiateAPIVersion( + lpTapiLineTestInfo, + LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the valid line app handle + *lpTapiLineTestInfo->lphLineApp = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwAPIVersion pointers", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check invalid lpdwAPIVersion pointers + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwAPIVersion = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineNegotiateAPIVersion( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the lpdwAPIVersion pointer + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwAPIVersion == lpExtensionID", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpdwAPIVersion = (LPDWORD) lpTapiLineTestInfo->lpExtID; + if (! DoLineNegotiateAPIVersion( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore the lpdwAPIVersion pointer + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionID pointers", dwTestCase + 1); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check invalid lpExtensionID pointers + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtID = + (LPLINEEXTENSIONID) gdwInvalidPointers[n]; + if (! DoLineNegotiateAPIVersion( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Restore the extension ID pointer + lpTapiLineTestInfo->lpExtID = &lpTapiLineTestInfo->ExtID; + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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(); + } + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_NODEVICE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + if ( ! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineNegotiateAPIVersion: 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 lineNegotiateAPIVersion <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itlo.c b/private/tapi/qa/trapper/itest/line/itlo.c new file mode 100644 index 000000000..a35756560 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlo.c @@ -0,0 +1,1129 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlo.c + +Abstract: + + This module contains the test functions for lineOpen + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + +#define ESPDEVSPECIFIC_KEY ((DWORD) 'DPSE') + +#define ESP_DEVSPEC_MSG 1 + +#define NUMTOTALSIZES 6 + + +// lineOpen +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLineApps +// 3) Invalid dwDeviceID (-1, dwNumDevs) +// 4) Invalid lphLine pointers +// 5) Invalid API version (too low, too high) +// 6) Test Invalid bit flag combinations for dwPrivileges +// 7) Test Valid bit flag combinations for dwPrivileges +// 8) Verify hLine is invalid if lineOpen fails (try closing hLine) +// 9) Invalid lpCallParams pointers (when dwDeviceID == LINEMAPPER) +// 10) Test different allocation sizes and dwTotalSize values for +// lpCallParams (when dwDeviceID == LINEMAPPER) +// 11) Invalid extension version (not tested here yet...will be tested +// in SP specific tests) +// 12) Verify dwMediaModes is ignored if line not opened as owner +// 13) Test invalid bit flag combinations for dwMediaModes +// where SP returns 0 for the extension ID +// 14) Test invalid bit flag combinations for dwMediaModes +// where SP returns a valid extension ID (when privilege +// is owner) +// 15) Test valid bit flag combinations for dwMediaModes +// when privilege is monitor +// 16) Test valid bit flag combinations for dwMediaModes +// when privilege is owner +// + +BOOL TestLineOpen(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fStepPassed; + ESPDEVSPECIFICINFO info; + TAPIRESULT lastTapiResult; + DWORD lResult; + + BOOL fTestPassed = TRUE; + LINECALLPARAMS CallParams; + LPCALLBACKPARAMS lpCallbackParams; + size_t CallParamsSize = sizeof(LINECALLPARAMS); + DWORD dwAllMediaModes; + DWORD dwAllPrivileges; + DWORD dwResult; + DWORD dwFixedSize = sizeof(LINECALLPARAMS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + 0x4, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + strcpy(lpTapiLineTestInfo->szTestFunc, "lineOpen"); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap(sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); +// lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineOpen <<<<<<<<" + ); + + // Test for LINEERR_UNINITIALIZED if this is the only TAPI app running + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + // Prepare a line for testing + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Assign the unions of all the valid bit flags for the media modes + // and the privileges. These unions will be used for testing valid + // and invalid bit flag combinations. + // + // TODO: All media modes should be tested, but for this set of + // general tests it might be better to only test valid media + // modes as those that are supported by the device. + // The remaining media modes could be tested elsewhere, + // such as in the set of SP/device specific test dll. + dwAllMediaModes = (LINEMEDIAMODE_UNKNOWN | + LINEMEDIAMODE_INTERACTIVEVOICE | + LINEMEDIAMODE_AUTOMATEDVOICE | + LINEMEDIAMODE_DATAMODEM | + LINEMEDIAMODE_G3FAX | + LINEMEDIAMODE_TDD | + LINEMEDIAMODE_G4FAX | + LINEMEDIAMODE_DIGITALDATA | + LINEMEDIAMODE_TELETEX | + LINEMEDIAMODE_VIDEOTEX | + LINEMEDIAMODE_TELEX | + LINEMEDIAMODE_MIXED | + LINEMEDIAMODE_ADSI); + if (*(lpTapiLineTestInfo->lpdwAPIVersion) >= TAPI_VERSION1_4) + { + // version 1.4 added voice view media mode + dwAllMediaModes |= LINEMEDIAMODE_VOICEVIEW; + } + + dwAllPrivileges = (LINECALLPRIVILEGE_NONE | + LINECALLPRIVILEGE_MONITOR | + LINECALLPRIVILEGE_OWNER); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check some invalid lphLine pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphLine pointers", dwTestCase + 1); + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphLine = + (LPHLINE) gdwInvalidPointers[n]; + if (! DoLineOpen( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore lphLine pointer + lpTapiLineTestInfo->lphLine = &(lpTapiLineTestInfo->hLine1); + + // test invalid hLineApps + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLineApps", dwTestCase + 1); + lpTapiLineTestInfo->hLineApp_Orig = *(lpTapiLineTestInfo->lphLineApp); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore original hLineApp + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Check bad device ID (-2) (Don't test -1 because LINEMAPPER == -1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad dwDeviceID (-2)", dwTestCase + 1); + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = 0xFFFFFFFE; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Check bad device ID (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad dwDeviceID (dwNumDevs)", dwTestCase + 1); + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Check incompatible API version (too low) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lpdwAPIVersion = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Check incompatible API version (too high) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + lpTapiLineTestInfo->dwAPIVersion_Orig = + *(lpTapiLineTestInfo->lpdwAPIVersion); + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOHIGH_APIVERSION; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Check incompatible extension version +// dwExtVersion_Orig = *(TapiLineTestInfo->lpdwExtVersion); +// *(TapiLineTestInfo->lpdwExtVersion) = BAD_EXTVERSION; +// if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INCOMPATIBLEEXTVERSION)) +// { +// TLINE_FAIL(); +// } +// *(lpTapiLineTestInfo->lpdwExtVersion) = dwExtVersion_Orig; + + // Make sure dwMediaModes is ignored when LINECALLPRIVILEGE_MONITOR is set + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify dwMediaModes is ignored when LINECALLPRIVILEGE_MONITOR", dwTestCase + 1); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwMediaModes_Orig = lpTapiLineTestInfo->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges_Orig = lpTapiLineTestInfo->dwPrivileges; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineOpen, + (LPDWORD)&lpTapiLineTestInfo->dwMediaModes, + FIELDTYPE_UNION, + FIELDTYPE_UNION, + FIELDSIZE_24, + dwAllMediaModes, + ~dwBitVectorMasks[(int)FIELDSIZE_24], + 0x00000000, + 0x00000000, + TRUE )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwMediaModes = lpTapiLineTestInfo->dwMediaModes_Orig; + lpTapiLineTestInfo->dwPrivileges = lpTapiLineTestInfo->dwPrivileges_Orig; + + // Make sure dwMediaModes is ignored when LINECALLPRIVILEGE_NONE is set + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify dwMediaModes is ignored when LINECALLPRIVILEGE_NONE", dwTestCase + 1); + lpTapiLineTestInfo->dwMediaModes_Orig = lpTapiLineTestInfo->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges_Orig = lpTapiLineTestInfo->dwPrivileges; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; + if (! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineOpen, + (LPDWORD)&lpTapiLineTestInfo->dwMediaModes, + FIELDTYPE_UNION, + FIELDTYPE_UNION, + FIELDSIZE_24, + dwAllMediaModes, + ~dwBitVectorMasks[(int)FIELDSIZE_24], + 0x00000000, + 0x00000000, + TRUE )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwMediaModes = lpTapiLineTestInfo->dwMediaModes_Orig; + lpTapiLineTestInfo->dwPrivileges = lpTapiLineTestInfo->dwPrivileges_Orig; + + // Check for invalid media mode when LINECALLPRIVILEGE_OWNER is set + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid media modes when LINECALLPRIVILEGE_OWNER", dwTestCase + 1); + lpTapiLineTestInfo->dwPrivileges_Orig = lpTapiLineTestInfo->dwPrivileges; + lpTapiLineTestInfo->dwMediaModes_Orig = lpTapiLineTestInfo->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = 0x0; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INVALMEDIAMODE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore dwMediaModes and dwPrivileges + lpTapiLineTestInfo->dwMediaModes = lpTapiLineTestInfo->dwMediaModes_Orig; + lpTapiLineTestInfo->dwPrivileges = lpTapiLineTestInfo->dwPrivileges_Orig; + + // Check invalid privilege selection + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwPrivileges", dwTestCase + 1); + lpTapiLineTestInfo->dwPrivileges_Orig = lpTapiLineTestInfo->dwPrivileges; + if (! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineOpen, + (LPDWORD)&lpTapiLineTestInfo->dwPrivileges, + LINEERR_INVALPRIVSELECT, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + dwAllPrivileges, + ~dwBitVectorMasks[(int)FIELDSIZE_32], + 0x00000000, + LINECALLPRIVILEGE_OWNER | LINECALLPRIVILEGE_NONE, + TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwPrivileges = lpTapiLineTestInfo->dwPrivileges_Orig; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwPrivileges", dwTestCase + 1); + lpTapiLineTestInfo->dwPrivileges_Orig = lpTapiLineTestInfo->dwPrivileges; + if (! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineOpen, + (LPDWORD)&lpTapiLineTestInfo->dwPrivileges, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + dwAllPrivileges, + ~dwBitVectorMasks[(int)FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwPrivileges = lpTapiLineTestInfo->dwPrivileges_Orig; + + +// BUGBUG?? What generates a LINEMAPPERFAILED error? +#if 0 + // Test Case : Check invalid CallParams when LINEMAPPER set as the deviceID + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = LINEMAPPER; + lpTapiLineTestInfo->lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS); + lpTapiLineTestInfo->dwPrivileges_Orig = lpTapiLineTestInfo->dwPrivileges; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes_Orig = + lpTapiLineTestInfo->lpCallParams->dwMediaMode; + lpTapiLineTestInfo->lpCallParams->dwMediaMode = LINECALLPRIVILEGE_OWNER | + LINECALLPRIVILEGE_MONITOR | + LINECALLPRIVILEGE_NONE; + lpTapiLineTestInfo->lpCallParams->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_LINEMAPPERFAILED)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + lpTapiLineTestInfo->lpCallParams->dwMediaMode = + lpTapiLineTestInfo->dwMediaModes_Orig; + lpTapiLineTestInfo->dwPrivileges = lpTapiLineTestInfo->dwPrivileges_Orig; + + // Verify that the line cannot be used if lineOpen failed + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + +#endif + + // Try the set of invalid media modes + // TODO: Right now there is no hook to set the extension ID. + // Whether or not this value is 0 has an impact on + // how the media modes are tested. For now, only + // test invalid media modes if no extensionID bits are set. + lpTapiLineTestInfo->dwMediaModes_Orig = lpTapiLineTestInfo->dwMediaModes; + if (DoExtensionIDsMatch( + lpTapiLineTestInfo->lpExtID, + &lpTapiLineTestInfo->ExtIDZero)) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid media modes (including extensions)", dwTestCase + 1); + // if (! TestInvalidBitFlags( + dwResult = TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineOpen, + &lpTapiLineTestInfo->dwMediaModes, + LINEERR_INVALMEDIAMODE, + FIELDTYPE_UNION, + FIELDTYPE_UNION, + FIELDSIZE_24, + dwAllMediaModes, + 0x00000000, + 0x00000000, + 0x00000000, + TRUE); + if(!dwResult) + { + // XYD, it is hard to change TestInvalidBitFlags for special case + // So force it to be Success. when dwMediaMode >= 1000000 for ESP + // lineOpen return Success + if(IsESPLineDevice(lpTapiLineTestInfo) ) + { + fTestPassed = TRUE; + dwResult = TRUE; + } + } + if(!dwResult) + { + + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Test invalid lpCallParams pointers (only useful when using LINEMAPPER) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallParams when dwDeviceID == LINEMAPPER", dwTestCase + 1); + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID_Orig; + lpTapiLineTestInfo->dwDeviceID = LINEMAPPER; + lpTapiLineTestInfo->lpCallParams = &lpTapiLineTestInfo->CallParams; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallParams = + (LPLINECALLPARAMS) gdwInvalidPointers[n]; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpCallParams = &lpTapiLineTestInfo->CallParams; + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize & verify hLine can't be used", dwTestCase + 1); + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = LINEMAPPER; + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineOpen(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpCallParams->dwTotalSize = dwFixedSize; + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwExtVersion", dwTestCase + 1); + + lpTapiLineTestInfo->dwExtVersion = BAD_EXTVERSION; + + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_INCOMPATIBLEEXTVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwExtVersion = 0x00000000; + + + // Shutdown the lineApp instance + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, open as monitor", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Stress test, call continue in a loop", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for(n=0; n< 1000; n++) + { + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Force a REINIT msg", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_LINEDEVSTATE; + info.u.EspMsg.dwParam1 = LINEDEVSTATE_REINIT; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_REINIT; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + AddMessage( + LINE_LINEDEVSTATE, + (DWORD) lpTapiLineTestInfo->hLine1, + (DWORD) lpCallbackParams, + LINEDEVSTATE_REINIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_REINIT)) + { + TLINE_FAIL(); + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->hLine_Orig = lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; + lpTapiLineTestInfo->dwExtVersion = 0x0; + lResult = DoLineOpen(lpTapiLineTestInfo, info.u.EspResult.lResult); + if(!lResult) + { + TLINE_FAIL(); + } + else + { + if ( ! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d, dwExtVer = 0", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_NODRIVER; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; +// lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = dwAllMediaModes; + lpTapiLineTestInfo->dwExtVersion = 0x0; + if(! DoLineOpen(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + TLINE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d, dwExtVer = 1", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_INCOMPATIBLEEXTVERSION; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; + lpTapiLineTestInfo->dwExtVersion = 0x1; + if(! DoLineOpen(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + TLINE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d, OWNER, INTERACTIVEVOICE", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_NODRIVER; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwExtVersion = 0x0; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_INTERACTIVEVOICE; + + if(! DoLineOpen(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + TLINE_FAIL(); + } + + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + 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, + "@@ lineOpen: 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 lineOpen <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line/itls.c b/private/tapi/qa/trapper/itest/line/itls.c new file mode 100644 index 000000000..00509ccd8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itls.c @@ -0,0 +1,993 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itls.c + +Abstract: + + This module contains the test functions for lineShutdown + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "tline.h" + + +// lineShutdown +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hLineApps +// 3) Verify hLineApp can't be reused (no other hLineApps exist) +// 4) Verify hLineApp can't be reused (1 other hLineApp exists) +// 5) Shutdown hLineApp after lineInitialize fails +// 6) Verify LINECALLINFO/NUMMONITORS msg sent when hLineApp shutdown +// (2 call clients [one owner, one monitor] on 2 different hLineApps) +// 7) Verify LINECALLINFO/NUMOWNERDECR msg sent when hLineApp shutdown +// (2 call clients [both owners] on 2 different hLineApps) +// 8) Verify LINECALLINFO/NUMMONITORS msg sent when hLineApp shutdown +// (2 call clients [both monitors] on 2 different hLineApps) +// 9) Shutdown while a call is in progress and verify +// that the call handle, line handle, and line app handle are +// no longer valid +// 10) Shutdown while a line is open with owner privilege and verify +// line handle is invalid +// +// * = Stand-alone test + +BOOL TestLineShutdown(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + BOOL fResult; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + HCALL hCall; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + LONG lret; + LPTAPIMSG lpMsg; + LINEINITIALIZEEXPARAMS lineInitializeExParams1; + LINEINITIALIZEEXPARAMS lineInitializeExParams2; + + + InitTestNumber(); + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + strcpy(lpTapiLineTestInfo->szTestFunc, "lineShutdown"); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineShutdown <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLineApp handles", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Test bad line app handles (uses &lpTapiLineTestInfo->hLineApp1) + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Use &hLineApp2 to test invalid handles + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp2); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Restore lpTapiLineTestInfo->lphLineApp to point to &hLineApp1 + // Note: hLineApp1 is a valid initialized handle + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + + // Might as well test valid shutdown now + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state (no active calls)", dwTestCase + 1 + ); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Test that shutdown fails when there are no line handles initialized + // no lines are initialized (hLineApp should be invalid) + // If this is a stand-alone test (no other TAPI apps are running) + // then LINEERR_UNINITIALIZED will be the expected return value. + // Otherwise, LINEERR_INVALAPPHANDLE should be returned. + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1 + ); + + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + } +/* + else + { + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLineApp handle", dwTestCase + 1 + ); + + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hLineApp can't be shutdown if lineInitialize fails", dwTestCase + 1 + ); + + // Initialize a valid line app instance to prevent the possibility + // of receiving an UNINITIALIZED error during the next test + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp3; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Backup the hLineApp and use a different one for the next test + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + + // Verify that an app handle can't be used in a shutdown call + // if lineInitialize returned an error prior to shutdown attempt + lpTapiLineTestInfo->lpdwNumDevs = NULL; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpdwNumDevs = &(lpTapiLineTestInfo->dwNumDevs); + + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hLineApp can't be used after shutdown (>= 1 hLineApps)", dwTestCase + 1 + ); + + // Verify that an app handle can't be reused after it's been + // shutdown by another line abstraction in use + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the initialized app handle + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + + // Initialize another app handle + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown a handle + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown another handle + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp2); + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // make sure app handle can't be reused (1 other hLineApp exists). + // Test first app handle shutdown + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Prepare to open a line, make a call, and try shutting it down. + // Next verify that the hCall, the hLine, and the hLineApp + // are no longer valid after the shutdown. + + // First, initialize a spare hLineApp to prevent UNINITIALIZED errors + // from being returned if this is the only TAPI app running. + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hLine, hCall, and hLineApp are invalid after shutdown", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Negotiate the API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Allocate lpLineDevCaps + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Call handle should be invalid + if (! DoLineDeallocateCall(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + + // The line should be closed + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + + // The line app instance should be invalid + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid shutdown of opened line with owner privilege", dwTestCase + 1 + ); + + // Take the remaining hLineApp, open a line with owner privilege, + // and shutdown (Verifies NT BUG #10179 is fixed) + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp3; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Currently, there should be no lines initialized from this thread. + // First, initialize a couple of different line app instances. + // Open the same line device for each hLineApp (one as owner and + // one as monitor). Next, make a call with the owner. After the + // call proceeds to the connected state, shutdown the monitor. + // The owner should receive a LINE_CALLINFO/NUMMONITORS message + // to indicate that the number of monitors has decremented. + // + // Note: To be sure that this message is sent as a result of the + // shutdown in this thread, no other threads or applications + // can be using the device during the test. + // + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: LINE_CALLINFO/NUMMONITORS message sent to owner\r\n" \ + ">> (same hLineApp)", dwTestCase + 1 + ); + + // Initialize 2 hLineApps + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp2 = *(lpTapiLineTestInfo->lphLineApp); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the API version (It's been done before, but doing it again + // removes dependencies from previous test results). + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Allocate a new lpLineDevCaps pointer + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line device as monitor (dwMediaModes is ignored) + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with a different line app registration as owner with + // dwMediaModes set equal to what the line device can accomodate + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp2); + lpTapiLineTestInfo->lphLine = &(lpTapiLineTestInfo->hLine2); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// BUGBUG +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call on the line opened as owner + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Shutdown the monitor and verify that the owner receives a message + // indicating the number of monitors on the line has changed + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp1); + fResult = DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS); + if (! fResult) + { + TLINE_FAIL(); + } + + // Add the expected LINE_CALLINFO message to the list of + // expected TAPI messages and wait for it + // Note: The lpCallbackParams value will make this expected message + // unique. Therefore, if another app is monitoring this line + // and it is closed, the message will not precisely match. + if (fResult) + { + AddMessage( + LINE_CALLINFO, + (DWORD) *lpTapiLineTestInfo->lphCall, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + } + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Drop the call by closing the line (lpTapiLineTestInfo->lphLine + // still points to the line handle of the owner) + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Next open the same line device on two different app registrations. + // Initially, open one as owner, and the other as a monitor. Make a + // call via the owner. Set the call privilege of the monitor to owner. + // Go ahead and verify that a LINE_CALLINFO/NUMOWNERINCR message is + // sent. Shutdown one of the owners and verify that a LINE_CALLINFO/ + // NUMOWNERDECR message is sent to the other owner after the shutdown. + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: LINE_CALLINFO/NUMOWNERINCR & DECR msgs are sent\r\n" \ + ">> (different hLineApps)", dwTestCase + 1 + ); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lpLineInitializeExParams = &lineInitializeExParams1; + + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lpLineInitializeExParams = &lineInitializeExParams2; + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + fResult = DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE); + + if (! fResult) + { + TLINE_FAIL(); + } + + lpMsg = AddMessage(LINE_CALLSTATE, 0, 0, 0, 0, 0, TAPIMSG_DWMSG); + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + if(FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE)) + { + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + else + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + fResult = DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS); + if (! fResult) + { + TLINE_FAIL(); + } + + + // Add the messages only if lineSetCallPrivilege succeeded + if (fResult) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG +//| TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 | +// TAPIMSG_HDEVCALL + ); + } + + // Wait for the unsolicited messages to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + fResult = DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS); + if (! fResult) + { + TLINE_FAIL(); + } + + + if (fResult) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG +//| TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 | +// TAPIMSG_HDEVCALL + ); + } + + // Wait for the unsolicited messages to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG +// | TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 | +// TAPIMSG_HDEVCALL + ); + + // Wait for the unsolicited messages to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + sizeof(HCALL) ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + sizeof(HCALL); + + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG +// | TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 | +// TAPIMSG_HDEVCALL + ); + + // Wait for the unsolicited messages to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG +// | TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 | +// TAPIMSG_HDEVCALL + ); + + // Wait for the unsolicited messages to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: LINE_CALLINFO/NUMOWNERINCR & DECR msgs are sent\r\n" \ + ">> (different hLineApps)", dwTestCase + 1 + ); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + 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; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Initialize a second line app (lpTapiLineTestInfo->hLineApp2). + lpTapiLineTestInfo->lphLineApp = &(lpTapiLineTestInfo->hLineApp2); + lpTapiLineTestInfo->lphLine = &(lpTapiLineTestInfo->hLine2); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open as a monitor (assume the device caps haven't changed, and + // the same device is being used as in the previous test). + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call with the owner + lpTapiLineTestInfo->lphLine = &(lpTapiLineTestInfo->hLine1); + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + fResult = DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE); + if (! fResult) + { + TLINE_FAIL(); + } + + if (fResult) + { + // Add an expected message for the monitor to receive a LINE_CALLSTATE + // message informing the app that an outbound call has been established + // on the line + lpMsg = AddMessage( + LINE_CALLSTATE, + 0x00000000, + (DWORD) lpCallbackParams, + LINECALLSTATE_UNKNOWN, + 0x00000000, + LINECALLPRIVILEGE_MONITOR, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 | + TAPIMSG_DWPARAM3 + ); + lpMsg = AddMessage(LINE_CALLSTATE, 0, 0, 0, 0, 0, TAPIMSG_DWMSG); + } + + // Wait for the asynchronous reply to the owner and the callstate + // message to the monitor. + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + + // Change the call privilege of the monitor to owner and see if + // LINE_CALLINFO/NUMMONITORS and LINE_CALLINFO/NUMOWNERINCR messages + // are received. + + // Store the call handle for the owner with hLine2 and hLineApp2 + lpTapiLineTestInfo->hCall2 = *(lpTapiLineTestInfo->lphCall); + + // Get the call handle from the LINECALLSTATE message that the monitor + // received. + XYD + *lpTapiLineTestInfo->lphCall = (HCALL) CallbackParamsGetDevCallHandle( + lpCallbackParams, + LINE_CALLSTATE + ); + + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_DIALING; + lpMatch->dwParam3 = LINECALLPRIVILEGE_MONITOR; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM3; + + if(FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE)) + { + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + else + { + TLINE_FAIL(); + } + + + // Take ownership of the call (After this is called, there will be two + // owners of the call on different line app registrations.). + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + fResult = DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS); + if (! fResult) + { + TLINE_FAIL(); + } + + + // Add the messages only if lineSetCallPrivilege succeeded + if (fResult) + { + // Add an expected message for the original owner to receive a + // LINE_CALLINFOSTATE message informing the app that the number of + // monitors on the line has changed (decremented by 1) and the + // number of owners has increased. + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST | TAPIMSG_DWPARAM1 | + TAPIMSG_HDEVCALL + ); + } + + // Wait for the unsolicited messages to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Shutdown one of the line apps and see if the other owner receives + // a LINE_CALLINFOSTATE message informing the app that the number of + // owners has decreased. + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + fResult = DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS); + if (! fResult) + { + TLINE_FAIL(); + } + + // Only add the message if the shutdown succeeded + if (fResult) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_ALL + ); + } + + // Wait for the unsolicited message to be sent + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // Shutdown the other line app + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Free the memory taken from the heap + FreeTestHeap(); +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineShutdown: 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 lineShutdown <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/line/itlscp.c b/private/tapi/qa/trapper/itest/line/itlscp.c new file mode 100644 index 000000000..8898a4325 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlscp.c @@ -0,0 +1,548 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscp.c + +Abstract: + + This module contains the test functions for lineSetCallPrivilege + +Author: + + Oliver Wallace (OliverW) 10-Sep-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + +#define ALL_LINECALLPRIVILEGES (LINECALLPRIVILEGE_NONE | \ + LINECALLPRIVILEGE_MONITOR | \ + LINECALLPRIVILEGE_OWNER) + +#define ALL_LINECALLPRIVILEGE (LINECALLPRIVILEGE_MONITOR | \ + LINECALLPRIVILEGE_OWNER) + +#define DWNUMCALLS 1 + + +// lineSetCallPrivilege +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hCalls +// 3) Test invalid bit flag combinations for dwCallPrivilege +// 4) Test valid bit flag combinations for dwCallPrivilege +// 5) Attempt to set call privilege to monitor when sole owner +// and not in the IDLE state +// 6) Verify LINE_CALLINFO/NUMMONITORS sent when monitor added +// 7) Verify LINE_CALLINFO/NUMOWNERINCR and NUMMONITORS sent when +// a monitor is changed to an owner with lineSetCallPrivilege +// 8) Verify LINE_CALLINFO/NUMOWNERDECR and NUMMONITORS sent when +// an owner is changed to a monitor with lineSetCallPrivilege +// +// * = Stand-alone test + +BOOL TestLineSetCallPrivilege(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams; + + InitTestNumber(); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + strcpy(lpTapiLineTestInfo->szTestFunc, "lineSetCallPrivilege"); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetCallPrivilege <<<<<<<<" + ); + + // Call lineSetCallPrivilege before any lines are initialized + // Note: This test must be run in a stand-alone mode + + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1 + ); + if (! DoLineSetCallPrivilege( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: call privilege can't be changed to\r\n" \ + ">> monitor when sole owner and not idle", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (!DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the current API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call (as owner) + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Try setting the call privilege from owner to monitor when the + // sole owner of the call and not in the idle state +// lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; +// if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, LINEERR_INVALCALLSTATE)) + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid call handles", dwTestCase + 1 + ); + + // Pass some invalid call handles + lpTapiLineTestInfo->hCall_Orig = *lpTapiLineTestInfo->lphCall; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[n]; + + if (! DoLineSetCallPrivilege( + lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphCall = lpTapiLineTestInfo->hCall_Orig; + + // Try some invalid dwPrivileges + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwPrivileges values", dwTestCase + 1 + ); + + if (! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineSetCallPrivilege, + (LPDWORD) &lpTapiLineTestInfo->dwCallPrivilege, + LINEERR_INVALCALLPRIVILEGE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_LINECALLPRIVILEGES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid dwPrivileges values", dwTestCase + 1 + ); + +/* + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } +*/ + + if (! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineSetCallPrivilege, + (LPDWORD) &lpTapiLineTestInfo->dwCallPrivilege, +/* XYD, NA and MUTEX should exchange postion, bug! + FIELDTYPE_NA, + FIELDTYPE_MUTEX, +*/ + FIELDTYPE_MUTEX, + FIELDTYPE_NA, + FIELDSIZE_32, +// XYD, NONE can't be used, MONITOR returns INVALCALLSTATE +// so, change all to OWNER ALL_LINECALLPRIVILEGES, +// LINECALLPRIVILEGE_OWNER, + ALL_LINECALLPRIVILEGE, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Deallocate the call + if (! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown the line app instance + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (!DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the current API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// lpTapiLineTestInfo->lpLineDevCaps->dwMediaModes; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call (as owner) + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown the line app instance + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMMONITORS msg sent when monitor added", dwTestCase +1); + + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (!DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the current API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Make a call (as owner) + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 8; + + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMOWNERINCR msg sent when monitor added", dwTestCase +1); + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMOWNERDECR msg sent when monitor added", dwTestCase +1); + + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS | LINECALLINFOSTATE_NUMOWNERDECR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown the line app instance + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetCallPrivilege: 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 lineSetCallPrivilege <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itlsnr.c b/private/tapi/qa/trapper/itest/line/itlsnr.c new file mode 100644 index 000000000..e4eb2c8e2 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlsnr.c @@ -0,0 +1,255 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsnr.c + +Abstract: + + This module contains the test functions for lineSetNumRings + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define VALID_DWNUMRINGS 0x00000005 + + +// lineSetNumRings +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) Invalid hLines +// 3) Invalid dwAddressID (-1, dwNumAddresses) +// +// * = Stand-alone test case +// +// Note: lineSetNumRings/lineGetNumRings testing is performed +// in the tests for lineGetNumRings. +// +// One lineSetNumRings case is performed here as a sanity check. +// + +BOOL TestLineSetNumRings(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fResult; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetNumRings <<<<<<<<" + ); + + // Test for LINEERR_UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1); + + if (! DoLineSetNumRings(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + } + + // Setup an open line + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + // Prep linedevcaps + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + // Assign valid low and high values for negotiating the API version + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Set media modes and privileges for lineOpen + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + // Start tests by checking invalid hLines + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1); + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineSetNumRings(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Test invalid dwAddressID (dwNumAddresses) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (dwNumAddresses)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + if (! DoLineSetNumRings(lpTapiLineTestInfo, LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + // Test invalid dwAddressID (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid dwAddressID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAddressID_Orig = lpTapiLineTestInfo->dwAddressID; + lpTapiLineTestInfo->dwAddressID = DWMINUSONE; + if (! DoLineSetNumRings(lpTapiLineTestInfo, LINEERR_INVALADDRESSID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAddressID = lpTapiLineTestInfo->dwAddressID_Orig; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwNumRings", dwTestCase + 1); + + lpTapiLineTestInfo->dwNumRings = 0xffffffff; + if (! DoLineSetNumRings(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwNumRings = 0; + lpTapiLineTestInfo->lpdwNumRings = &lpTapiLineTestInfo->dwNumRings; + + if (! DoLineGetNumRings(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwNumRings = %lx", + lpTapiLineTestInfo->dwNumRings); + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwNumRings = 0; + + + // Test one valid case (several more valid SetNumRings calls are located + // in the lineGetNumRings tests) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid params and state", dwTestCase + 1); + + *lpTapiLineTestInfo->lpdwNumRings = VALID_DWNUMRINGS; + if (! DoLineSetNumRings(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verifying dwNumRings was set properly", dwTestCase + 1); + + if (! DoLineGetNumRings(lpTapiLineTestInfo, TAPISUCCESS) || + *lpTapiLineTestInfo->lpdwNumRings != VALID_DWNUMRINGS) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Close up and shutdown + fResult = DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + ); + + if (! fResult) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetNumRings: 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 lineSetNumRings <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/itlssm.c b/private/tapi/qa/trapper/itest/line/itlssm.c new file mode 100644 index 000000000..d5fd005d3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/itlssm.c @@ -0,0 +1,681 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlssm.c + +Abstract: + + This module contains the test functions for lineSetStatusMessages + +Author: + + Oliver Wallace (OliverW) 10-Sep-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "tline.h" + + +#define ALL_LINEDEVSTATES (LINEDEVSTATE_OTHER | \ + LINEDEVSTATE_RINGING | \ + LINEDEVSTATE_CONNECTED | \ + LINEDEVSTATE_DISCONNECTED | \ + LINEDEVSTATE_MSGWAITON | \ + LINEDEVSTATE_MSGWAITOFF | \ + LINEDEVSTATE_INSERVICE | \ + LINEDEVSTATE_OUTOFSERVICE | \ + LINEDEVSTATE_MAINTENANCE | \ + LINEDEVSTATE_OPEN | \ + LINEDEVSTATE_CLOSE | \ + LINEDEVSTATE_NUMCALLS | \ + LINEDEVSTATE_NUMCOMPLETIONS | \ + LINEDEVSTATE_TERMINALS | \ + LINEDEVSTATE_ROAMMODE | \ + LINEDEVSTATE_BATTERY | \ + LINEDEVSTATE_SIGNAL | \ + LINEDEVSTATE_DEVSPECIFIC | \ + LINEDEVSTATE_REINIT | \ + LINEDEVSTATE_LOCK | \ + LINEDEVSTATE_CAPSCHANGE | \ + LINEDEVSTATE_CONFIGCHANGE | \ + LINEDEVSTATE_TRANSLATECHANGE | \ + LINEDEVSTATE_COMPLCANCEL | \ + LINEDEVSTATE_REMOVED) + +#define ALL_LINEADDRESSSTATES (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE) + +/* +#define ALL_LINEADDRESSSTATES_20 (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE | \ + LINEADDRESSSTATE_AGENT | \ + LINEADDRESSSTATE_AGENTSTATE | \ + LINEADDRESSSTATE_AGENTACTIVITY) +*/ + +// lineSetStatusMessages +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// * 1) Uninitialized (called before any lines are initialized) +// 2) Invalid hLines +// 3) Test invalid bit flag combinations for dwLineStates +// 4) Test invalid bit flag combinations for dwAddressStates +// 5) Test valid bit flag combinations for dwLineStates +// 6) Test valid bit flag combinations for dwAddressStates +// 7) Solicit SPI errors (NOMEM, OPERATIONFAILED, RESOURCEUNAVAIL, +// OPERATIONUNAVAIL) (not implemented here) +// 8) Verify status message filtering is occuring on the set hLine +// (not implemented yet) +// 9) Verify status message filtering doesn't occur across +// different hLines (not implemented yet) +// +// * = Stand-alone test + +BOOL TestLineSetStatusMessages(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + CHAR szTestFunc[] = "lineSetStatusMessages"; + DWORD dwAllAddressStates; + + + InitTestNumber(); + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + strcpy(lpTapiLineTestInfo->szTestFunc, szTestFunc); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetStatusMessages <<<<<<<<" + ); + + // Call lineSetStatusMessages before any lines are initialized + // Note: This test must be run in a stand-alone mode + if (fStandAloneTest) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: uninitialized state", dwTestCase + 1 + ); + + if (! DoLineSetStatusMessages( + lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + } + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the current API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with owner privilege +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the valid line handle and try some invalid ones + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine handles", dwTestCase + 1 + ); + + lpTapiLineTestInfo->hLine_Orig = *lpTapiLineTestInfo->lphLine; + lpTapiLineTestInfo->dwLineStates = 0x00000000; + lpTapiLineTestInfo->dwAddressStates = 0x00000000; + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLine = (HLINE) gdwInvalidHandles[n]; + if (! DoLineSetStatusMessages( + lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE + )) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Restore valid line handle + *lpTapiLineTestInfo->lphLine = lpTapiLineTestInfo->hLine_Orig; + + // Test invalid line states + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line states", dwTestCase + 1 + ); + + if (! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineSetStatusMessages, + (LPDWORD) &lpTapiLineTestInfo->dwLineStates, + LINEERR_INVALLINESTATE, + FIELDTYPE_NA, + FIELDTYPE_UNION, + FIELDSIZE_32, + ALL_LINEDEVSTATES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xFFFFFFFF, +// XYD 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Test invalid address states + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid address states", dwTestCase + 1 + ); + +/* + if(lpTapiLineTestInfo->dwAPIVersion >= 20000) + { + dwAllAddressStates = ALL_LINEADDRESSSTATES_20; + } + else +*/ + { + dwAllAddressStates = ALL_LINEADDRESSSTATES; + } + + if (! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineSetStatusMessages, + (LPDWORD) &lpTapiLineTestInfo->dwAddressStates, + LINEERR_INVALADDRESSSTATE, + FIELDTYPE_NA, + FIELDTYPE_UNION, + FIELDSIZE_32, + dwAllAddressStates, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, +//XYD 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Test valid line states + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid line states", dwTestCase + 1 + ); + + if (! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineSetStatusMessages, + (LPDWORD) &lpTapiLineTestInfo->dwLineStates, +/* XYD, should NA exchange with UNION? + FIELDTYPE_NA, + FIELDTYPE_UNION, +*/ + FIELDTYPE_UNION, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_LINEDEVSTATES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Test Valid address states + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid address states", dwTestCase + 1 + ); + + if (! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineSetStatusMessages, + (LPDWORD) &lpTapiLineTestInfo->dwAddressStates, +/* XYD, should NA exchange with UNION? + FIELDTYPE_NA, + FIELDTYPE_UNION, +*/ + FIELDTYPE_UNION, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_LINEADDRESSSTATES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown the line app instance + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid Get/SetStatusMessages combinations and verify\r\n" \ + ">> the returned data", dwTestCase + 1 + ); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the current API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with owner privilege + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwLineStates = ALL_LINEDEVSTATES; + lpTapiLineTestInfo->dwAddressStates = ALL_LINEADDRESSSTATES; + // Store the values used + lpTapiLineTestInfo->dwLineStates_Orig = lpTapiLineTestInfo->dwLineStates; + lpTapiLineTestInfo->dwAddressStates_Orig = + lpTapiLineTestInfo->dwAddressStates; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Verify the results by calling lineGetStatusMessages + if (! DoLineGetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS) || + *lpTapiLineTestInfo->lpdwAddressStates != + lpTapiLineTestInfo->dwAddressStates_Orig || + *lpTapiLineTestInfo->lpdwLineStates != + lpTapiLineTestInfo->dwLineStates_Orig + ) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify status msg filtering acroos different hLine", + dwTestCase + 1 + ); + + // Initialize a line app instance + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the current API version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with owner privilege + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwLineStates = ALL_LINEDEVSTATES; + lpTapiLineTestInfo->dwAddressStates = ALL_LINEADDRESSSTATES; + // Store the values used + lpTapiLineTestInfo->dwLineStates_Orig = lpTapiLineTestInfo->dwLineStates; + lpTapiLineTestInfo->dwAddressStates_Orig = + lpTapiLineTestInfo->dwAddressStates; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineGetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS) || + *lpTapiLineTestInfo->lpdwAddressStates == + lpTapiLineTestInfo->dwAddressStates_Orig || + *lpTapiLineTestInfo->lpdwLineStates == + lpTapiLineTestInfo->dwLineStates_Orig + ) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + if ( ! DoLineSetStatusMessages(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + + + info.u.EspResult.lResult = LINEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + if ( ! DoLineSetStatusMessages(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetStatusMessages: 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 lineSetStatusMessages <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/line/line.inc b/private/tapi/qa/trapper/itest/line/line.inc new file mode 100644 index 000000000..00d36b034 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/line.inc @@ -0,0 +1,82 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLDEF=..\tline.def +DLLBASE=0x60000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + +USE_CRTDLL=1 + +SOURCES=..\tline.c \ + ..\itlc.c \ + ..\itlgac.c \ + ..\itlgdc.c \ + ..\itlgnr.c \ + ..\itlsnr.c \ + ..\itlglds.c \ + ..\itlgas.c \ + ..\itldial.c \ + ..\itldrop.c \ + ..\itli.c \ + ..\itlo.c \ + ..\itls.c \ + ..\itldc.c \ + ..\itlmc.c \ + ..\itlmc1.c \ + ..\itlmc2.c \ + ..\itlgid.c \ + ..\itlnapiv.c \ + ..\itlscp.c \ + ..\itlgsm.c \ + ..\itlssm.c \ + ..\itlgci.c \ + ..\itlgcs.c \ + ..\itlgnc.c \ + ..\itlgaid.c \ + ..\uline.c \ + ..\tline.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + + +UMTYPE=windows + +DLLENTRY=TlineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/line/linea/makefile b/private/tapi/qa/trapper/itest/line/linea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/linea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/line/linea/sources b/private/tapi/qa/trapper/itest/line/linea/sources new file mode 100644 index 000000000..0abb24fe5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/linea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\line.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/line/linew/makefile b/private/tapi/qa/trapper/itest/line/linew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/linew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/line/linew/sources b/private/tapi/qa/trapper/itest/line/linew/sources new file mode 100644 index 000000000..4a2bc248a --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/linew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\line.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/line/tline.c b/private/tapi/qa/trapper/itest/line/tline.c new file mode 100644 index 000000000..9add6199b --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/tline.c @@ -0,0 +1,409 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + tline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "tline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTlineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TlineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTlineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAddressCaps(TRUE, FALSE)); +} + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineGetDevCaps(TRUE, FALSE)); +} + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineInitialize(TRUE, FALSE)); +} + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineMakeCall(TRUE, FALSE)); +} + +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineMakeCall1(TRUE, FALSE)); +} + +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineMakeCall2(TRUE, FALSE)); +} + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineNegotiateAPIVersion(TRUE, FALSE)); +} + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineOpen(TRUE, FALSE)); +} + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineShutdown(TRUE, FALSE)); +} + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineClose(TRUE, FALSE)); +} + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineGetID(TRUE, FALSE)); +} + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineGetNumRings(TRUE, FALSE)); +} + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineSetNumRings(TRUE, FALSE)); +} + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineDeallocateCall(TRUE, FALSE)); +} + +BOOL +WINAPI +Test16( + HINSTANCE hAppInst + ) +{ + return (TestLineDial(TRUE, FALSE)); +} + +BOOL +WINAPI +Test17( + HINSTANCE hAppInst + ) +{ + return (TestLineDrop(TRUE, FALSE)); +} + +BOOL +WINAPI +Test18( + HINSTANCE hAppInst + ) +{ + return (TestLineGetLineDevStatus(TRUE, FALSE)); +} + +BOOL +WINAPI +Test19( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAddressStatus(TRUE, FALSE)); +} + +BOOL +WINAPI +Test20( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallPrivilege(TRUE, FALSE)); +} + +BOOL +WINAPI +Test21( + HINSTANCE hAppInst + ) +{ + return (TestLineGetStatusMessages(TRUE, FALSE)); +} + +BOOL +WINAPI +Test22( + HINSTANCE hAppInst + ) +{ + return (TestLineSetStatusMessages(TRUE, FALSE)); +} + +BOOL +WINAPI +Test23( + HINSTANCE hAppInst + ) +{ + return (TestLineGetCallInfo(TRUE, FALSE)); +} + +BOOL +WINAPI +Test24( + HINSTANCE hAppInst + ) +{ + return (TestLineGetCallStatus(TRUE, FALSE)); +} + +BOOL +WINAPI +Test25( + HINSTANCE hAppInst + ) +{ + return (TestLineGetNewCalls(TRUE, FALSE)); +} + +BOOL +WINAPI +Test26( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAddressID(TRUE, FALSE)); +} diff --git a/private/tapi/qa/trapper/itest/line/tline.def b/private/tapi/qa/trapper/itest/line/tline.def new file mode 100644 index 000000000..0c44b3311 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/tline.def @@ -0,0 +1,36 @@ +LIBRARY tline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 + Test16 + Test17 + Test18 + Test19 + Test20 + Test21 + Test22 + Test23 + Test24 + Test25 + Test26 diff --git a/private/tapi/qa/trapper/itest/line/tline.h b/private/tapi/qa/trapper/itest/line/tline.h new file mode 100644 index 000000000..726f21929 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/tline.h @@ -0,0 +1,446 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + tline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef TLINE_H +#define TLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineClose( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDeallocateCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDial( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDrop( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAddressCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAddressStatus( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetDevCaps( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineGetID( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetLineDevStatus( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetNumRings( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineInitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMakeCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMakeCall1( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMakeCall2( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineNegotiateAPIVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestLineOpen( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetNumRings( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineShutdown( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineSetCallPrivilege( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetStatusMessages( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineSetStatusMessages( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetCallInfo( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetCallStatus( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetNewCalls( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetAddressID( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetProviderList( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineUninit( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test16( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test17( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test18( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test19( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test20( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test21( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test22( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test23( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test24( + HINSTANCE hAppInst + ); + +BOOL +WINAPI +Test25( + HINSTANCE hAppInst + ); + +BOOL +WINAPI +Test26( + HINSTANCE hAppInst + ); + + +#endif // TLINE_H diff --git a/private/tapi/qa/trapper/itest/line/tline.rc b/private/tapi/qa/trapper/itest/line/tline.rc new file mode 100644 index 000000000..1c0a2d653 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/tline.rc @@ -0,0 +1,12 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI TLine API test Library" +#define VER_INTERNALNAME_STR "tline.dll" +#define VER_ORIGINALFILENAME_STR "tline.dll" + +#include "common.ver" + + diff --git a/private/tapi/qa/trapper/itest/line/uline.c b/private/tapi/qa/trapper/itest/line/uline.c new file mode 100644 index 000000000..5e3f8f6e1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line/uline.c @@ -0,0 +1,390 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "tline.h" + + +#define DWNUMCALLS 1 + +// Macro for handling unexpected failures during the tests +#define ITLC_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + +char szApiName[23][48] = + { + "lineClose", + "lineDeallocateCall", + "lineDial", + "lineDrop", + "lineGetAddressCaps", + "lineGetAddressID", + "lineGetAddressStatus", + "lineGetCallInfo", + "lineGetCallStatus", + "lineGetDevCaps", + "lineGetID", + "lineGetLineDevStatus", + "lineGetNewCalls", + "lineGetNumRings", + "lineGetProviderList", + "lineGetStatusMessage", +// "lineHold", + "lineMakeCall", + "lineNegotiateAPIVersion", + "lineOpen", +// "lineSetAppSpecific", + "lineSetCallPrivilege", + "lineSetNumRings", + "lineSetStatusMessages", + "lineShutdown", +// "lineUnhold" + }; + + +BOOL TestLineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 23; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 1: + if (! DoLineDeallocateCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 2: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + + case 3: + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + + case 4: + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 5: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = L"55555"; +#else + lpTapiLineTestInfo->lpsAddress = "55555"; +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + lpTapiLineTestInfo->dwSize = 16; + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 6: + lpTapiLineTestInfo->lpLineAddressStatus = (LPLINEADDRESSSTATUS) AllocFromTestHeap ( + sizeof(LINEADDRESSSTATUS)); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = sizeof(LINEADDRESSSTATUS); + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 7: + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap ( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + if (! DoLineGetCallInfo(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 8: + if (! DoLineGetCallStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 9: + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof (LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 10: + lpTapiLineTestInfo->lpDeviceID = (LPVARSTRING)AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 11: + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap ( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 12: + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 8; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 13: + if (! DoLineGetNumRings(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 14: + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap ( + sizeof(LINEPROVIDERLIST)); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->dwAPIVersion = 0x20000; + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + break; + + case 15: + if (! DoLineGetStatusMessages(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + /* + case 16: + if (! DoLineHold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + */ + + case 16: + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + + case 17: + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 18: + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + /* + case 20: + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + */ + + case 19: + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 20: + if (! DoLineSetNumRings(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 21: + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 22: + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + /* + case 25: + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + */ + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/line20/itlas.c b/private/tapi/qa/trapper/itest/line20/itlas.c new file mode 100644 index 000000000..c1e3ee6a2 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlas.c @@ -0,0 +1,192 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlas.c + +Abstract: + + This module contains the test functions for lineAgentSpecific + +Author: + + Xiao Ying Ding (XiaoD) 21-Dec-1995 + +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 "line20.h" + + + +// lineAgentSpecific +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAgentSpecific(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineAgentSpecific"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlgaal.c b/private/tapi/qa/trapper/itest/line20/itlgaal.c new file mode 100644 index 000000000..d988b834b --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlgaal.c @@ -0,0 +1,211 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgaal.c + +Abstract: + + This module contains the test functions for lineGetAgentActivityList + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineGetAgentActivityList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentActivityList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAgentActivityList"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) AllocFromTestHeap( + sizeof(LINEAGENTACTIVITYLIST) + ); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = sizeof(LINEAGENTACTIVITYLIST); + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwNumEntries = 2; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwNumEntries = %lx", + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize, + lpTapiLineTestInfo->lpAgentActivityList->dwNeededSize, + lpTapiLineTestInfo->lpAgentActivityList->dwNumEntries); + + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlgac.c b/private/tapi/qa/trapper/itest/line20/itlgac.c new file mode 100644 index 000000000..8bd8993bd --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlgac.c @@ -0,0 +1,208 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgac.c + +Abstract: + + This module contains the test functions for lineGetAgentCaps + +Author: + + Xiao Ying Ding (XiaoD) 21-Dec-1995 + +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 "line20.h" + + + +// lineGetAgentCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAgentCaps"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentCaps unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Get the line device capabilities + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentCaps.AgentCaps.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentCaps.AgentCaps.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentCaps.AgentCaps.dwFeatures = LINEAGENTFEATURE_GETAGENTGROUP; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwFeatures = %lx", + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize, + lpTapiLineTestInfo->lpAgentCaps->dwNeededSize, + lpTapiLineTestInfo->lpAgentCaps->dwFeatures); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentCaps Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentCaps Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlgagl.c b/private/tapi/qa/trapper/itest/line20/itlgagl.c new file mode 100644 index 000000000..1690f5ada --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlgagl.c @@ -0,0 +1,212 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgagl.c + +Abstract: + + This module contains the test functions for lineGetAgentGroupList + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineGetAgentGroupList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentGroupList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAgentGroupList"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentGroupList unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Get the line device capabilities + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentGroupList.GroupList.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentGroupList.GroupList.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentGroupList.GroupList.dwNumEntries = 2; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwNumEntries = %lx", + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize, + lpTapiLineTestInfo->lpAgentGroupList->dwNeededSize, + lpTapiLineTestInfo->lpAgentGroupList->dwNumEntries); + + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentGroupList Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentGroupList Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlgas.c b/private/tapi/qa/trapper/itest/line20/itlgas.c new file mode 100644 index 000000000..aa4673aa7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlgas.c @@ -0,0 +1,212 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgas.c + +Abstract: + + This module contains the test functions for lineGetAgentStatus + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineGetAgentStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAgentStatus"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentStatus unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Get the line device capabilities + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentStatus.AgentStatus.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentStatus.AgentStatus.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentStatus.AgentStatus.dwActivityID = 1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwActivityID = %lx", + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize, + lpTapiLineTestInfo->lpAgentStatus->dwNeededSize, + lpTapiLineTestInfo->lpAgentStatus->dwActivityID); + + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentStatus Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentStatus Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlgm.c b/private/tapi/qa/trapper/itest/line20/itlgm.c new file mode 100644 index 000000000..9d7329e6c --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlgm.c @@ -0,0 +1,151 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgm.c + +Abstract: + + This module contains the test functions for lineGetMessage + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "line20.h" + + + +// lineGetMessage +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetMessage(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetMessage"); + + // Initialize a line app + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEEVENT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + + WaitForAllMessages(); + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE) AllocFromTestHeap ( + sizeof(LINEMESSAGE)); + + if(! DoLineGetMessage (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: hDevice = %lx, dwMessageID = %lx, dwCallbackInst = %lx", + lpTapiLineTestInfo->lpMessage->hDevice, + lpTapiLineTestInfo->lpMessage->dwMessageID, + lpTapiLineTestInfo->lpMessage->dwCallbackInstance); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: dwParam1 = %lx, dwParam2 = %lx, dwParam3 = %lx", + lpTapiLineTestInfo->lpMessage->dwParam1, + lpTapiLineTestInfo->lpMessage->dwParam2, + lpTapiLineTestInfo->lpMessage->dwParam3); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_PASS, + "## lineGetMessage Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_PASS, + "## lineGetMessage Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlie.c b/private/tapi/qa/trapper/itest/line20/itlie.c new file mode 100644 index 000000000..0624088a7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlie.c @@ -0,0 +1,102 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlie.c + +Abstract: + + This module contains the test functions for lineInitializeEx + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "line20.h" + + + +// lineInitializeEx +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineInitializeEx(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineInitializeEx"); + + // Initialize a line app + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineInitializeEx Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineInitializeEx Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlpm.c b/private/tapi/qa/trapper/itest/line20/itlpm.c new file mode 100644 index 000000000..14f1288fc --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlpm.c @@ -0,0 +1,176 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpm.c + +Abstract: + + This module contains the test functions for lineProxyMessage + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "line20.h" + + + +// lineProxyMessage +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineProxyMessage(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineProxyMessage"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyMessage unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineProxyMessage for go/no-go"); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyMessage Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyMessage Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlpr.c b/private/tapi/qa/trapper/itest/line20/itlpr.c new file mode 100644 index 000000000..71d0bf1dd --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlpr.c @@ -0,0 +1,201 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpr.c + +Abstract: + + This module contains the test functions for lineProxyResponse + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineProxyResponse +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineProxyResponse(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineProxyResponse"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line Agent capabilities + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlsaa.c b/private/tapi/qa/trapper/itest/line20/itlsaa.c new file mode 100644 index 000000000..3c43b3d65 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlsaa.c @@ -0,0 +1,198 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgaal.c + +Abstract: + + This module contains the test functions for lineSetAgentActivity + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineSetAgentActivity +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAgentActivity(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetAgentActivity"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentActivity unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTACTIVITY; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Set the line device capabilities + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwActivityID = 1; + + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentActivity Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentActivity Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlsag.c b/private/tapi/qa/trapper/itest/line20/itlsag.c new file mode 100644 index 000000000..e9f5adda9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlsag.c @@ -0,0 +1,201 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsag.c + +Abstract: + + This module contains the test functions for lineSetAgentGroup + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineSetAgentGroup +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAgentGroup(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetAgentGroup"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentGroup unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTGROUP; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Set the line device capabilities + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentGroup Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentGroup Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/itlsas.c b/private/tapi/qa/trapper/itest/line20/itlsas.c new file mode 100644 index 000000000..2c1a92c19 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/itlsas.c @@ -0,0 +1,200 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsas.c + +Abstract: + + This module contains the test functions for lineSetAgentState + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineSetAgentState +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAgentState(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetAgentState"); + + // Initialize a line app + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Set the line device capabilities + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + if (! DoLineSetAgentState(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentState Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetAgentState Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/line20/line20.c b/private/tapi/qa/trapper/itest/line20/line20.c new file mode 100644 index 000000000..09fd45744 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/line20.c @@ -0,0 +1,310 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + line20.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "line20.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghline20Dll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +line20DllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghline20Dll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineAgentSpecific(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentCaps(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentActivityList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentGroupList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentStatus(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineProxyMessage(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineProxyResponse(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAgentActivity(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAgentGroup(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAgentState(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineInitializeEx(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineGetMessage(TRUE, FALSE)); +} + + + + +BOOL +ShouldTapiPhoneTestAbort(BOOL fQuiteMode) +{ + return FALSE; +} diff --git a/private/tapi/qa/trapper/itest/line20/line20.def b/private/tapi/qa/trapper/itest/line20/line20.def new file mode 100644 index 000000000..50af093a7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/line20.def @@ -0,0 +1,22 @@ +LIBRARY line20 + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 diff --git a/private/tapi/qa/trapper/itest/line20/line20.h b/private/tapi/qa/trapper/itest/line20/line20.h new file mode 100644 index 000000000..52cd3f078 --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/line20.h @@ -0,0 +1,248 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + line20.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 29-Jan-1996 + +Revision History: + +--*/ + + +#ifndef LINE20_H +#define LINE20_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineAgentSpecific( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentActivityList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentGroupList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentStatus( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineProxyMessage( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineProxyResponse( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineSetAgentActivity( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAgentGroup( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAgentState( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineInitializeEx( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineGetMessage( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ); + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ); + + + +#endif // LINE20_H diff --git a/private/tapi/qa/trapper/itest/line20/line20.rc b/private/tapi/qa/trapper/itest/line20/line20.rc new file mode 100644 index 000000000..b2bfef31b --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/line20.rc @@ -0,0 +1,13 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI Line2.0 API test Library" +#define VER_INTERNALNAME_STR "line20.dll" +#define VER_ORIGINALFILENAME_STR "line20.dll" + +#include "common.ver" + + + diff --git a/private/tapi/qa/trapper/itest/line20/makefile b/private/tapi/qa/trapper/itest/line20/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/line20/sources b/private/tapi/qa/trapper/itest/line20/sources new file mode 100644 index 000000000..23118425b --- /dev/null +++ b/private/tapi/qa/trapper/itest/line20/sources @@ -0,0 +1,70 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=line20 +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x69000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES=line20.c \ + itlas.c \ + itlgac.c \ + itlgaal.c \ + itlgagl.c \ + itlgas.c \ + itlpm.c \ + itlpr.c \ + itlsaa.c \ + itlsag.c \ + itlsas.c \ + itlie.c \ + itlgm.c \ + line20.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=line20DllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/phone/itpc.c b/private/tapi/qa/trapper/itest/phone/itpc.c new file mode 100644 index 000000000..54c679e2f --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpc.c @@ -0,0 +1,140 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpc.c + +Abstract: + + This module contains the test functions for phoneClose + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneClose +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneClose(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneClose"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneClose for go/no-go "); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneClose Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneClose Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpcd.c b/private/tapi/qa/trapper/itest/phone/itpcd.c new file mode 100644 index 000000000..d6f068a91 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpcd.c @@ -0,0 +1,120 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpcd.c + +Abstract: + + This module contains the test functions for phoneConfigDialog + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + +#define DLG_TITLE_ESP "TUISPI_phoneConfigDialog" + + +// phoneConfigDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneConfigDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test phoneConfigDialog"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneConfigDialog for go/no-go"); + + strcpy(szTitle, DLG_TITLE_ESP); + PrepareToAutoDismissDlg(TRUE); + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneConfigDialog Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneConfigDialog Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpds.c b/private/tapi/qa/trapper/itest/phone/itpds.c new file mode 100644 index 000000000..3cacdb5de --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpds.c @@ -0,0 +1,152 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpds.c + +Abstract: + + This module contains the test functions for phoneDevSpecific + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneDevSpecific +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneDevSpecific(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + PHONEBUTTONINFO TapiTestPhoneButtonInfo; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneDevSpecific"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneDevSpecfic for go/no-go"); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&TapiTestPhoneButtonInfo; + lpTapiPhoneTestInfo->dwSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneDevSpecific Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneDevSpecific Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgbi.c b/private/tapi/qa/trapper/itest/phone/itpgbi.c new file mode 100644 index 000000000..4b09e0f5c --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgbi.c @@ -0,0 +1,165 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgbi.c + +Abstract: + + This module contains the test functions for phoneGetButtonInfo + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + +// phoneGetButtonInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetButtonInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetButtonInfo"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetButtonInfo for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwButtonLampID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwNeededSize = %lx", + lpTapiPhoneTestInfo->lpButtonInfo->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwButtonMode = %lx", lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode); + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetButtonInfo Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetButtonInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgd.c b/private/tapi/qa/trapper/itest/phone/itpgd.c new file mode 100644 index 000000000..fdddbefbd --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgd.c @@ -0,0 +1,152 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgd.c + +Abstract: + + This module contains the test functions for phoneGetData + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + +// phoneGetData +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetData(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetData"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetData for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwDataID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetData Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetData Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgdc.c b/private/tapi/qa/trapper/itest/phone/itpgdc.c new file mode 100644 index 000000000..1f738f4a0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgdc.c @@ -0,0 +1,141 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgdc.c + +Abstract: + + This module contains the test functions for phoneGetDevCaps + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetDevCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetDevCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetDevCaps"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetDevCaps for go/no-go "); + + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetDevCaps Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetDevCaps Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgdp.c b/private/tapi/qa/trapper/itest/phone/itpgdp.c new file mode 100644 index 000000000..e10134936 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgdp.c @@ -0,0 +1,159 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgdp.c + +Abstract: + + This module contains the test functions for phoneGetDiaplay + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + +// phoneGetDisplay +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetDisplay(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwNumRows, dwNumColumns; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetDisplay"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetDisplay for go/no-go for OWNER"); + + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumRows = %lx, dwNumColumns = %lx", dwNumRows, dwNumColumns); + + lpTapiPhoneTestInfo->lpDisplay = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING); + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetDisplay Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetDisplay Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgg.c b/private/tapi/qa/trapper/itest/phone/itpgg.c new file mode 100644 index 000000000..19055b9c5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgg.c @@ -0,0 +1,151 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgg.c + +Abstract: + + This module contains the test functions for phoneGetGain + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetGain +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetGain(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetGain"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetGain for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwGain = x%lx", lpTapiPhoneTestInfo->dwGain); + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetGain Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetGain Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpghs.c b/private/tapi/qa/trapper/itest/phone/itpghs.c new file mode 100644 index 000000000..3e5c6115d --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpghs.c @@ -0,0 +1,154 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpghs.c + +Abstract: + + This module contains the test functions for phoneGetHookSwitch + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + + +// phoneGetHookSwitch +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetHookSwitch(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetHookSwitch"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetHookSwitch for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwHookSwitchMode = %lx", lpTapiPhoneTestInfo->dwHookSwitchMode); + + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetHookSwitch Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetHookSwitch Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgi.c b/private/tapi/qa/trapper/itest/phone/itpgi.c new file mode 100644 index 000000000..eb34e8bf1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgi.c @@ -0,0 +1,148 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgi.c + +Abstract: + + This module contains the test functions for phoneGetIcon + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + + +// phoneGetIcon +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetIcon(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetIcon"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetIcon for go/no-go"); + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetIcon Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetIcon Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgid.c b/private/tapi/qa/trapper/itest/phone/itpgid.c new file mode 100644 index 000000000..bb5f4e8fe --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgid.c @@ -0,0 +1,152 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgid.c + +Abstract: + + This module contains the test functions for phoneGetID + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetID +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetID(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetID"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; + lpTapiPhoneTestInfo->lpDeviceID = &(lpTapiPhoneTestInfo->DeviceID); + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetID for go/no-go"); + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### passedSize = %lx, dwNeededSize = %lx", + sizeof(lpTapiPhoneTestInfo->DeviceID), lpTapiPhoneTestInfo->lpDeviceID->dwNeededSize); + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetID Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetID Test Failed"); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgl.c b/private/tapi/qa/trapper/itest/phone/itpgl.c new file mode 100644 index 000000000..0a85387fd --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgl.c @@ -0,0 +1,155 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgl.c + +Abstract: + + This module contains the test functions for phoneGetLamp + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetLamp +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetLamp(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetLamp"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetLamp for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwButtonLampID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwLampMode = %lx", lpTapiPhoneTestInfo->dwLampMode); + + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetLamp Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetLamp Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgm.c b/private/tapi/qa/trapper/itest/phone/itpgm.c new file mode 100644 index 000000000..731bf0949 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgm.c @@ -0,0 +1,151 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgm.c + +Abstract: + + This module contains the test functions for phoneGetMessage + +Author: + + Xiao Ying Ding (XiaoD) 7-March-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetMessage +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetMessage(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetMessage"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetMessage for go/no-go "); + + // InitializeEx a phone app + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = +// PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + PHONEINITIALIZEEXOPTION_USEEVENT; + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, TAPISUCCESS, FALSE)) + { + TPHONE_FAIL(); + } + + WaitForAllMessages(); + + lpTapiPhoneTestInfo->lpMessage = (LPPHONEMESSAGE) AllocFromTestHeap ( + sizeof(PHONEMESSAGE)); + if(! DoPhoneGetMessage (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: hDevice = %lx, dwMessageID = %lx, dwCallbackInst = %lx", + lpTapiPhoneTestInfo->lpMessage->hDevice, + lpTapiPhoneTestInfo->lpMessage->dwMessageID, + lpTapiPhoneTestInfo->lpMessage->dwCallbackInstance); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: dwParam1 = %lx, dwParam2 = %lx, dwParam3 = %lx", + lpTapiPhoneTestInfo->lpMessage->dwParam1, + lpTapiPhoneTestInfo->lpMessage->dwParam2, + lpTapiPhoneTestInfo->lpMessage->dwParam3); + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetMessage Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetMessage Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgr.c b/private/tapi/qa/trapper/itest/phone/itpgr.c new file mode 100644 index 000000000..8a03e3640 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgr.c @@ -0,0 +1,158 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgr.c + +Abstract: + + This module contains the test functions for phoneGetRing + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetRing +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetRing(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwVolume; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetRing"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetRing for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwRingMode = %lx", lpTapiPhoneTestInfo->dwRingMode); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwVolume = %lx", lpTapiPhoneTestInfo->dwVolume); + + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetRing Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetRing Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgs.c b/private/tapi/qa/trapper/itest/phone/itpgs.c new file mode 100644 index 000000000..b3aa39569 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgs.c @@ -0,0 +1,155 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgs.c + +Abstract: + + This module contains the test functions for phoneGetStatus + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetStatus"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetStatus for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS); + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpPhoneStatus->dwNeededSize = %lx", lpTapiPhoneTestInfo->lpPhoneStatus->dwNeededSize); + + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetStatus Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetStatus Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgsm.c b/private/tapi/qa/trapper/itest/phone/itpgsm.c new file mode 100644 index 000000000..ad03c3340 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgsm.c @@ -0,0 +1,162 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgsm.c + +Abstract: + + This module contains the test functions for phoneGetStatusMessages + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetStatusMessages +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetStatusMessages(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetStatusMessages"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetStatusMessages for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->lpdwPhoneStates = &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = &(lpTapiPhoneTestInfo->dwButtonStates); + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwPhoneStates = %lx", lpTapiPhoneTestInfo->dwPhoneStates); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwButtonMode = %lx", lpTapiPhoneTestInfo->dwButtonModes); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwButtonStates = %lx", lpTapiPhoneTestInfo->dwButtonStates); + + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetStatusMessage Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetStatusMessage Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpgv.c b/private/tapi/qa/trapper/itest/phone/itpgv.c new file mode 100644 index 000000000..2a74d786b --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpgv.c @@ -0,0 +1,151 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgv.c + +Abstract: + + This module contains the test functions for phoneGetVolume + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetVolume +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetVolume(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetVolume"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetVolume for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwVolume = %lx", lpTapiPhoneTestInfo->dwVolume); + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetVolume Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetVolume Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpi.c b/private/tapi/qa/trapper/itest/phone/itpi.c new file mode 100644 index 000000000..509e04275 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpi.c @@ -0,0 +1,94 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpi.c + +Abstract: + + This module contains the test functions for phoneInitialize + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneInitialize +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneInitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneInitialize"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneInitialize for go/no-go "); + + // Initialize a phone app + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitialize Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitialize Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpie.c b/private/tapi/qa/trapper/itest/phone/itpie.c new file mode 100644 index 000000000..f6e199283 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpie.c @@ -0,0 +1,105 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpie.c + +Abstract: + + This module contains the test functions for phoneInitializeEx + +Author: + + Xiao Ying Ding (XiaoD) 7-March-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneInitializeEx +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneInitializeEx(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneInitializeEx"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneInitializeEx for go/no-go "); + + // InitializeEx a phone app + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitializeEx Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitializeEx Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpnav.c b/private/tapi/qa/trapper/itest/phone/itpnav.c new file mode 100644 index 000000000..b6032cafd --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpnav.c @@ -0,0 +1,116 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpnav.c + +Abstract: + + This module contains the test functions for phoneNegotiateAPIVersion + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneNegotiateAPIVersion +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneNegotiateAPIVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneNegotiateAPIVersion"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneNegotiateAPIVersion for go/no-go"); + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneNegotiaAPIVersion Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneNegotiaAPIVersion Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpne.c b/private/tapi/qa/trapper/itest/phone/itpne.c new file mode 100644 index 000000000..a97b77c52 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpne.c @@ -0,0 +1,138 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpnev.c + +Abstract: + + This module contains the test functions for phoneNegotiateExtVersion + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneNegotiateExtVersion +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneNegotiateExtVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneNegotiateExtVersion"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneNegotiateExtVersion for go/no-go for OWNER"); + + + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwExtVersion = %lx", lpTapiPhoneTestInfo->dwExtVersion); + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneNegotiateExtVersion Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneNegotiateExtVersion Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpo.c b/private/tapi/qa/trapper/itest/phone/itpo.c new file mode 100644 index 000000000..74fb0f07b --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpo.c @@ -0,0 +1,140 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpo.c + +Abstract: + + This module contains the test functions for phoneOpen + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneOpen +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneOpen(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneOpen"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneOpen for go/no-go"); + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneOpen Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneOpen Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itps.c b/private/tapi/qa/trapper/itest/phone/itps.c new file mode 100644 index 000000000..b82c69fd0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itps.c @@ -0,0 +1,105 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itps.c + +Abstract: + + This module contains the test functions for phoneShutdown + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-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 "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneShutdown +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneShutdown(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneShutdown"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneShutdown for go/no-go"); + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + FreeTestHeap(); + + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneShutdown Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneShutDown Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsbi.c b/private/tapi/qa/trapper/itest/phone/itpsbi.c new file mode 100644 index 000000000..72386427f --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsbi.c @@ -0,0 +1,187 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsbi.c + +Abstract: + + This module contains the test functions for phoneSetButtonInfo + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetButtonInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetButtonInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetButtonInfo"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetButtonInfo for go/no-go for OWNER"); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### The dwNumButtonLamps = %lx", + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps); + + + lpTapiPhoneTestInfo->dwButtonLampID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); +// lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + + // Do set all field in ButtonInfo here + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetButtonInfo for verify"); + + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwNeededSize = %lx", + lpTapiPhoneTestInfo->lpButtonInfo->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwButtonMode = %lx", lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode); + + + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetButtonInfo Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetButtonInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsd.c b/private/tapi/qa/trapper/itest/phone/itpsd.c new file mode 100644 index 000000000..90e7ffc5f --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsd.c @@ -0,0 +1,176 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsd.c + +Abstract: + + This module contains the test functions for phoneSetData + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetData +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetData(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwData; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetData"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetData for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwDataID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + dwData = 0x5; + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwDataID = %lx ", lpTapiPhoneTestInfo->dwDataID); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpdwData = %lx, dwData = %lx", lpTapiPhoneTestInfo->lpData, dwData); + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetData for verify"); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDataID = %lx, lpData = %lx, dwData = %lx", lpTapiPhoneTestInfo->dwDataID, + lpTapiPhoneTestInfo->lpData, dwData); + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetData Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetData Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsdp.c b/private/tapi/qa/trapper/itest/phone/itpsdp.c new file mode 100644 index 000000000..9ae5fe9b9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsdp.c @@ -0,0 +1,188 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsdp.c + +Abstract: + + This module contains the test functions for phoneSetDiaplay + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetDisplay +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetDisplay(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwNumRows, dwNumColumns; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetDisplay"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetDisplay for go/no-go for OWNER"); + + dwNumRows = 1; + lpTapiPhoneTestInfo->dwRow = 0; + dwNumColumns = lpTapiPhoneTestInfo->dwColumn = 10; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + sizeof(dwNumRows*dwNumColumns)); + lpTapiPhoneTestInfo->lpsDisplay = "this is a test"; + lpTapiPhoneTestInfo->dwSize = sizeof(lpTapiPhoneTestInfo->lpsDisplay); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwRow = %lx, dwColumn = %lx, dwSize = %lx", + dwNumRows, dwNumColumns, lpTapiPhoneTestInfo->dwSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpsDisplay = %s", lpTapiPhoneTestInfo->lpsDisplay); + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetDisplay for verify"); + + lpTapiPhoneTestInfo->lpDisplay = (LPVARSTRING)AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpDisplay->dwTotalSize = %lx, neededSize = %lx", + (DWORD) lpTapiPhoneTestInfo->lpDisplay->dwTotalSize, + lpTapiPhoneTestInfo->lpDisplay->dwNeededSize); + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpDisplay->dwTotalSize = %lx, neededSize = %lx", + (DWORD) lpTapiPhoneTestInfo->lpDisplay->dwTotalSize, + lpTapiPhoneTestInfo->lpDisplay->dwNeededSize); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetDisplay Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetDisplay Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsg.c b/private/tapi/qa/trapper/itest/phone/itpsg.c new file mode 100644 index 000000000..3d0543c05 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsg.c @@ -0,0 +1,162 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsg.c + +Abstract: + + This module contains the test functions for phoneSetGain + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetGain +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetGain(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetGain"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetGain for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + + if (! DoPhoneSetGain(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetGain for verify"); + + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwGain = x%lx", lpTapiPhoneTestInfo->dwGain); + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetGain Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetGain Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpshs.c b/private/tapi/qa/trapper/itest/phone/itpshs.c new file mode 100644 index 000000000..a6cf17490 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpshs.c @@ -0,0 +1,170 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpshs.c + +Abstract: + + This module contains the test functions for phoneSetHookSwitch + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetHookSwitch +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetHookSwitch(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetHookSwitch"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetHookSwitch for go/no-go for OWNER"); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + if (! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetHookSwitch for verify"); + + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwHookSwitchDevs = %lx", lpTapiPhoneTestInfo->dwHookSwitchDevs); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwHookSwitchMode = %lx", lpTapiPhoneTestInfo->dwHookSwitchMode); + + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetHookSwitch Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetHookSwitch Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsl.c b/private/tapi/qa/trapper/itest/phone/itpsl.c new file mode 100644 index 000000000..0535fdd5b --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsl.c @@ -0,0 +1,166 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsl.c + +Abstract: + + This module contains the test functions for phoneSetLamp + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetLamp +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetLamp(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetLamp"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetLamp for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwButtonLampID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetLamp for verify"); + + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwLampMode = %lx", lpTapiPhoneTestInfo->dwLampMode); + + + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetLamp Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetLamp Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsr.c b/private/tapi/qa/trapper/itest/phone/itpsr.c new file mode 100644 index 000000000..501d66318 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsr.c @@ -0,0 +1,170 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsr.c + +Abstract: + + This module contains the test functions for phoneSetRing + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetRing +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetRing(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetRing"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetRing for go/no-go for OWNER"); + + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + if (! DoPhoneSetRing(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetRing for verify"); + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwRingMode = %lx", lpTapiPhoneTestInfo->dwRingMode); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwVolume = %lx", lpTapiPhoneTestInfo->dwVolume); + + + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetRing Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetRing Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpssm.c b/private/tapi/qa/trapper/itest/phone/itpssm.c new file mode 100644 index 000000000..2d581567a --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpssm.c @@ -0,0 +1,174 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpssm.c + +Abstract: + + This module contains the test functions for phoneSetStatusMessages + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetStatusMessages +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetStatusMessages(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetStatusMessages"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetStatusMessages for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->lpdwPhoneStates = &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetStatusMessages for verify"); + + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwPhoneStates = %lx", lpTapiPhoneTestInfo->dwPhoneStates); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwButtonMode = %lx", lpTapiPhoneTestInfo->dwButtonModes); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwButtonStates = %lx", lpTapiPhoneTestInfo->dwButtonStates); + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetStatusMessage Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetStatusMessage Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/itpsv.c b/private/tapi/qa/trapper/itest/phone/itpsv.c new file mode 100644 index 000000000..d7e164c74 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/itpsv.c @@ -0,0 +1,167 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsv.c + +Abstract: + + This module contains the test functions for phoneSetVolume + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetVolume +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetVolume(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetVolume"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetVolume for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + if (! DoPhoneSetVolume(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetVolume for verify"); + + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwHookSwitchDev = %lx", lpTapiPhoneTestInfo->dwHookSwitchDev); + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwVolume = %lx", lpTapiPhoneTestInfo->dwVolume); + + + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetVolume Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetVolume Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/phone/makefile b/private/tapi/qa/trapper/itest/phone/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/phone/sources b/private/tapi/qa/trapper/itest/phone/sources new file mode 100644 index 000000000..944660795 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/sources @@ -0,0 +1,91 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tphone +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x60000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES=tphone.c \ + itpcd.c \ + itpds.c \ + itpgbi.c \ + itpgd.c \ + itpgdp.c \ + itpgg.c \ + itpghs.c \ + itpgi.c \ + itpgid.c \ + itpgl.c \ + itpgr.c \ + itpgs.c \ + itpgsm.c \ + itpgv.c \ + itpsbi.c \ + itpsd.c \ + itpsdp.c \ + itpsg.c \ + itpshs.c \ + itpsl.c \ + itpsr.c \ + itpssm.c \ + itpsv.c \ + itpne.c \ + itpc.c \ + itpgdc.c \ + itpi.c \ + itpnav.c \ + itpo.c \ + itps.c \ + itpie.c \ + itpgm.c \ + tphone.rc + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=TphoneDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/phone/tphone.c b/private/tapi/qa/trapper/itest/phone/tphone.c new file mode 100644 index 000000000..1c5dd0e75 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/tphone.c @@ -0,0 +1,491 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + tphone.c + +Abstract: + + This module contains functions for testing Telephony phone device APIs. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "tphone.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTphoneDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TphoneDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTphoneDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + + +BOOL +Test1( + HINSTANCE hAppInst + ) +{ + return (TestPhoneConfigDialog(TRUE, TRUE)); +} + + +BOOL +Test2( + HINSTANCE hAppInst + ) +{ + return (TestPhoneDevSpecific(TRUE, TRUE)); +} + + +BOOL +Test3( + HINSTANCE hAppInst + ) +{ + return (TestPhoneNegotiateExtVersion(TRUE, TRUE)); +} + + +BOOL +Test4( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetIcon(TRUE, TRUE)); +} + + +BOOL +Test5( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetID(TRUE, TRUE)); +} + + + +BOOL +Test6( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetStatus(TRUE, TRUE)); +} + + +BOOL +Test7( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetButtonInfo(TRUE, TRUE)); +} + + +BOOL +Test8( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetButtonInfo(TRUE, TRUE)); +} + + +BOOL +Test9( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetData(TRUE, TRUE)); +} + +BOOL +Test10( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetData(TRUE, TRUE)); +} + + +BOOL +Test11( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetDisplay(TRUE, TRUE)); +} + + +BOOL +Test12( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetDisplay(TRUE, TRUE)); +} + + +BOOL +Test13( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetGain(TRUE, TRUE)); +} + + +BOOL +Test14( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetGain(TRUE, TRUE)); +} + + +BOOL +Test15( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetHookSwitch(TRUE, TRUE)); +} + + + +BOOL +Test16( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetHookSwitch(TRUE, TRUE)); +} + + + +BOOL +Test17( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetLamp(TRUE, TRUE)); +} + + + +BOOL +Test18( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetLamp(TRUE, TRUE)); +} + + + + + +BOOL +Test19( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetRing(TRUE, TRUE)); +} + + +BOOL +Test20( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetRing(TRUE, TRUE)); +} + + + + + + +BOOL +Test21( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetStatusMessages(TRUE, TRUE)); +} + + +BOOL +Test22( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetStatusMessages(TRUE, TRUE)); +} + + + + +BOOL +Test23( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetVolume(TRUE, TRUE)); +} + + +BOOL +Test24( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetVolume(TRUE, TRUE)); +} + + +BOOL +Test25( + HINSTANCE hAppInst + ) +{ + return (TestPhoneClose(TRUE, TRUE)); +} + + +BOOL +Test26( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetDevCaps(TRUE, TRUE)); +} + +BOOL +Test27( + HINSTANCE hAppInst + ) +{ + return (TestPhoneInitialize(TRUE, TRUE)); +} + +BOOL +Test28( + HINSTANCE hAppInst + ) +{ + return (TestPhoneNegotiateAPIVersion(TRUE, TRUE)); +} + +BOOL +Test29( + HINSTANCE hAppInst + ) +{ + return (TestPhoneOpen(TRUE, TRUE)); +} + +BOOL +Test30( + HINSTANCE hAppInst + ) +{ + return (TestPhoneShutdown(TRUE, TRUE)); +} + + + +BOOL +WINAPI +Test31( + HINSTANCE hAppInst + ) +{ + return (TestPhoneInitializeEx(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test32( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetMessage(TRUE, FALSE)); +} + + + + + +BOOL +ShouldTapiPhoneTestAbort(BOOL fQuiteMode) +{ + return FALSE; +} diff --git a/private/tapi/qa/trapper/itest/phone/tphone.def b/private/tapi/qa/trapper/itest/phone/tphone.def new file mode 100644 index 000000000..0f2f4208c --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/tphone.def @@ -0,0 +1,42 @@ +LIBRARY tphone + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 + Test16 + Test17 + Test18 + Test19 + Test20 + Test21 + Test22 + Test23 + Test24 + Test25 + Test26 + Test27 + Test28 + Test29 + Test30 + Test31 + Test32 diff --git a/private/tapi/qa/trapper/itest/phone/tphone.h b/private/tapi/qa/trapper/itest/phone/tphone.h new file mode 100644 index 000000000..a72225f5e --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/tphone.h @@ -0,0 +1,293 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + tphone.h + +Abstract: + + This module contains prototypes for testing TAPI phone device functions. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef TPHONE_H +#define TPHONE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +// Macro for handling failures +#define TPHONE_FAIL() { \ + if (ShouldTapiPhoneTestAbort(fQuietMode)) \ + { \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp1); \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp2); \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +ShouldTapiPhoneTestAbort( + BOOL fQuiteMode + ); + + +BOOL +TestPhoneConfigDialog( + BOOL fQuiteMode, + BOOL fStandAlong + ); + + +BOOL +TestPhoneDevSpecific( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetButtonInfo( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetData( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetDisplay( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetGain( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetHookSwitch( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetIcon( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetID( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetLamp( + BOOL fQuiteMode, + BOOL fStandAlong + ); + + +BOOL +TestPhoneGetRing( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetStatus( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetStatusMessages( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneGetVolume( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneNegotiateExtVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetButtonInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneSetData( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneSetDisplay( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetGain( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetHookSwitch( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetLamp( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetRing( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneSetStatusMessages( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetVolume( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneClose( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneGetDevCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneInitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneNegotiateAPIVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneOpen( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneShutdown( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneInitializeEx( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneGetMessage( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + + + +#endif // TPHONE_H + diff --git a/private/tapi/qa/trapper/itest/phone/tphone.rc b/private/tapi/qa/trapper/itest/phone/tphone.rc new file mode 100644 index 000000000..13ed29149 --- /dev/null +++ b/private/tapi/qa/trapper/itest/phone/tphone.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI Phone API test Library" +#define VER_INTERNALNAME_STR "tphone.dll" +#define VER_ORIGINALFILENAME_STR "tphone.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/sline/itlgad.c b/private/tapi/qa/trapper/itest/sline/itlgad.c new file mode 100644 index 000000000..5b904bd8b --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlgad.c @@ -0,0 +1,183 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgat.c + +Abstract: + + This module contains the test functions for lineGatherDigits + +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" + + +#define PULSESIZE 16 +#define DTMFSIZE 16 + + +// lineGatherDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGatherDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGatherDigits"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); + lpTapiLineTestInfo->dwNumDigits = 2; + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGatherDigits Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGatherDigits Test Failed"); + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/sline/itlgap.c b/private/tapi/qa/trapper/itest/sline/itlgap.c new file mode 100644 index 000000000..da81184df --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlgap.c @@ -0,0 +1,158 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgap.c + +Abstract: + + This module contains the test functions for lineGetAppPriority + +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" + + + +// lineGetAppPriority +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAppPriority(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwPrioritySav; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAppPriority"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetAppPriority for go/no-go"); + + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + dwPrioritySav = *lpTapiLineTestInfo->lpdwPriority; + lpTapiLineTestInfo->dwPriority = !dwPrioritySav; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetAppPriority Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetAppPriority Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlmod.c b/private/tapi/qa/trapper/itest/sline/itlmod.c new file mode 100644 index 000000000..33b6cf47d --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlmod.c @@ -0,0 +1,170 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmod.c + +Abstract: + + This module contains the test functions for lineMonitorDigits + +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" + + + + +// lineMonitorDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineMonitorDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineMonitorDigits"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineMonitorDigits Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineMonitorDigits Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlmom.c b/private/tapi/qa/trapper/itest/sline/itlmom.c new file mode 100644 index 000000000..ff54dbec9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlmom.c @@ -0,0 +1,171 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmom.c + +Abstract: + + This module contains the test functions for lineMonitorMedia + +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" + + + + +// lineMonitorMedia +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineMonitorMedia(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineMonitorMedia"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_TELETEX; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorMedia(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorMedia(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineMonitorMedia Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineMonitorMedia Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlmot.c b/private/tapi/qa/trapper/itest/sline/itlmot.c new file mode 100644 index 000000000..606f980a3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlmot.c @@ -0,0 +1,171 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmot.c + +Abstract: + + This module contains the test functions for lineMonitorTones + +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" + + + + +// lineMonitorTones +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineMonitorTones(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineMonitorTones"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + lpTapiLineTestInfo->dwNumEntries = 1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorTones(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorTones(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineMonitorTones Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineMonitorTones Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlpak.c b/private/tapi/qa/trapper/itest/sline/itlpak.c new file mode 100644 index 000000000..a75ad10c0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlpak.c @@ -0,0 +1,176 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpk.c + +Abstract: + + This module contains the test functions for linePark + +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" + + + + +// linePark +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePark(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test linePark"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_DIRECTED; + lpTapiLineTestInfo->lpszDirAddress = "55555"; + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePark Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePark Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlpk.c b/private/tapi/qa/trapper/itest/sline/itlpk.c new file mode 100644 index 000000000..70589ca39 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlpk.c @@ -0,0 +1,162 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpk.c + +Abstract: + + This module contains the test functions for linePickup + +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" + + + + +// linePickup +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePickup(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test linePickup"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpszGroupID = "55555"; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePickup Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePickup Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlsap.c b/private/tapi/qa/trapper/itest/sline/itlsap.c new file mode 100644 index 000000000..611b47666 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlsap.c @@ -0,0 +1,158 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsap.c + +Abstract: + + This module contains the test functions for lineSetAppPriority + +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" + + + +// lineSetAppPriority +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAppPriority(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwPrioritySav; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetAppPriority"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetAppPriority for go/no-go"); + + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + dwPrioritySav = *lpTapiLineTestInfo->lpdwPriority; + lpTapiLineTestInfo->dwPriority = !dwPrioritySav; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetAppPriority Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetAppPriority Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlscd.c b/private/tapi/qa/trapper/itest/sline/itlscd.c new file mode 100644 index 000000000..cf9bdd5f9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlscd.c @@ -0,0 +1,201 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscd.c + +Abstract: + + This module contains the test functions for lineSetCallData + +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" + + + +// lineSetCallData +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallData(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPBYTE lpszCallData; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetCallData"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "Before: lpCallInfo->dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallDataSize, + lpTapiLineTestInfo->lpCallInfo->dwCallDataOffset + ); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetCallData for go/no-go"); + + lpszCallData = "This is a test"; + lpTapiLineTestInfo->lpCallData = (LPVOID)lpszCallData; + lpTapiLineTestInfo->dwSize = strlen(lpszCallData); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallData(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: lpCallInfo->dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallDataSize, + lpTapiLineTestInfo->lpCallInfo->dwCallDataOffset + ); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCallData Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCallData Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlscl.c b/private/tapi/qa/trapper/itest/sline/itlscl.c new file mode 100644 index 000000000..160a031af --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlscl.c @@ -0,0 +1,184 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscl.c + +Abstract: + + This module contains the test functions for lineSetCurrentLocation + +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" + + + +// lineSetCurrentLocation +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCurrentLocation(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPLINELOCATIONENTRY lpLineLocationEntry; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetCurrentLocation"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if(! DoLineNegotiateAPIVersion (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetCurrentLocation for go/no-go"); + + // Call lineGetTranslateCaps to get LocationID + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumLocations = %lx, dwCurrentLocationID = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID); + + + if(lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations <= 1) + { + lpTapiLineTestInfo->dwLocation = lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID; + } + else + { + if(lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations == + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID) + lpTapiLineTestInfo->dwLocation = + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations -1; + else + lpTapiLineTestInfo->dwLocation = + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations; + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwLocationID = %lx", + lpTapiLineTestInfo->dwLocation); + + + if(lpTapiLineTestInfo->dwLocation == 0) + { + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, LINEERR_INVALLOCATION)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + // Call lineGetTranslateCaps to verify LocationID + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumLocations = %lx, dwCurrentLocationID = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID); + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCurrentLocation Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCurrentLocation Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlscqs.c b/private/tapi/qa/trapper/itest/sline/itlscqs.c new file mode 100644 index 000000000..0df0778e4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlscqs.c @@ -0,0 +1,235 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscqs.c + +Abstract: + + This module contains the test functions for lineSetCallQualityOfService + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "winsock2.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" + + + +// lineSetCallQualityOfService +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallQualityOfService(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPFLOWSPEC lpSendingFlowspec, lpReceivingFlowspec; + LPQOS lpQos; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetCallQualityOfService"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS)NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "Before: dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecOffset + ); + TapiLogDetail( + DBUG_SHOW_DETAIL, + "Before: dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecOffset + ); + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetCallQualityOfService for go/no-go"); + + lpQos = (LPQOS) AllocFromTestHeap ( sizeof(QOS)); + lpSendingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpSendingFlowspec->LevelOfGuarantee = GuaranteedService; + lpTapiLineTestInfo->lpSendingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec); + + lpReceivingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpTapiLineTestInfo->lpReceivingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwReceivingFlowspecSize = sizeof(lpQos->ReceivingFlowspec); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + /* + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecOffset + ); + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecOffset + ); + */ + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCallQualityOfService Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCallQualityOfService Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlsct.c b/private/tapi/qa/trapper/itest/sline/itlsct.c new file mode 100644 index 000000000..5d5e74a6b --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlsct.c @@ -0,0 +1,226 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsct.c + +Abstract: + + This module contains the test functions for lineSetCallTreatment + +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" + + + +// lineSetCallTreatment +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallTreatment(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetCallTreatment"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS)NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + /* + lpTapiLineTestInfo->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + + + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEADDRESSCAPS); + + if(!DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwTreatment = (lpTapiLineTestInfo->lpLineAddressCaps->dwNumCallTreatments == 0 ? + 0 : lpTapiLineTestInfo->lpLineAddressCaps->dwNumCallTreatments - 1); + */ + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "Before: lpCallInfo->dwTreatment = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallTreatment); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetCallTreatment for go/no-go"); + + lpTapiLineTestInfo->dwTreatment = LINECALLTREATMENT_SILENCE; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: lpCallInfo->dwTreatment = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallTreatment); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCallTreatment Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetCallTreatment Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlslds.c b/private/tapi/qa/trapper/itest/sline/itlslds.c new file mode 100644 index 000000000..d69359b3f --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlslds.c @@ -0,0 +1,189 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlslds.c + +Abstract: + + This module contains the test functions for lineSetLineDevStatus + +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" + + + +// lineSetLineDevStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetLineDevStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetLineDevStatus"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before: lpLineDevStatus->dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + + // Set the line device capabilities + lpTapiLineTestInfo->dwStatusToChange = LINEDEVSTATUSFLAGS_CONNECTED; + lpTapiLineTestInfo->fStatus = TRUE; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetLineDevStatus for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After: lpLineDevStatus->dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetLineDevStatus Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetLineDevStatus Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlucc.c b/private/tapi/qa/trapper/itest/sline/itlucc.c new file mode 100644 index 000000000..ce25abf1a --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlucc.c @@ -0,0 +1,210 @@ +/*++ + +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; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineUncompleteCall"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + 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->dwCompletionID); + + // 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); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineUncompleteCall for go/no-go"); + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineUncompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineUncompleteCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineUncompleteCall Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/itlupak.c b/private/tapi/qa/trapper/itest/sline/itlupak.c new file mode 100644 index 000000000..f55fcdb10 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/itlupak.c @@ -0,0 +1,166 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlupak.c + +Abstract: + + This module contains the test functions for lineUnpark + +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" + + + + +// lineUnpark +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineUnpark(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineUnpark"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineUnpark for go/no-go"); + + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpszDestAddress = "55555"; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineUnpark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineUnpark Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineUnpark Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/sline/makefile b/private/tapi/qa/trapper/itest/sline/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/sline/sline.c b/private/tapi/qa/trapper/itest/sline/sline.c new file mode 100644 index 000000000..c62ccd4a2 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/sline.c @@ -0,0 +1,337 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + sline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "sline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghSLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +SLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghSLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineGatherDigits(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineMonitorDigits(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineMonitorMedia(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineMonitorTones(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLinePark(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineUnpark(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLinePickup(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineUncompleteCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAppPriority(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAppPriority(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCurrentLocation(TRUE, FALSE)); +} + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallData(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallQualityOfService(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallTreatment(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineSetLineDevStatus(TRUE, FALSE)); +} + + + + + + diff --git a/private/tapi/qa/trapper/itest/sline/sline.def b/private/tapi/qa/trapper/itest/sline/sline.def new file mode 100644 index 000000000..8ddcc7861 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/sline.def @@ -0,0 +1,25 @@ +LIBRARY sline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 diff --git a/private/tapi/qa/trapper/itest/sline/sline.h b/private/tapi/qa/trapper/itest/sline/sline.h new file mode 100644 index 000000000..3349c574d --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/sline.h @@ -0,0 +1,294 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + sline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + +--*/ + + +#ifndef SLINE_H +#define SLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineGatherDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMonitorDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMonitorMedia( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMonitorTones( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePark( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineUnpark( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePickup( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineUncompleteCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAppPriority( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAppPriority( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCurrentLocation( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCallData( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCallQualityOfService( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCallTreatment( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetLineDevStatus( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ); + +#endif // SLINE_H diff --git a/private/tapi/qa/trapper/itest/sline/sline.rc b/private/tapi/qa/trapper/itest/sline/sline.rc new file mode 100644 index 000000000..85eca83e5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/sline.rc @@ -0,0 +1,13 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI SLine API test Library" +#define VER_INTERNALNAME_STR "sline.dll" +#define VER_ORIGINALFILENAME_STR "sline.dll" + +#include "common.ver" + + + diff --git a/private/tapi/qa/trapper/itest/sline/sources b/private/tapi/qa/trapper/itest/sline/sources new file mode 100644 index 000000000..2179e63d6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/sline/sources @@ -0,0 +1,74 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=sline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x67000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES= sline.c \ + itlgad.c \ + itlmod.c \ + itlmom.c \ + itlmot.c \ + itlpak.c \ + itlupak.c \ + itlucc.c \ + itlpk.c \ + itlgap.c \ + itlsap.c \ + itlscl.c \ + itlscd.c \ + itlscqs.c \ + itlsct.c \ + itlslds.c \ + sline.rc + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=SLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tcline/cline.c b/private/tapi/qa/trapper/itest/tcline/cline.c new file mode 100644 index 000000000..a41e57ca9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/cline.c @@ -0,0 +1,328 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + cline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 15-Jan-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "cline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTCLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TCLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTCLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninitialize(TRUE, TRUE)); +} + + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineAddToConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineGetConfRelatedCalls(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLinePrepareAddToConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineRemoveFromConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineSetupConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineCompleteCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineRedirect(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSecureCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSwapHold(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestTapiGetLocationInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestDrop(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestMakeCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestMediaCall(TRUE, FALSE)); +} + + + + diff --git a/private/tapi/qa/trapper/itest/tcline/cline.def b/private/tapi/qa/trapper/itest/tcline/cline.def new file mode 100644 index 000000000..5654240bb --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/cline.def @@ -0,0 +1,25 @@ +LIBRARY tcline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + diff --git a/private/tapi/qa/trapper/itest/tcline/cline.h b/private/tapi/qa/trapper/itest/tcline/cline.h new file mode 100644 index 000000000..10fa65067 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/cline.h @@ -0,0 +1,189 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + cline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding 15-Jan-1996 + +Revision History: + +--*/ + + +#ifndef CLINE_H +#define CLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + +BOOL +TestLineUninitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestLineAddToConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetConfRelatedCalls( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePrepareAddToConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRemoveFromConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetupConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineCompleteCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRedirect( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineSecureCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSwapHold( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestTapiGetLocationInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTapiRequestDrop( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestTapiRequestMakeCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestTapiRequestMediaCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + + +#endif // CLINE_H diff --git a/private/tapi/qa/trapper/itest/tcline/cline.rc b/private/tapi/qa/trapper/itest/tcline/cline.rc new file mode 100644 index 000000000..f6c6b8cdd --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/cline.rc @@ -0,0 +1,13 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI TCLine API test Library" +#define VER_INTERNALNAME_STR "tcline.dll" +#define VER_ORIGINALFILENAME_STR "tcline.dll" + +#include "common.ver" + + + diff --git a/private/tapi/qa/trapper/itest/tcline/dirs b/private/tapi/qa/trapper/itest/tcline/dirs new file mode 100644 index 000000000..d4281cd08 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/dirs @@ -0,0 +1,2 @@ +DIRS= tclinea\ + tclinew diff --git a/private/tapi/qa/trapper/itest/tcline/itlatc.c b/private/tapi/qa/trapper/itest/tcline/itlatc.c new file mode 100644 index 000000000..699bbb5b5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlatc.c @@ -0,0 +1,1663 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlatc.c + +Abstract: + + This module contains the test functions for lineAddToConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineAddToConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAddToConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + HCALL hConfCall = NULL, hConsultCall = NULL; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + INT i; + DWORD dwNumCalls; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineAddToConference <<<<<<<<" + ); + + // Initialize a line app + 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; + + 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 hConfCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + +// lpTapiLineTestInfo->lphCall = NULL; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphConfCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphConfCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphConfCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hConfCall = hConsultCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphConfCall); + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConsultCall1; + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCONFCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphConfCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hConsultCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphConsultCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphConsultCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphConsultCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hConsultCall = hConfCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphConsultCall); + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConfCall1; + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphConsultCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no owner for hConfCall", dwTestCase + 1 + ); + +/* + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEEVENT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE) AllocFromTestHeap ( + sizeof(LINEMESSAGE)); + + for(i=0; i<10; i++) + { + if(! DoLineGetMessage (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(lpTapiLineTestInfo->lpMessage->dwMessageID == LINE_CALLSTATE) + { + if(lpTapiLineTestInfo->lpMessage->dwParam1 == LINECALLSTATE_ONHOLDPENDCONF && + lpTapiLineTestInfo->lpMessage->hDevice != (DWORD)(*lpTapiLineTestInfo->lphConfCall)) + hConfCall = (HCALL)lpTapiLineTestInfo->lpMessage->hDevice; + if(lpTapiLineTestInfo->lpMessage->dwParam1 == LINECALLSTATE_DIALTONE && + lpTapiLineTestInfo->lpMessage->hDevice != (DWORD)(*lpTapiLineTestInfo->lphConsultCall)) + hConsultCall = (HCALL)lpTapiLineTestInfo->lpMessage->hDevice; + if(hConfCall != 0 && hConsultCall != 0) + { + fTestPassed = TRUE; + break; + } + } + } + + if(hConfCall != 0 && hConsultCall != 0) + fTestPassed = TRUE; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##hConfCall = %lx, hConsCall = %lx", + hConfCall, hConsultCall); + + lpTapiLineTestInfo->lphConfCall = &hConfCall; + lpTapiLineTestInfo->lphConsultCall = &hConsultCall; + + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### Before Add: lpCallList->dwCallsNumEntries = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries); + + dwNumCalls = lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### After Add: lpCallList->dwCallsNumEntries = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries); + + if(lpTapiLineTestInfo->lpCallList->dwCallsNumEntries > + dwNumCalls) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Re-add hConsultCall to conference", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLSTATE, TRUE)) + { + TLINE_FAIL(); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Add hCall (same hLineApp, hLine, id) not get from SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, 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: Add hCall (same hLineApp, diff hLine, same id) not get from SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Add hCall (same hLineApp, diff hLine, diff id) not get from SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->dwDeviceID = 0; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwDeviceID = 1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + +/* diff same hLine is not make sence, temp remove it, late to check + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Add hCall (diff hLineApp, same hLine, same id) not get from SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Add hCall (diff hLineApp, diff hLine, same id) not get from SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + 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->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; +// lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LMAKECALL + )) + { + TLINE_FAIL(); + } + + *lpTapiLineTestInfo->lphConsultCall = lpTapiLineTestInfo->hCall2; + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // 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: Add hCall (diff hLineApp, diff hLine, diff id) not get from SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->dwDeviceID = 0; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + 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; + lpTapiLineTestInfo->dwDeviceID = 1; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // 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: Add hConfCall (same hLineApp, hLine) get from another SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->hCall2 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphConfCall = &hConfCall; + lpTapiLineTestInfo->lphConsultCall = &hConsultCall; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + *lpTapiLineTestInfo->lphConfCall = hConfCall; + *lpTapiLineTestInfo->lphConsultCall = lpTapiLineTestInfo->hConsultCall1; + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConfCall = &hConfCall; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLSTATE, 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: Add hConsultCall (same hLineApp, same hLine) get from another SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + lpTapiLineTestInfo->hCall2 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphConfCall = &hConfCall; + lpTapiLineTestInfo->lphConsultCall = &hConsultCall; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + +// if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) +// { +// TLINE_FAIL(); +// } + + *lpTapiLineTestInfo->lphConfCall = hConfCall; + *lpTapiLineTestInfo->lphConsultCall = lpTapiLineTestInfo->hConsultCall1; + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Add hConfCall (diff hLineApp, same hLine) get from another SetupConf", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->hCall2 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphConfCall = &hConfCall; + lpTapiLineTestInfo->lphConsultCall = &hConsultCall; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + lpTapiLineTestInfo->lphConfCall = hConfCall; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp1; + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLineApp = &lpTapiLineTestInfo->hLineApp2; + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + + 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(); + } + + if ( ! DoLineAddToConference(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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_CONFERENCEFULL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineAddToConference(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, + "@@ lineAddToConference: 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 lineAddToConference <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlcc.c b/private/tapi/qa/trapper/itest/tcline/itlcc.c new file mode 100644 index 000000000..93c9cb195 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlcc.c @@ -0,0 +1,1057 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcc.c + +Abstract: + + This module contains the test functions for lineCompleteCall + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +#define ALL_CALLCOMPLMODES (LINECALLCOMPLMODE_CAMPON | \ + LINECALLCOMPLMODE_CALLBACK | \ + LINECALLCOMPLMODE_INTRUDE | \ + LINECALLCOMPLMODE_MESSAGE) + + +// lineCompleteCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineCompleteCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fEsp; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineCompleteCall <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwCompletionID ", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwCompletionID = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwCompletionMode", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + if(IsESPLineDevice(lpTapiLineTestInfo)) + fEsp = TRUE; + else + fEsp = FALSE; + + + if(fEsp) + { + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineCompleteCall, + (LPDWORD) &lpTapiLineTestInfo->dwCompletionMode, + LINEERR_INVALCALLCOMPLMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_CALLCOMPLMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + } + else + { + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineCompleteCall, + (LPDWORD) &lpTapiLineTestInfo->dwCompletionMode, + LINEERR_OPERATIONUNAVAIL, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_CALLCOMPLMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamest for dwCompletionMode", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + if(IsESPLineDevice(lpTapiLineTestInfo)) + fEsp = TRUE; + else + fEsp = FALSE; + + if(fEsp) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineCompleteCall, + (LPDWORD) &lpTapiLineTestInfo->dwCompletionMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_CALLCOMPLMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, +// 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, dwMessageID, 0", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_MESSAGE; + lpTapiLineTestInfo->dwMessageID = 0x0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineCompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineCompleteCall(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: Success, dwMessageID, dwNumMessags - 1", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_MESSAGE; + lpTapiLineTestInfo->dwMessageID = + lpTapiLineTestInfo->lpLineAddressCaps->dwNumCompletionMessages - 1; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineCompleteCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineCompleteCall(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 dwMessageID, dwNumMessags", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_MESSAGE; + lpTapiLineTestInfo->dwMessageID = + lpTapiLineTestInfo->lpLineAddressCaps->dwNumCompletionMessages; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if ( DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_INVALMESSAGEID, FALSE)) + { + TLINE_FAIL(); + } + AddMessage( + LINE_REPLY, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + LINEERR_INVALMESSAGEID, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineCompleteCall(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 dwMessageID, -1", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_MESSAGE; + lpTapiLineTestInfo->dwMessageID = 0xffffffff; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if ( DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_INVALMESSAGEID, TRUE)) + { + TLINE_FAIL(); + } + AddMessage( + LINE_REPLY, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + LINEERR_INVALMESSAGEID, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineCompleteCall(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: Success", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#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->dwCompletionID); + + // 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); + + 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->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_CALLBACK; + lpTapiLineTestInfo->dwMessageID = 0; + + if ( ! DoLineCompleteCall(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpdwCompletionID = &lpTapiLineTestInfo->dwCompletionID; + lpTapiLineTestInfo->dwCompletionMode = LINECALLCOMPLMODE_CALLBACK; + lpTapiLineTestInfo->dwMessageID = 0; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineCompleteCall(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, + "@@ lineCompleteCall: 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 lineCompleteCall <<<<<<<<" + ); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlgcrc.c b/private/tapi/qa/trapper/itest/tcline/itlgcrc.c new file mode 100644 index 000000000..e8ff42006 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlgcrc.c @@ -0,0 +1,927 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgcrc.c + +Abstract: + + This module contains the test functions for lineGetConfRelatedCalls + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + +#define NUMTOTALSIZES 7 +#define PAGESIZE 4096 + + +// lineGetConfRelatedCalls +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetConfRelatedCalls(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + HCALL hCall1, hCall2; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + DWORD dwNumCalls; + DWORD dwFixedSize = sizeof(LINECALLLIST); + DWORD dwOneCallSize = dwFixedSize + sizeof(HCALL); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + 10, + (DWORD) dwFixedSize - 1, + (DWORD) dwFixedSize, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; +#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 lineGetConfRelatedCalls <<<<<<<<" + ); + + + // Initialize a line app + 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; + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 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; + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } +*/ + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hCall not in conf statet", 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; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, LINEERR_NOCONFERENCE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpCallList ", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) gdwInvalidPointers[n]; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hCall not in conference state", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, LINEERR_NOCONFERENCE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpCallList->dwTotalSize", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwFixedSize); + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else if(dwTotalSizes[n] >= dwFixedSize && dwTotalSizes[n] < PAGESIZE) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwFixedSize; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify only one space", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + dwNumCalls = 1; + dwSize = sizeof(LINECALLLIST) + dwNumCalls * sizeof(HCALL); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "dwFixedSize = %lx, dwTotalSize = %lx", + dwFixedSize, dwSize); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + if(lpTapiLineTestInfo->lpCallList->dwCallsNumEntries == 0) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify no room for one call", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + dwNumCalls = 0; + dwSize = sizeof(LINECALLLIST) + dwNumCalls * sizeof(HCALL); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "dwFixedSize = %lx, dwTotalSize = %lx", + dwFixedSize, dwSize); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + if(lpTapiLineTestInfo->lpCallList->dwCallsNumEntries == 0) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify return data, 2 calls", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + dwNumCalls = 2; + dwSize = sizeof(LINECALLLIST) + dwNumCalls * sizeof(HCALL); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "dwFixedSize = %lx, dwTotalSize = %lx", + dwFixedSize, dwSize); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + if(lpTapiLineTestInfo->lpCallList->dwCallsNumEntries == 2) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + n=0; + hCall1 = *((LPHCALL) ((LPBYTE)lpTapiLineTestInfo->lpCallList + + lpTapiLineTestInfo->lpCallList->dwCallsOffset+ n*sizeof(HCALL))); + n=1; + hCall2 = *((LPHCALL) ((LPBYTE)lpTapiLineTestInfo->lpCallList + + lpTapiLineTestInfo->lpCallList->dwCallsOffset+ n*sizeof(HCALL))); + + if(hCall1 == *lpTapiLineTestInfo->lphConfCall && + hCall2 == *lpTapiLineTestInfo->lphConsultCall) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, using hConfCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &hCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if(! DoLineDial(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + + +/* Need check Intel tset code to find out how to do this test case. Now + temp moved out + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify LINE_CALLINFO/NUMMONITORS msg send", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage( + LINE_CALLINFO, + (DWORD) *lpTapiLineTestInfo->lphCall, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMMONITORS, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + // If the wait succeeds, then the LINE_CALLINFO message was received + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetConfRelatedCalls: 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 lineGetConfRelatedCalls <<<<<<<<" + ); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlpatc.c b/private/tapi/qa/trapper/itest/tcline/itlpatc.c new file mode 100644 index 000000000..1971292b0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlpatc.c @@ -0,0 +1,950 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpatc.c + +Abstract: + + This module contains the test functions for linePrepareAddToConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + +#define DWNUMCALLS 2 +#define NUMTOTALSIZES 5 + + +// linePrepareAddToConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePrepareAddToConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + HCALL hConfCall; + HCALL hConsultCall; + DWORD dwFixedSize = sizeof(LINECALLPARAMS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing linePrepareAddToConference <<<<<<<<" + ); + + + // Initialize a line app + 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; + + 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: No owner for hConfCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &hConfCall; + lpTapiLineTestInfo->lphConsultCall = &hConsultCall; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Open another line with MONITOR + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 8; + + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hConfCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset+4 + ); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hConfCall 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphConfCall); + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *lpTapiLineTestInfo->lphConfCall = (HCALL) gdwInvalidHandles[n]; + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphConfCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphConsultCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; +// lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphConsultCall = (LPHCALL) gdwInvalidHandles[n]; + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallParams values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallParams = + (LPLINECALLPARAMS) gdwInvalidPointers[n]; + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hConfCall, non-conf call values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphCall = &lpTapiLineTestInfo->hConfCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_INVALCONFCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS); + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify hConsultCall can't be used", dwTestCase + 1 + ); + +/* + if(! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } +*/ + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if(! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpCallParams->dwTotalSize = dwFixedSize; + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpCallParams = NULL", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + for(n=0; n< (INT) lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpCallParams = valid", 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS); + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + for(n=0; n< (INT) lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } + + + // 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + 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(); + } + + if ( ! DoLinePrepareAddToConference(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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_CONFERENCEFULL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLinePrepareAddToConference(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, + "@@ linePrepareAddToConference: 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 linePrepareAddToConference <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlrd.c b/private/tapi/qa/trapper/itest/tcline/itlrd.c new file mode 100644 index 000000000..90edac64d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlrd.c @@ -0,0 +1,564 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrd.c + +Abstract: + + This module contains the test functions for lineRedirect + +Author: + + Xiao Ying Ding (XiaoD) 15-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/2/96 added unicode support + +--*/ + + +#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 "cline.h" + + + +// lineRedirect +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRedirect(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDestAddress[] = L"64738"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDestAddress[] = "64738"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineRedirect <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpszAddress ", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDestAddress = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | 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; + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineRedirect(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + 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(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + + if ( ! DoLineRedirect(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineRedirect(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, + "@@ lineRedirect: 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 lineRedirect <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlrfc.c b/private/tapi/qa/trapper/itest/tcline/itlrfc.c new file mode 100644 index 000000000..d0fdfd6d5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlrfc.c @@ -0,0 +1,653 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrfc.c + +Abstract: + + This module contains the test functions for lineRemoveFromConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + +#define DWNUMCALLS 2 + + +// lineRemoveFromConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRemoveFromConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwNumCalls; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineRemoveFromConference <<<<<<<<" + ); + + // Initialize a line app + 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; + 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)) + { + 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 hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hCall, non-conf call values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphCall = &lpTapiLineTestInfo->hConfCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, LINEERR_INVALCALLSTATE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: No owner for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Open another line with MONITOR + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 8; + + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall1, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + // Initialize a line app + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + dwNumCalls = lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + if(lpTapiLineTestInfo->lpCallList->dwCallsNumEntries < dwNumCalls) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + 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->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + if ( ! DoLineRemoveFromConference(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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineRemoveFromConference(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, + "@@ lineRemoveFromConference: 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 lineRemoveFromConference <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlsc.c b/private/tapi/qa/trapper/itest/tcline/itlsc.c new file mode 100644 index 000000000..0662f9c7c --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlsc.c @@ -0,0 +1,476 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsc.c + +Abstract: + + This module contains the test functions for lineSecureCall + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineSecureCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSecureCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSecureCall <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSecureCall(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineSecureCall(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | 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; + + // 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(); + } + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSecureCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSecureCall(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + // how to verify the call be secured? + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + 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(); + } + + if ( ! DoLineSecureCall(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSecureCall(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, + "@@ lineSecureCall: 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 lineSecureCall <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/itlsh.c b/private/tapi/qa/trapper/itest/tcline/itlsh.c new file mode 100644 index 000000000..521d32551 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlsh.c @@ -0,0 +1,765 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsh.c + +Abstract: + + This module contains the test functions for lineSwapHold + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + + + +// lineSwapHold +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSwapHold(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSwapHold <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hActiveCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hActiveCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hHeldCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hHeldCall; + if(IsESPLineDevice(lpTapiLineTestInfo)) + fEsp = TRUE; + else + fEsp = FALSE; + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hHeldCall = (HCALL) gdwInvalidHandles[n]; + if(fEsp) + { + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hHeldCall = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hHeldCall", dwTestCase + 1 + ); + + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported it (can'r make two calls), return."); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + return fTestPassed; + } + + // 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; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // Make second call at same line + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + + + // Close the Active line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported it, return."); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + // 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; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // Make second call at same line + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallStatus = (LPLINECALLSTATUS) AllocFromTestHeap ( + sizeof(LINECALLSTATUS)); + lpTapiLineTestInfo->lpCallStatus->dwTotalSize = sizeof(LINECALLSTATUS); + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: Active: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: Hold: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + + if(fEsp) + { + if (! DoLineSwapHold(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // Verify the swap + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hActiveCall; + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: Active: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + if(lpTapiLineTestInfo->lpCallStatus->dwCallState == LINECALLSTATE_ONHOLD) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if (! DoLineGetCallStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: Hold: lpCallStatus->dwCallState = %lx", + lpTapiLineTestInfo->lpCallStatus->dwCallState); + + if(lpTapiLineTestInfo->lpCallStatus->dwCallState == LINECALLSTATE_CONNECTED) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + else + { + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + 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->hActiveCall; + 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)) + { + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + 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(); + } + + if ( ! DoLineSwapHold(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->hActiveCall; + 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)) + { + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hHeldCall; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSwapHold(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, + "@@ lineSwapHold: 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 lineSwapHold <<<<<<<<" + ); + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tcline/itlsuc.c b/private/tapi/qa/trapper/itest/tcline/itlsuc.c new file mode 100644 index 000000000..45cbb4103 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/itlsuc.c @@ -0,0 +1,1291 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsuc.c + +Abstract: + + This module contains the test functions for lineSetupConference + +Author: + + Xiao Ying Ding (XiaoD) 15-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 "cline.h" + +#define NUMTOTALSIZES 7 +#define PAGESIZE 4096 +#define NUMPARTIES 8 + + +// lineSetupConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetupConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + HCALL hConfCall, hConsultCall; + DWORD dwFixedSize = sizeof(LINECALLPARAMS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + 10, + (DWORD) dwFixedSize - 1, + (DWORD) dwFixedSize, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + +#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 lineSetupConference <<<<<<<<" + ); + + + /* + // Initialize a line app + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + 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)) + { + 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->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphConfCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphConfCall = (LPHCALL) gdwInvalidHandles[n]; + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lphConfCall == lphConsultCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + lpTapiLineTestInfo->lphConfCall = + (LPHCALL) lpTapiLineTestInfo->lphConsultCall; + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphConsultCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; +// lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphConsultCall = (LPHCALL) gdwInvalidHandles[n]; + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallParams values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallParams = + (LPLINECALLPARAMS) gdwInvalidPointers[n]; + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: verify hConsultCall can't be used", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if(! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpCallParams->dwTotalSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hCall1 = NULL; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + dwTotalSizes[n]; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else if(dwTotalSizes[n] >= dwFixedSize && dwTotalSizes[n] < PAGESIZE) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + } + else + { + if(dwTotalSizes[n] < PAGESIZE) + lExpected = LINEERR_OPERATIONUNAVAIL; + else + lExpected = LINEERR_INVALPOINTER; + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineSetupConference(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallParams->dwTotalSize = dwFixedSize; + + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, hCall = NULL & valid hLine", dwTestCase + 1 + ); + + // Initialize a line app + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + 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->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: verify hConsultCall is valid", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! DoLineDial(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if(! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, 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: Success, hLine ignor when valid hCall", 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; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine1 = 0; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_CALLSTATE msg sent to part", 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; + lpTapiLineTestInfo->hLine1 = 0; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphConsultCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_DIALTONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphConfCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLDPENDCONF, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_CALLSTATE msg sent to monitor", 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->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall1 = 0x00000000; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphConsultCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_DIALTONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + AddMessage( + LINE_CALLSTATE, + (DWORD) *lpTapiLineTestInfo->lphConfCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLDPENDCONF, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (2) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (2) * sizeof(HCALL) + 8; + + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwCalls = %lx, dwOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &hConfCall, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &hConsultCall, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset+ 4 + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + "hConfCall = %lx, hConsultCall = %lx", + (HCALL)hConfCall, (HCALL)hConsultCall); + + AddMessage( + LINE_CALLSTATE, + (DWORD) hConsultCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_DIALTONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + AddMessage( + LINE_CALLSTATE, + (DWORD) hConfCall, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLDPENDCONF, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hCall already conference member", 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; + lpTapiLineTestInfo->hLine1 = 0; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + WaitForAllMessages(); + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + hConfCall = *lpTapiLineTestInfo->lphConfCall; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAddToConference(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, FALSE)) + { + TLINE_FAIL(); + } + } + + *lpTapiLineTestInfo->lphCall = hConfCall; + lpTapiLineTestInfo->hLine1 = 0; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, FALSE)) + { + TLINE_FAIL(); + } + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if ( ! DoLineSetupConference(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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hConfCall1 = 0x00000000; + lpTapiLineTestInfo->hConsultCall1 = 0x00000000; + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetupConference(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, + "@@ lineSetupConference: 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 lineSetupConference <<<<<<<<" + ); + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tcline/ittgli.c b/private/tapi/qa/trapper/itest/tcline/ittgli.c new file mode 100644 index 000000000..ce6074a65 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/ittgli.c @@ -0,0 +1,278 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittgli.c + +Abstract: + + This module contains the test functions for tapiGetLocationInfo + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/2/96 added unicode support + +--*/ + + +#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 "cline.h" + + + +// tapiGetLocationInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiGetLocationInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwCountrySize, dwCitySize; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing tapiGetLocationInfo <<<<<<<<" + ); + +#ifdef WUNICODE + dwCountrySize = 16*sizeof(WCHAR); + dwCitySize = 16*sizeof(WCHAR); + lpTapiLineTestInfo->lpwszCountryCode = AllocFromTestHeap(dwCountrySize); + lpTapiLineTestInfo->lpwszCityCode = AllocFromTestHeap(dwCitySize); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszCountryCode pointers", dwTestCase + 1 + ); + +#else + dwCountrySize = 16; + dwCitySize = 16; + lpTapiLineTestInfo->lpszCountryCode = AllocFromTestHeap(dwCountrySize); + lpTapiLineTestInfo->lpszCityCode = AllocFromTestHeap(dwCitySize); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszCountryCode pointers", dwTestCase + 1 + ); + +#endif + + + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCountryCode = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszCountryCode = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiGetLocationInfo(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszCityCode pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszCityCode pointers", dwTestCase + 1 + ); +#endif + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCityCode = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszCityCode = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiGetLocationInfo(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + FreeTestHeap(); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCountryCode = AllocFromTestHeap(dwCountrySize); + lpTapiLineTestInfo->lpwszCityCode = AllocFromTestHeap(dwCitySize); +#else + lpTapiLineTestInfo->lpszCountryCode = AllocFromTestHeap(dwCountrySize); + lpTapiLineTestInfo->lpszCityCode = AllocFromTestHeap(dwCitySize); +#endif + + if (! DoTapiGetLocationInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + + +#ifdef WUNICODE + (lpTapiLineTestInfo->lpwszCountryCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCountryCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCountryCode = %ws, length = %lx", + lpTapiLineTestInfo->lpwszCountryCode, + wcslen(lpTapiLineTestInfo->lpwszCountryCode)); + + (lpTapiLineTestInfo->lpwszCityCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCityCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCityCode = %ws, length = %lx", + lpTapiLineTestInfo->lpwszCityCode, + wcslen(lpTapiLineTestInfo->lpwszCityCode)); +#else + (lpTapiLineTestInfo->lpszCountryCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCountryCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCountryCode = %s, length = %lx", + lpTapiLineTestInfo->lpszCountryCode, + strlen(lpTapiLineTestInfo->lpszCountryCode)); + + (lpTapiLineTestInfo->lpszCityCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCityCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCityCode = %s, length = %lx", + lpTapiLineTestInfo->lpszCityCode, + strlen(lpTapiLineTestInfo->lpszCityCode)); +#endif + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify length of CountryCode", dwTestCase + 1 + ); + +#ifdef WUNICODE + if(wcslen(lpTapiLineTestInfo->lpwszCountryCode) == 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#else + if(strlen(lpTapiLineTestInfo->lpszCountryCode) == 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#endif + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify length of CityCode", dwTestCase + 1 + ); + +#ifdef WUNICODE + if(wcslen(lpTapiLineTestInfo->lpwszCityCode) == 3) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#else + if(strlen(lpTapiLineTestInfo->lpszCityCode) == 3) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#endif + fTestPassed = ShowTestCase(fTestPassed); + + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ tapiGetLocationInfo: 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 tapiGetLocationInfo <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/ittrd.c b/private/tapi/qa/trapper/itest/tcline/ittrd.c new file mode 100644 index 000000000..80150d1a3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/ittrd.c @@ -0,0 +1,123 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrd.c + +Abstract: + + This module contains the test functions for tapiRequestDrop + +Author: + + Xiao Ying Ding (XiaoD) 30-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 "cline.h" + + + +// tapiRequestDrop +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestDrop(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing tapiRequestDrop <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwnd handles", dwTestCase + 1); + + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwnd = (HWND) gdwInvalidHandles[n]; + if (! DoTapiRequestDrop(lpTapiLineTestInfo, TAPIERR_INVALWINDOWHANDLE)) + { + fTestPassed = FALSE; + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: return REQUESTFAILED", dwTestCase + 1 + ); + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + + if (! DoTapiRequestDrop(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ tapiRequestDrop: 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 tapiRequestDrop <<<<<<<<" + ); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/ittrmc.c b/private/tapi/qa/trapper/itest/tcline/ittrmc.c new file mode 100644 index 000000000..07110d5b5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/ittrmc.c @@ -0,0 +1,616 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrmc.c + +Abstract: + + This module contains the test functions for tapiRequestMakeCall + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/2/96 added unicode support + +--*/ + + +#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 "cline.h" + + +#define NUMREQUEST 20 + +// tapiRequestMakeCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestMakeCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n,i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing tapiRequestMakeCall <<<<<<<<" + ); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: No make call recipient", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwMediaMode = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"tcline.dll"; +#else + lpTapiLineTestInfo->lpszAppFilename = "tcline.dll"; +#endif + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwPriority = 0; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_NOREQUESTRECIPIENT)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); +*/ + +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"btcline.dll"; +#else + lpTapiLineTestInfo->lpszAppFilename = "btcline.dll"; +#endif + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwPriority = 1; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDestAddress pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDestAddress pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDestAddress = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_INVALDESTADDRESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwsztapiAppName pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpsztapiAppName pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsztapiAppName = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpsztapiAppName = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszCalledParty pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszCalledParty pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCalledParty = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszCalledParty = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszComment pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszComment pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; +#endif + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszComment = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszComment = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpwszDestAddress, wcslen > TAPIMAXDEST", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpwszDestAddress = + L"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmonpqrstuvwxyzabcdefg"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; + +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpszDestAddress, strlen > TAPIMAXDEST", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpszDestAddress = + (LPSTR)"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmonpqrstuvwxyzabcdefg"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_INVALDESTADDRESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, valid appname, party, comment", dwTestCase + 1 + ); + +/* + lpTapiLineTestInfo->dwMediaMode = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"ctcline.dll"; +#else + lpTapiLineTestInfo->lpszAppFilename = "ctcline.dll"; +#endif + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwPriority = 1; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)L"tcline.dll"; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)L"Trapper.exe"; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)L"Tapi Api Interface Test"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)"tcline.dll"; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)"Trapper.exe"; + lpTapiLineTestInfo->lpszComment = (LPSTR)"Tapi Api Interface Test"; +#endif + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, appname, party, comment are = null", dwTestCase + 1 + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + + FreeTestHeap(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, wcslen > TAPIMAX", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR)L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = + L"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + lpTapiLineTestInfo->lpwszCalledParty = + L"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + lpTapiLineTestInfo->lpwszComment = + L"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmonpqrstuvwxyzabcdefg"; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, strlen > TAPIMAX", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + lpTapiLineTestInfo->lpszCalledParty = + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"; + lpTapiLineTestInfo->lpszComment = + "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmonpqrstuvwxyzabcdefg"; +#endif + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Call lineGetRequest to verify tructed + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL)); + + + for(i=0; i< 5; i++) + { + DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS); +#ifdef WUNICODE + if(wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szAppName) == + (TAPIMAXAPPNAMESIZE-1)) + break; +#else + if(strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szAppName) == + (TAPIMAXAPPNAMESIZE-1)) + break; +#endif + } + + fTestPassed = TRUE; + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_DETAIL, + "length = %ld, wszAppName = %ws", + wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szAppName), + ((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szAppName); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "length = %ld, wszCalledParty = %ws", + wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szCalledParty), + ((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szCalledParty); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "length = %ld, wszComment = %ws", + wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szComment), + ((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szComment); + + if(wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szAppName) == + (TAPIMAXAPPNAMESIZE - 1) && + wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szCalledParty) == + (TAPIMAXCALLEDPARTYSIZE - 1) && + wcslen(((LPLINEREQMAKECALLW)lpTapiLineTestInfo->lpRequestBuffer)->szComment) == + (TAPIMAXCOMMENTSIZE - 1) ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "length = %ld, szAppName = %s", + strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szAppName), + ((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szAppName); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "length = %ld, szCalledParty = %s", + strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szCalledParty), + ((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szCalledParty); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "length = %ld, szComment = %s", + strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szComment), + ((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szComment); + + if(strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szAppName) == + (TAPIMAXAPPNAMESIZE-1) && + strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szCalledParty) == + (TAPIMAXCALLEDPARTYSIZE-1) && + strlen(((LPLINEREQMAKECALL)lpTapiLineTestInfo->lpRequestBuffer)->szComment) == + (TAPIMAXCOMMENTSIZE-1) ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#endif + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + FreeTestHeap(); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Exhaust request queue, then clean it up", dwTestCase + 1 + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)L"tcline.dll"; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)L"Trapper.exe"; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)L"Tapi Api Interface Test"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)"tcline.cll"; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)"Trapper.exe"; + lpTapiLineTestInfo->lpszComment = (LPSTR)"Tapi Api Interface Test"; +#endif + + for(n=0; n < NUMREQUEST; n++) + { + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + } + + for(n=0; n < NUMREQUEST; n++) + { + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + } + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOREQUEST)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ linetapiRequestMakeCall: 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 tapiRequestMakeCall <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/ittrmec.c b/private/tapi/qa/trapper/itest/tcline/ittrmec.c new file mode 100644 index 000000000..72cfe2a01 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/ittrmec.c @@ -0,0 +1,408 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrmec.c + +Abstract: + + This module contains the test functions for tapiRequestMediaCall + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/2/96 added unicode support + +--*/ + + +#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 "cline.h" + + + +// tapiRequestMediaCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestMediaCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing tapiRequestMediaCall <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwnd handles", dwTestCase + 1); + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->dwSecure = 0; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"line/tapi"; + lpTapiLineTestInfo->lpwszDeviceID = NULL; + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszDeviceClass = "line/tapi"; + lpTapiLineTestInfo->lpszDeviceID = NULL; + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwnd = (HWND) gdwInvalidHandles[n]; + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALWINDOWHANDLE)) + { + fTestPassed = FALSE; + } + } + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALDEVICECLASS)) + { + TLINE_FAIL(); + } + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceID pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceID pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwSize = 1; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceID = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceID = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALDEVICEID)) + { + TLINE_FAIL(); + } + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceID = NULL; +#else + lpTapiLineTestInfo->lpszDeviceID = NULL; +#endif + lpTapiLineTestInfo->dwSize = 0; + + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDestAddress pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDestAddress pointers", dwTestCase + 1 + ); +#endif + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDestAddress = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALDESTADDRESS)) + { + TLINE_FAIL(); + } + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwsztapiAppName pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; + +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpsztapiAppName pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; + +#endif + + + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsztapiAppName = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpsztapiAppName = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + fTestPassed = ShowTestCase(fTestPassed); +#endif + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszCalledParty pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszCalledParty pointers", dwTestCase + 1 + ); +#endif + + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCalledParty = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszCalledParty = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; +#endif + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszComment pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszComment pointers", dwTestCase + 1 + ); +#endif + + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszComment = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszComment = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: return REQUESTFAILED", dwTestCase + 1 + ); + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->dwSecure = 0; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"line/tapi"; + lpTapiLineTestInfo->lpwszDeviceID = NULL; + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; +// lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)"xxx"; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszDeviceClass = "line/tapi"; + lpTapiLineTestInfo->lpszDeviceID = NULL; + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; +// lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)"xxx"; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ tapiRequestMediaCall: 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 tapiRequestMediaCall <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tcline/tcline.def b/private/tapi/qa/trapper/itest/tcline/tcline.def new file mode 100644 index 000000000..5654240bb --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/tcline.def @@ -0,0 +1,25 @@ +LIBRARY tcline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + diff --git a/private/tapi/qa/trapper/itest/tcline/tcline.inc b/private/tapi/qa/trapper/itest/tcline/tcline.inc new file mode 100644 index 000000000..a2f3b6922 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/tcline.inc @@ -0,0 +1,73 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tcline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLDEF=..\tcline.def +DLLBASE=0x66000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES= ..\cline.c \ + ..\itlatc.c \ + ..\itlgcrc.c \ + ..\itlpatc.c \ + ..\itlrfc.c \ + ..\itlsuc.c \ + ..\itlcc.c \ + ..\itlrd.c \ + ..\itlsc.c \ + ..\itlsh.c \ + ..\ittgli.c \ + ..\ittrd.c \ + ..\ittrmc.c \ + ..\ittrmec.c \ + ..\uline.c \ + ..\cline.rc + + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_0=1 -DTAPI_1_1=1 -DTAPI_2_0=1 + + +UMTYPE=windows + +DLLENTRY=TCLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tcline/tclinea/makefile b/private/tapi/qa/trapper/itest/tcline/tclinea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/tclinea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tcline/tclinea/sources b/private/tapi/qa/trapper/itest/tcline/tclinea/sources new file mode 100644 index 000000000..01ffd1231 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/tclinea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tcline.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/tcline/tclinew/makefile b/private/tapi/qa/trapper/itest/tcline/tclinew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/tclinew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tcline/tclinew/sources b/private/tapi/qa/trapper/itest/tcline/tclinew/sources new file mode 100644 index 000000000..b0116b4b9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/tclinew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tcline.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tcline/uline.c b/private/tapi/qa/trapper/itest/tcline/uline.c new file mode 100644 index 000000000..905a3ebd7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tcline/uline.c @@ -0,0 +1,188 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "cline.h" + + +char szApiName[9][48] = + { + "lineAddToConference", + "lineCompleteCall", + "lineGetConfRelatedCalls", + "linePrepareAddToConference", + "lineRedirect", + "lineRemoveFromConference", + "lineSecureCall", + "lineSetupConference", + "lineSwapHold" + }; + + +BOOL TestLineUninitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 9; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 1: + if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 4: + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 5: + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 6: + if (! DoLineSecureCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 7: + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/testapp/dirs b/private/tapi/qa/trapper/itest/testapp/dirs new file mode 100644 index 000000000..d4880da75 --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/dirs @@ -0,0 +1,2 @@ +DIRS = testappa \ + testappw diff --git a/private/tapi/qa/trapper/itest/testapp/testapp.c b/private/tapi/qa/trapper/itest/testapp/testapp.c new file mode 100644 index 000000000..3bfb8f674 --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testapp.c @@ -0,0 +1,365 @@ + +/* + * testapp.c -- + * Xiao Ying Ding + * 1/20/96 + */ + +#include +#include +#include +#include +#include "tapi.h" +#include "testapp.h" + +#define LOW_VERSION 0X10003 +#define HIGH_VERSION 0X20000 + +LONG APIENTRY MainWndProc(HWND, UINT, UINT, LONG); +int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int); + +BOOL APIENTRY MainWndMenuProc(HWND, UINT, UINT, LONG); +void TAPPSendMessage(void); +VOID TappConverRetVal(LONG, char *); +BOOL DoLineInit(void); +BOOL DoLineNegotiateAPIVersion(void); +BOOL DoLineOpen(void); +BOOL DoLineClose(void); +BOOL DoLineShutdown(void); +VOID WINAPI TapiCallback(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD); + + +char *szMainWnd = "Tapi App"; +char *szTAPPAppClass = "TAPPAppsClass"; +char *szTappMenu = "TappMenu"; + +HINSTANCE hInst; +HWND hwndMain, hwndEdit; +HMENU hmenu; + +LONG lRet = 0L; +char szDebugString[128]; +char szRetBuf[128]; + +LPHLINEAPP lphLineApp; +HLINEAPP hLineApp; +HINSTANCE hInstance; +LINECALLBACK lpfnCallBack; +LPSTR szAppName; +LPTSTR lpszAppName; +DWORD dwNumDevs; +LPDWORD lpdwNumDevs; +DWORD dwDeviceID; +DWORD dwAPILowVersion; +DWORD dwAPIHighVersion; +LPDWORD lpdwAPIVersion; +DWORD dwAPIVersion; +LPLINEEXTENSIONID lpExtensionID; +LINEEXTENSIONID ExtensionID; +LPHLINE lphLine; +HLINE hLine; +DWORD dwExtVersion; +DWORD dwCallbackInstance; +DWORD dwPriviledge; +DWORD dwMediaModes; +LPLINECALLPARAMS lpCallParams; + + + +int APIENTRY // ret errorlevel 0 if successful, else 1 +WinMain( // Windows entry point + HINSTANCE hInstance, // instance handle + HINSTANCE hPrevInstance, // previous instance if any + LPSTR lpszCmdLine, // pointer to command line string + int cmdShow) // ShowWindow parameter +{ + MSG msg; + WNDCLASS wc; + RECT rect; + + if (!hPrevInstance) + { + wc.style = CS_VREDRAW | CS_HREDRAW ; + wc.lpfnWndProc = (WNDPROC)MainWndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = hInstance ; + wc.hIcon = LoadIcon((HANDLE)hInstance, NULL); + wc.hCursor = LoadCursor((HANDLE)NULL, IDC_ARROW); + wc.hbrBackground = GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = (LPSTR)szTappMenu; + wc.lpszClassName = (LPSTR)szTAPPAppClass ; + + if(!RegisterClass(&wc)) + return FALSE; + } + + + hInst = hInstance; + + hwndMain = CreateWindow( + (LPCTSTR)szTAPPAppClass, + (LPCTSTR)szMainWnd, + WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW, +// CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + 100, 100, 200, 120, + (HWND)HWND_DESKTOP, + (HMENU)NULL, + (HANDLE)hInstance, + (LPVOID)NULL); + + if(!hwndMain) + { + return FALSE; + } + + GetClientRect(hwndMain, &rect); + + hwndEdit = CreateWindow( + "edit", + "", + WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_READONLY, + rect.left+10, rect.top+10, rect.right-20, rect.bottom-20, + (HWND)hwndMain, + (HMENU)NULL, + (HANDLE)hInstance, + (LPVOID)NULL); + + if(!hwndEdit) + { + return FALSE; + } + + ShowWindow(hwndMain, cmdShow); + UpdateWindow(hwndMain); + + wsprintf((LPTSTR)szDebugString, "Tapi App Start."); +// SendMessage(hwndEdit, EM_SETSEL, (WPARAM)0, (LPARAM)-1); +// SendMessage(hwndEdit, EM_REPLACESEL, 0, (LPARAM) (LPCSTR)szDebugString); + SendMessage(hwndEdit, WM_SETTEXT, 0, (LPARAM) (LPCSTR)szDebugString); + DoLineInit(); + DoLineNegotiateAPIVersion(); + DoLineOpen(); + + while (GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0) ) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage((LPMSG)&msg); + } + + return msg.wParam; +} + + + +LONG APIENTRY MainWndProc( + HWND hwnd, /* Window handle */ + UINT message, /* Message */ + UINT wParam, /* Varies */ + LONG lParam) /* Varies */ +{ + lRet = 0L; + + switch (message) + { + + case WM_CREATE: + wsprintf((LPTSTR)szDebugString, "&Tapi App start. \r\n"); + TAPPSendMessage(); + // DoLineInit(); + break; + + case WM_COMMAND: + wsprintf((LPTSTR)szDebugString, "# Tapi App start. \r\n"); + TAPPSendMessage(); + + // DoLineInit(); + MainWndMenuProc(hwnd, message, wParam, lParam); + break; + + case WM_SIZE: + { + int x, y, dx, dy; + + x = XEditWnd(0); + y = YEditWnd(0); + dx = DxEditWnd(LOWORD(lParam)); + dy = DyEditWnd(HIWORD(lParam)); + MoveWindow(hwndEdit, x, y, dx, dy, TRUE); + break; + } + + case WM_KEYDOWN: + SendMessage(hwnd, WM_DESTROY, 0, 0); + break; + + case WM_DESTROY: + DoLineClose(); + DoLineShutdown(); + PostQuitMessage(0); + return 0; + + default: + lRet = DefWindowProc(hwnd, message, wParam, lParam); + break; + } + + return lRet; +} + +BOOL APIENTRY CALLBACK MainWndMenuProc(HWND hwnd, UINT message, UINT wParam, LONG lParam) +{ + + wsprintf((LPTSTR)szDebugString, "Tapi App start. \r\n"); + TAPPSendMessage(); + + hmenu = GetMenu(hwndMain); + + switch(wParam) + { + case TAPP_Init: +// DoLineInit(); + break; + + case TAPP_Exit: + DoLineClose(); + DoLineShutdown(); + DestroyWindow(hwndMain); + break; + } + return TRUE; +} + + + +BOOL DoLineInit(void) +{ + + lphLineApp = &hLineApp; +// hInstance = (HINSTANCE) NULL; + lpfnCallBack = (LINECALLBACK)TapiCallback; + szAppName = "tapi app"; + lpdwNumDevs = &dwNumDevs; + lpszAppName = &szAppName[0]; + + hInstance = (HINSTANCE) GetModuleHandle("testapp.exe"); + + lRet = lineInitialize(lphLineApp, hInstance, lpfnCallBack, (LPCSTR)szAppName, lpdwNumDevs); + + TappConverRetVal(lRet, szRetBuf); + + wsprintf((LPTSTR)szDebugString, "lineItialize: lRet = %lx\r\n", lRet); + TAPPSendMessage(); + + + return TRUE; +} + + +BOOL DoLineNegotiateAPIVersion(void) +{ + dwDeviceID = 0; + dwAPILowVersion = LOW_VERSION; + dwAPIHighVersion = HIGH_VERSION; + lpdwAPIVersion = &dwAPIVersion; + lpExtensionID = &ExtensionID; + + lRet = lineNegotiateAPIVersion( hLineApp, + dwDeviceID, + dwAPILowVersion, + dwAPIHighVersion, + lpdwAPIVersion, + lpExtensionID + ); + wsprintf((LPTSTR)szDebugString, "lineNegotiateAPIVersion: lRet = %lx\r\n", lRet); + TAPPSendMessage(); + + return TRUE; +} + + +BOOL DoLineOpen(void) +{ + lphLine = &hLine; + dwCallbackInstance = 0; + dwPriviledge = LINECALLPRIVILEGE_OWNER; + dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpCallParams = (LPLINECALLPARAMS) NULL; + + lRet = lineOpen(hLineApp, + dwDeviceID, + lphLine, + dwAPIVersion, + dwExtVersion, + dwCallbackInstance, + dwPriviledge, + dwMediaModes, + lpCallParams + ); + + wsprintf((LPTSTR)szDebugString, "lineOpen: lRet = %lx\r\n", lRet); + TAPPSendMessage(); + + return TRUE; +} + + + +BOOL DoLineClose(void) +{ + lRet = lineClose(*lphLine); + + wsprintf((LPTSTR)szDebugString, "lineClose: lRet = %lx\r\n", lRet); + TAPPSendMessage(); + + return TRUE; +} + +BOOL DoLineShutdown(void) +{ + lRet = lineShutdown(*lphLineApp); + + wsprintf((LPTSTR)szDebugString, "lineShutdown: lRet = %lx\r\n", lRet); + TAPPSendMessage(); + + return TRUE; +} + + +void TAPPSendMessage(void) +{ +// SendMessage(hwndEdit, EM_SETSEL, (WPARAM)-1, (LPARAM)0); +//SendMessage(hwndEdit, EM_REPLACESEL, 0, (LPARAM) (LPCTSTR) szDebugString); + +SendMessage(hwndEdit, WM_SETTEXT, 0, (LPARAM) (LPCSTR)szDebugString); +} + + +VOID TappConverRetVal(LONG lret, char *szRetBuf) +{ + + switch(lret) + { + case LINEERR_INVALAPPNAME: + strcpy((LPTSTR)szRetBuf, "LINEERR_INVALAPPNAME"); + break; + + case LINEERR_INIFILECORRUPT: + strcpy((LPTSTR)szRetBuf, "LINEERR_INIFILECORRUPT"); + break; + + } +} + +VOID +WINAPI +TapiCallback( + DWORD hDevice, + DWORD dwMsg, + DWORD dwCallbackInstance, + DWORD dwParam1, + DWORD dwParam2, + DWORD dwParam3 + ) +{ +} diff --git a/private/tapi/qa/trapper/itest/testapp/testapp.def b/private/tapi/qa/trapper/itest/testapp/testapp.def new file mode 100644 index 000000000..38365c096 --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testapp.def @@ -0,0 +1,25 @@ +NAME TESTAPP + +DESCRIPTION 'Microsoft Multi Network Provider Test Tool: Version 1.0' +EXETYPE WINDOWS +PROTMODE +STUB 'WINSTUB.EXE' + +CODE MOVEABLE DISCARDABLE LOADONCALL PURE +DATA PRELOAD MOVEABLE MULTIPLE + +HEAPSIZE 3072 +STACKSIZE 8096 + +SEGMENTS + _TEXT PRELOAD + +EXPORTS + MainWndProc @1 + MainWndMenuProc @2 +IMPORTS + + + + + diff --git a/private/tapi/qa/trapper/itest/testapp/testapp.h b/private/tapi/qa/trapper/itest/testapp/testapp.h new file mode 100644 index 000000000..fa6b9a161 --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testapp.h @@ -0,0 +1,16 @@ +/* + * testapp.h + * Xiao Ying Ding + * 1/20/96 + */ + + +#define TAPP_Init 11 +#define TAPP_Exit 12 + +#define menuMPRT 1 + +#define XEditWnd(dxParent) (dxParent+10) +#define YEditWnd(dyParent) (dyParent+10) +#define DxEditWnd(dxParent) (dxParent-20) +#define DyEditWnd(dyParent) (dyParent-20) diff --git a/private/tapi/qa/trapper/itest/testapp/testapp.inc b/private/tapi/qa/trapper/itest/testapp/testapp.inc new file mode 100644 index 000000000..9c30f61b5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testapp.inc @@ -0,0 +1,56 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=testapp +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=PROGRAM +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\comdlg32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES= ..\testapp.c \ + ..\testapp.rc + +#C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + + +UMTYPE=windows + +UMENTRY=winmain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/testapp/testapp.rc b/private/tapi/qa/trapper/itest/testapp/testapp.rc new file mode 100644 index 000000000..557642fff --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testapp.rc @@ -0,0 +1,24 @@ +/* + * testapp.rc + * Xiao Ying Ding + * 1/20/96 + */ + +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI XLine API test Library" +#define VER_INTERNALNAME_STR "xline.dll" +#define VER_ORIGINALFILENAME_STR "xline.dll" + +#include "common.ver" +#include "testapp.h" + +TappMenu MENU +BEGIN + MENUITEM "&lineInitialize", TAPP_Init, CHECKED + MENUITEM "&Exit", TAPP_Exit +END + diff --git a/private/tapi/qa/trapper/itest/testapp/testappa/makefile b/private/tapi/qa/trapper/itest/testapp/testappa/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testappa/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/testapp/testappa/sources b/private/tapi/qa/trapper/itest/testapp/testappa/sources new file mode 100644 index 000000000..f9f0c178e --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testappa/sources @@ -0,0 +1,45 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +Notes: + + Commented description of this file is in \nt\public\oak\bin\sources.tpl + + Add the following line under the "SOURCES" section if build for the + TAPI-lite on Daytona (may want to chg TARGETNAME too): + + C_DEFINES=-DDAYTONA + +Revision History: + +!ENDIF + +!include ..\testapp.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\comdlg32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/testapp/testappw/makefile b/private/tapi/qa/trapper/itest/testapp/testappw/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testappw/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/testapp/testappw/sources b/private/tapi/qa/trapper/itest/testapp/testappw/sources new file mode 100644 index 000000000..58f8a66d4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/testapp/testappw/sources @@ -0,0 +1,43 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +Notes: + + Commented description of this file is in \nt\public\oak\bin\sources.tpl + + Add the following line under the "SOURCES" section if build for the + TAPI-lite on Daytona (may want to chg TARGETNAME too): + + C_DEFINES=-DDAYTONA + +Revision History: + +!ENDIF + +!include ..\testapp.inc + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tiline/dirs b/private/tapi/qa/trapper/itest/tiline/dirs new file mode 100644 index 000000000..3c3f47c72 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/dirs @@ -0,0 +1,2 @@ +DIRS= ilinea\ + ilinew diff --git a/private/tapi/qa/trapper/itest/tiline/iline.c b/private/tapi/qa/trapper/itest/tiline/iline.c new file mode 100644 index 000000000..e861e347c --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/iline.c @@ -0,0 +1,362 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + iline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "iline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTILineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TILineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTILineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninitialize(TRUE, TRUE)); +} + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineAccept(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineAnswer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineBlindTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineForward(TRUE, FALSE)); +} + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineForward1(TRUE, FALSE)); +} + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineForward2(TRUE, FALSE)); +} + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineReleaseUserUserInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSendUserUserInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSetupTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineCompleteTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineNegotiateExtVersion(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineHold(TRUE, FALSE)); +} + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineUnhold(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAppSpecific(TRUE, FALSE)); +} + + + + +/* +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineTest(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineTestX(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test16( + HINSTANCE hAppInst + ) +{ + return (TestLineTestY(TRUE, FALSE)); +} + +*/ diff --git a/private/tapi/qa/trapper/itest/tiline/iline.h b/private/tapi/qa/trapper/itest/tiline/iline.h new file mode 100644 index 000000000..932f3929f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/iline.h @@ -0,0 +1,218 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + iline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#ifndef ILINE_H +#define ILINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineAccept( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineAnswer( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineBlindTransfer( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineForward( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineForward1( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineForward2( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineReleaseUserUserInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSendUserUserInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetupTransfer( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineCompleteTransfer( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineNegotiateExtVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineHold( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineUnhold( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineSetAppSpecific( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineUninitialize( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +/* +BOOL +TestLineTest( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineTestX( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineTestY( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +*/ + + + + +#endif // ILINE_H diff --git a/private/tapi/qa/trapper/itest/tiline/ilinea/makefile b/private/tapi/qa/trapper/itest/tiline/ilinea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/ilinea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tiline/ilinea/sources b/private/tapi/qa/trapper/itest/tiline/ilinea/sources new file mode 100644 index 000000000..8e7586a6e --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/ilinea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tiline.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/tiline/ilinew/makefile b/private/tapi/qa/trapper/itest/tiline/ilinew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/ilinew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tiline/ilinew/sources b/private/tapi/qa/trapper/itest/tiline/ilinew/sources new file mode 100644 index 000000000..70e3f5e5a --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/ilinew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tiline.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tiline/itlac.c b/private/tapi/qa/trapper/itest/tiline/itlac.c new file mode 100644 index 000000000..fc1530a60 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlac.c @@ -0,0 +1,1653 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlac.c - lineAccept + +Abstract: + + This module contains the test functions for lineAccept + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + + +#define NUMTOTALSIZES 5 + + +// lineAccept +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized +// 2) hCall without owner privilege +// 3) Invalid hCalls (test array of gdwInvalidHandles) +// 4) Invalid lpsUserUserInfo pointers (test array of gdwInvalidPointers) +// 5) Bad dwSize +// + + +BOOL TestLineAccept(BOOL fQuietMode, BOOL fStandAlone) +{ + + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + LONG lret; + LPTAPIMSG lpMsg; + DWORD dwFixedSize = BIGBUFSIZE; + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineAccept <<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:lineAccept for go/no-go", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAccept(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: No owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, + LINECALLSTATE_OFFERING, + 0, + 0, + 0, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: No owner privilege for hCall", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAccept(lpTapiLineTestInfo, LINEERR_NOTOWNER, FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hCall", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // + // save previous handles + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL)gdwInvalidHandles[i]; + if (! DoLineAccept(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original handle + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpUserInfo. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpUserInfo", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR)gdwInvalidPointers[i]; + if(i == 0) + { + // + // this is a valid case + // + if (! DoLineAccept(lpTapiLineTestInfo, + TAPISUCCESS, + TRUE)) + { + TLINE_FAIL(); + } + + } + else + { + if (! DoLineAccept(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + } + + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwSize", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + for (i = 0; i < NUMTOTALSIZES; i++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[i]; + if(dwTotalSizes[i] < dwFixedSize) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[i]); + if (! DoLineAccept(lpTapiLineTestInfo, lExpected, FALSE)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // Test Case: Success for lpsUserUserInfo = NULL + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAccept + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Success, lpsUserUserInfo = NULL", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) NULL; + lpTapiLineTestInfo->dwSize = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAccept(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + 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->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAccept did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + 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->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMsg = AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + + 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->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + if ( ! DoLineAccept(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 + FreeTapiMsgList(&lpTapiMsg); + 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 = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + + // 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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineAccept(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(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineAccept: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineAccept <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlas.c b/private/tapi/qa/trapper/itest/tiline/itlas.c new file mode 100644 index 000000000..00149d011 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlas.c @@ -0,0 +1,1620 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlas.c + +Abstract: + + This module contains the test functions for lineAnswer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + +#define NUMTOTALSIZES 5 + + +// lineAnswer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. No owner privilege for hCall +// 3. Bad hCall +// 4. Bad lpUserInfo +// 5. Bad dwSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineAnswer(BOOL fQuietMode, BOOL fStandAlone) +{ + + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + DWORD dwFixedSize = BIGBUFSIZE; + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n****************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineAnswer"); + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAnswer + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:lineAnswer for go/no-go", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAnswer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: No owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAnswer + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: No owner privilege for hCall", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAnswer(lpTapiLineTestInfo, LINEERR_NOTOWNER, FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAnswer + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hCall", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // + // save previous handles + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL)gdwInvalidHandles[i]; + if (! DoLineAnswer(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original handle + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpUserInfo. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAnswer + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpUserInfo", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR)gdwInvalidPointers[i]; + if(i == 0) + { + // + // this is a valid case + // + if (! DoLineAnswer(lpTapiLineTestInfo, + TAPISUCCESS, + TRUE)) + { + TLINE_FAIL(); + } + + } + else + { + if (! DoLineAnswer(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + } + + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); +// lret = FindReceivedMsgs(lppTapiMsg, lpMatch, TRUE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAnswer + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwSize", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) "This is a test"; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + for (i = 0; i < NUMTOTALSIZES; i++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[i]; + if(dwTotalSizes[i] < dwFixedSize) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[i]); + if (! DoLineAnswer(lpTapiLineTestInfo, lExpected, FALSE)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // Test Case: Success, lpsUserUserInfo = NULL + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lineAnswer did not work for Unimodem. Please manualy test it"); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Open a line + // + +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + // + // Get hDevCall from LINECALL_STATUS msg to pass to lineAnswer + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Success, lpsUserUserInfo = NULL", + dwTestCase+1); + + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) NULL; + lpTapiLineTestInfo->dwSize = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineAnswer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if(lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize) + { + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "#### lpUserUserInfo = %s", + ((LPBYTE)lpTapiLineTestInfo->lpCallInfo) + + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTapiMsgList(&lpTapiMsg); + 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->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + | LMAKECALL + )) + { + TLINE_FAIL(); + } + + AddMessage (LINE_CALLSTATE, LINECALLSTATE_OFFERING, 0, 0, 0, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM1); + lret = WaitForAllMessages(); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "hCall = %lx", *lpTapiLineTestInfo->lphCall); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_CALLSTATE; + lpMatch->dwParam1 = LINECALLSTATE_OFFERING; + lpMatch->dwFlags = TAPIMSG_DWMSG | TAPIMSG_DWPARAM1; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + if(lret == 1) + { + *lpTapiLineTestInfo->lphCall = (HCALL)(lpTapiMsg->hDevCall); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "lret = %lx, New hCall = %lx", + lret, + *lpTapiLineTestInfo->lphCall); + + 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(); + } + + if ( ! DoLineAnswer(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 + FreeTapiMsgList(&lpTapiMsg); + 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 = (LPWSTR) AllocFromTestHeap (16*2); + + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); + +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + + // 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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineAnswer(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(); + } + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineAnswer: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineAnswer <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlbt.c b/private/tapi/qa/trapper/itest/tiline/itlbt.c new file mode 100644 index 000000000..0c2d82a1f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlbt.c @@ -0,0 +1,856 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlbt.c + +Abstract: + + This module contains the test functions for lineBlindTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineBlindTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. No owner privilege for hCall +// 3. Bad hCall +// 4. Bad lpszDestAddress +// +// * = Stand-alone test case +// +// + +BOOL TestLineBlindTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineBlindTransfer"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:lineBlindTransfer for go/no-go", + dwTestCase+1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineBlindTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineBlindTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: No owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No owner privilege for hCall", + dwTestCase+1); + + if (! DoLineBlindTransfer(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hCall", + dwTestCase+1); + + // + // save original hCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[i]; + + if (! DoLineBlindTransfer(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original hCall + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpszDestAddress. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpszDestAddress", + dwTestCase+1); + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) gdwInvalidPointers[i]; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) gdwInvalidPointers[i]; +#endif + if (! DoLineBlindTransfer(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + 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(); + } + + if ( ! DoLineBlindTransfer(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_INVALCOUNTRYCODE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineBlindTransfer(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(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineBlindTransfer: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineBlindTransfer <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlct.c b/private/tapi/qa/trapper/itest/tiline/itlct.c new file mode 100644 index 000000000..6538be619 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlct.c @@ -0,0 +1,1748 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlct.c + +Abstract: + + This module contains the test functions for lineCompleteTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineCompleteTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. No owner privilege for hCall +// 3. Bad hCall +// 4. Bad lpdwCompletionID +// 5. BitVectorParamErrorTest for completion mode +// 6. Verify LINECALLSTATE_CONFERENCED message sent to monitors when +// successful transfer completion occurs that is resolved as a +// 3-way conference. +// * = Stand-alone test case +// +// + +BOOL TestLineCompleteTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams=NULL; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEspFlag, fUnimdmFlag; + LONG lExpected; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineCompleteTransfer"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#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->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineCompleteTransfer for go/no-go", + dwTestCase+1); + + //lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + if(fEspFlag) + { + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineCompleteTransfer(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(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: No owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No owner privilege for hCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, LINEERR_NOTOWNER, FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + // + // save original hCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[i]; + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original hCall + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad hConsultCall + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hConsultCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + // + // save original hConsultCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hConsultCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphConsultCall = (HCALL) gdwInvalidHandles[i]; + if(fEspFlag) + { + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, + LINEERR_INVALCONSULTCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + } + + // + // restore original hConsultCall + // + + lpTapiLineTestInfo->hConsultCall1 = lpTapiLineTestInfo->hCall_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lphConfCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lphConfCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_CONFERENCE; + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lphConfCall = (LPHCALL)gdwInvalidPointers[i]; + + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: BitVectorParamErrorTest for dwTransferModes. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: BitVectorParamErrorTest for dwTransferMode", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALTRANSFERMODE; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineCompleteTransfer, + (LPDWORD) &lpTapiLineTestInfo->dwTransferMode, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (LINETRANSFERMODE_TRANSFER|LINETRANSFERMODE_CONFERENCE), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + 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(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: BitVectorParamValidTest for dwTransferMode. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: BitVectorParamValidTest for dwTransferMode.", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + if(fEspFlag) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineCompleteTransfer, + (LPDWORD) &lpTapiLineTestInfo->dwTransferMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (LINETRANSFERMODE_TRANSFER|LINETRANSFERMODE_CONFERENCE), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + /* + else if(fUnimdmFlag) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineCompleteTransfer, + (LPDWORD) &lpTapiLineTestInfo->dwTransferMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (LINETRANSFERMODE_TRANSFER|LINETRANSFERMODE_CONFERENCE), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Bad lphConfCall succeeds for LINETRANSFERMODE_TRANSFER. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lphConfCall succeeds for LINETRANSFERMODE_TRANSFER", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lphConfCall = (LPHCALL)gdwInvalidPointers[i]; + + if(fEspFlag) + { + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, + TAPISUCCESS, + TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdmFlag) + { + if (! DoLineCompleteTransfer(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(); + + // =================================================================== + // =================================================================== + // + // 9. Test Case: Verify LINECALLSTATE_CONFEREnCED msg is sent + // after transfering call in CONFERENCED mode + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdmFlag = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdmFlag = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdmFlag = FALSE; + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#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->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEspFlag) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify LINECALLSTATE_CONFERENCED message" + " is sent after completing transfer of a 3-way transfer", + dwTestCase+1); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_CONFERENCE; + + // + // Add the LINECALLSTATE_CONFERENCED message to the list of expected + // messages. + // + + AddMessage( + LINE_CALLSTATE, + (DWORD) lpTapiLineTestInfo->hLine1, + (DWORD) lpCallbackParams, + LINECALLSTATE_CONFERENCED, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1) + ); + + + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + fTestPassed = FALSE; + + } + } + else if(fUnimdmFlag) + { + if (! DoLineCompleteTransfer(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)) + { + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + 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(); + } + + if ( ! DoLineCompleteTransfer(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)) + { + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTransferMode = LINETRANSFERMODE_TRANSFER; + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineCompleteTransfer(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(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineCompleteTransfer: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineCompleteTransfer <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlfw.c b/private/tapi/qa/trapper/itest/tiline/itlfw.c new file mode 100644 index 000000000..cd06548e0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlfw.c @@ -0,0 +1,13814 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlfw.c + +Abstract: + + This module contains the test functions for lineForward + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + +#define NUMTOTALSIZES 5 + + +// lineForward +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad lpForwardList +// 4. Bad lphConsultCall +// 5. Bad lpCallParams +// 6. Bad lpCallParams->dwTotalSize +// 7. Bad lpForwardList->dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineForward(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams = NULL; + DWORD dwAllocSize, dwTotalSize, dwSize1; + DWORD dwForwardListFixedSize = sizeof(LINEFORWARDLIST); + DWORD lExpected; + DWORD dwForwardListTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwForwardListFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + DWORD dwCallParamFixedSize = sizeof(LINECALLPARAMS); + DWORD dwCallParamTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwCallParamFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n****************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineForward"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:lineForward for go/no-go", + dwTestCase+1); + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // restore the original line + // + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + // + // Add the message LINE_APPNEWCALL for which we are waiting for. + // This Go/No-go test also takes care of another test case in which we + // have to verify if LINE_APPNEWCALL msg is sent a consultation + // call is created on lineForward. + // + + AddMessage( + LINE_APPNEWCALL, + (DWORD) lpTapiLineTestInfo->hLine2, + (DWORD) lpCallbackParams, + 0x00000000, + 0x00000000, + LINECALLPRIVILEGE_MONITOR, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL| + TAPIMSG_DWPARAM3) + ); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + + + lpTapiLineTestInfo->lpLineAddressStatus = (LPLINEADDRESSSTATUS) AllocFromTestHeap ( + sizeof(LINEADDRESSSTATUS)); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = sizeof(LINEADDRESSSTATUS); + + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + fTestPassed = FALSE; + + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + /* + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = + LINEFORWARDMODE_UNCOND; + */ + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hLine", + dwTestCase+1); + // + // save original hline + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original hline + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpForwardList. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + /* + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = + LINEFORWARDMODE_UNCOND; + */ + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpForwardList", + dwTestCase+1); + + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST)gdwInvalidPointers[i]; + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lphConsultCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + /* + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = + LINEFORWARDMODE_UNCOND; + */ + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lphConsultCall", + dwTestCase+1); + + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lphConsultCall = (LPHCALL)gdwInvalidPointers[i]; + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: hConsultCall Can't be used", + dwTestCase+1); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpCallParams. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + /* + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = + LINEFORWARDMODE_UNCOND; + */ + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams", + dwTestCase+1); + + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS)gdwInvalidPointers[i]; + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpCallParams->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + /* + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = + LINEFORWARDMODE_UNCOND; + */ + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams->dwTotalSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpCallParams->dwTotalSize = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams->dwTotalSize=fixedSize-1 ", + dwTestCase+1); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS)-1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams->dwTotalSize=realBig ", + dwTestCase+1); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = 0x7FFFFFFF; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } +*/ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + dwCallParamTotalSizes[n]; + if(dwCallParamTotalSizes[n] < dwCallParamFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_STRUCTURETOOSMALL; + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwCallParamTotalSizes[n]); + if (! DoLineForward(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = dwCallParamFixedSize; + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad lpForwardList->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + /* + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = + LINEFORWARDMODE_UNCOND; + */ + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpForwardList->dwTotalSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpForwardList->dwTotalSize = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpForwardList->dwTotalSize=fixedSize-1 ", + dwTestCase+1); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST)-1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpForwardList->dwTotalSize=realBig ", + dwTestCase+1); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = 0x7FFFFFFF; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + */ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpForwardList->dwTotalSize = + dwForwardListTotalSizes[n]; + if(dwForwardListTotalSizes[n] < dwForwardListFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_STRUCTURETOOSMALL; + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwForwardListTotalSizes[n]); + if (! DoLineForward(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = dwForwardListFixedSize; + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: NULL lpForwardList. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMediaModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Null lpForwardList", + dwTestCase+1); + lpTapiLineTestInfo->lpForwardList = NULL; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, + TAPISUCCESS, + TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Success, verify LINECALLSTATE_UNKNOWN msg send", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // restore the original line + // + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + + + AddMessage( + LINE_CALLSTATE, + (DWORD) lpTapiLineTestInfo->hConsultCall1, + (DWORD) lpCallbackParams, + LINECALLSTATE_CONNECTED, + 0x00000000, + 0X00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineAddressStatus = (LPLINEADDRESSSTATUS) AllocFromTestHeap ( + sizeof(LINEADDRESSSTATUS)); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = sizeof(LINEADDRESSSTATUS); + + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + fTestPassed = FALSE; + + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Success, verify returned hConsultCall valid", + dwTestCase+1); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConsultCall1; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if (! DoLineDial(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Success, Cancel forwarding", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "hConsultCall = %lx", + *lpTapiLineTestInfo->lphConsultCall); + + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) NULL; +// lpTapiLineTestInfo->lpForwardList->dwTotalSize = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if(*lpTapiLineTestInfo->lphConsultCall == NULL) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test ForwardList[0] Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwAllocSize = %lx, dwTotalSize = %lx, dwSize1 = %lx", + dwAllocSize, + dwTotalSize, + dwSize1); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressSize = %lx, [0].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize); + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressSize = %lx, [1].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize = -1", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 0XFFFFFFFF; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 0XFFFFFFFF; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressSize = %lx, [0].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize); + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressSize = %lx, [1].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Test Offset value, < dwTotalSize ", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwSize1 + 4; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwSize1 + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Test Offset value, > dwAllocSize ", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwAllocSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwAllocSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Test Offset value, 0xffffffff", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = 0xffffffff; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = 0xffffffff; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test ForwardList[1] Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressSize = %lx, [0].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize); + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressSize = %lx, [1].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize = -1", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 0XFFFFFFFF; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwTotalSize + 3*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 0XFFFFFFFF; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwTotalSize + 4*16; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressSize = %lx, [0].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize); + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressSize = %lx, [1].dwDestSize = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Test Offset value, < dwTotalSize ", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwSize1 + 4; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwSize1 + 16; + + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Test Offset value, > dwAllocSize ", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = dwAllocSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = dwAllocSize + 2*16; + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Test Offset value, 0xffffffff", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + BIGBUFSIZE); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 2; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + dwAllocSize = lpTapiLineTestInfo->lpForwardList->dwTotalSize; + dwTotalSize = sizeof(LINEFORWARDLIST) + sizeof(LINEFORWARD); + dwSize1 = sizeof(LINEFORWARDLIST); + + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset = dwTotalSize + 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset = dwTotalSize + 2*16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwForwardMode = LINEFORWARDMODE_UNCOND; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset = 0xffffffff; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestCountryCode = 0; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressSize = 16; + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_PASS, + "[0].dwCallerAddressOffset = %lx, [0].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[0].dwDestAddressOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "[1].dwCallerAddressOffset = %lx, [1].dwDestOffset = %lx", + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwCallerAddressOffset, + lpTapiLineTestInfo->lpForwardList->ForwardList[1].dwDestAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + +/* + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwOrigAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwOrigAddressSize = %lx, dwOrigAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize, + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwOrigAddressSize = %lx, dwOrigAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize, + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwOrigAddressSize = %lx, dwOrigAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize, + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwOrigAddressSize = %lx, dwOrigAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize, + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwOrigAddressSize = %lx, dwOrigAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize, + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDisplayableAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDisplayableAddressSize = %lx, dwDisplayableAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize, + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDisplayableAddressSize = %lx, dwDisplayableAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize, + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDisplayableAddressSize = %lx, dwDisplayableAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize, + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDisplayableAddressSize = %lx, dwDisplayableAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize, + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDisplayableAddressSize = %lx, dwDisplayableAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize, + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCalledPartyAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCalledPartySize = %lx, dwCalledPartyOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize, + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCalledPartySize = %lx, dwCalledPartyOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize, + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCalledPartySize = %lx, dwCalledPartyOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize, + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCalledPartySize = %lx, dwCalledPartyOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize, + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCalledPartySize = %lx, dwCalledPartyOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize, + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwComment Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCommentSize = %lx, dwCommentOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCommentSize, + lpTapiLineTestInfo->lpCallParams->dwCommentOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCommentSize = %lx, dwCommentOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCommentSize, + lpTapiLineTestInfo->lpCallParams->dwCommentOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCommentSize = %lx, dwCommentOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCommentSize, + lpTapiLineTestInfo->lpCallParams->dwCommentOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCommentSize = %lx, dwCommentOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCommentSize, + lpTapiLineTestInfo->lpCallParams->dwCommentOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCommentSize = %lx, dwCommentOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCommentSize, + lpTapiLineTestInfo->lpCallParams->dwCommentOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwUserUserInfo Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwUserUserInfoSize = %lx, dwUserUserInfoOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwUserUserInfoSize = %lx, dwUserUserInfoOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwUserUserInfoSize = %lx, dwUserUserInfoOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwUserUserInfoSize = %lx, dwUserUserInfoOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwUserUserInfoSize = %lx, dwUserUserInfoOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwHighLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwHighLevelCompSize = %lx, dwHighLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwHighLevelCompSize = %lx, dwHighLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwHighLevelCompSize = %lx, dwHighLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwHighLevelCompSize = %lx, dwHighLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwHighLevelCompSize = %lx, dwHighLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwLowLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwLowLevelCompSize = %lx, dwLowLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwLowLevelCompSize = %lx, dwLowLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwLowLevelCompSize = %lx, dwLowLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwLowLevelCompSize = %lx, dwLowLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwLowLevelCompSize = %lx, dwLowLevelCompOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize, + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDevSpecificAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwTargetAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTargetAddressSize = %lx, dwTargetAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize, + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTargetAddressSize = %lx, dwTargetAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize, + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTargetAddressSize = %lx, dwTargetAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize, + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTargetAddressSize = %lx, dwTargetAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize, + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTargetAddressSize = %lx, dwTargetAddressOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize, + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwSendingFlowspec Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwReceivingFlowspec Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceClass Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceClassSize = %lx, dwDeviceClassOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceClassSize = %lx, dwDeviceClassOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceClassSize = %lx, dwDeviceClassOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceClassSize = %lx, dwDeviceClassOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceClassSize = %lx, dwDeviceClassOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceConfig Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceConfigSize = %lx, dwDeviceConfigOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceConfigSize = %lx, dwDeviceConfigOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceConfigSize = %lx, dwDeviceConfigOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceConfigSize = %lx, dwDeviceConfigOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDeviceConfigSize = %lx, dwDeviceConfigOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize, + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallData Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallDataSize, + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallDataSize, + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallDataSize, + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallDataSize, + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallDataSize, + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallingPartyID Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallingPartyIDSize = %lx, dwCallingPartyIDOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize, + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset); + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallingPartyIDSize = %lx, dwCallingPartyIDOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize, + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallingPartyIDSize = %lx, dwCallingPartyIDOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize, + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwAllocSize + 16; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallingPartyIDSize = %lx, dwCallingPartyIDOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize, + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwAllocSize = %lx, dwTotalSize = %lx", + dwAllocSize, + dwTotalSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallingPartyIDSize = %lx, dwCallingPartyIDOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize, + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + 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->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if ( ! DoLineForward(lpTapiLineTestInfo, info.u.EspResult.lResult, TRUE)) + { + TLINE_FAIL(); + } + } + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // 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_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineForward(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; + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineForward: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineForward <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlfw1.c b/private/tapi/qa/trapper/itest/tiline/itlfw1.c new file mode 100644 index 000000000..be5951ad1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlfw1.c @@ -0,0 +1,9240 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlfw1.c + +Abstract: + + This module contains the test functions for lineForward Addtion + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + +#define NUMTOTALSIZES 5 + + +// lineForward +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad lpForwardList +// 4. Bad lphConsultCall +// 5. Bad lpCallParams +// 6. Bad lpCallParams->dwTotalSize +// 7. Bad lpForwardList->dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineForward1(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams = NULL; + DWORD dwAllocSize, dwTotalSize, dwSize1, dwSize2; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n****************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineForward"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwOrigAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDisplayableAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCalledPartyAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwComment Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwUserUserInfo Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwHighLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwLowLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDevSpecificAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwTargetAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwSendingFlowspec Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwReceivingFlowspec Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceClass Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceConfig Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallData Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallingPartyID Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineForward1: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineForward <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlfw2.c b/private/tapi/qa/trapper/itest/tiline/itlfw2.c new file mode 100644 index 000000000..7ad26c8b3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlfw2.c @@ -0,0 +1,9236 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlfw2.c + +Abstract: + + This module contains the test functions for lineForward Addtion + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + +#define NUMTOTALSIZES 5 + + +// lineForward +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad lpForwardList +// 4. Bad lphConsultCall +// 5. Bad lpCallParams +// 6. Bad lpCallParams->dwTotalSize +// 7. Bad lpForwardList->dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineForward2(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams = NULL; + DWORD dwAllocSize, dwTotalSize, dwSize1, dwSize2; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n****************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineForward"); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwOrigAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwOrigAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwOrigAddressOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDisplayableAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDisplayableAddressOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCalledPartyAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCalledPartySize = 16; + lpTapiLineTestInfo->lpCallParams->dwCalledPartyOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwComment Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCommentSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCommentOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwUserUserInfo Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoSize = 16; + lpTapiLineTestInfo->lpCallParams->dwUserUserInfoOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwHighLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwHighLevelCompOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwLowLevelComp Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompSize = 16; + lpTapiLineTestInfo->lpCallParams->dwLowLevelCompOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDevSpecificAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = 0xffffffff; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDevSpecificSize = %lx, dwDevSpecificOffset = %lx", + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize, + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwTargetAddress Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwTargetAddressSize = 16; + lpTapiLineTestInfo->lpCallParams->dwTargetAddressOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwSendingFlowspec Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwSendingFlowspecOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwReceivingFlowspec Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecSize = 16; + lpTapiLineTestInfo->lpCallParams->dwReceivingFlowspecOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceClass Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceClassSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceClassOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwDeviceConfig Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigSize = 16; + lpTapiLineTestInfo->lpCallParams->dwDeviceConfigOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallData Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallDataSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallDataOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: Test lpCallParam dwCallingPartyID Offset value"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = BIGBUFSIZE; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value between dwTotalSize & dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 0xffffffff; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwTotalSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value > dwAllocSize, good dwSize", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = dwAllocSize + 16; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Offset value = 0XFFFFFFFF", + dwTestCase+1); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = BIGBUFSIZE; + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(LINECALLPARAMS); + + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDSize = 16; + lpTapiLineTestInfo->lpCallParams->dwCallingPartyIDOffset = 0xffffffff; + + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_INVALCALLPARAMS, TRUE)) + { + TLINE_FAIL(); + } + + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineForward1: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineForward <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlh.c b/private/tapi/qa/trapper/itest/tiline/itlh.c new file mode 100644 index 000000000..b7febc4e6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlh.c @@ -0,0 +1,477 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlh.c + +Abstract: + + This module contains the test functions for lineHold + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + + Rama Koneru (a-ramako) 4/3/96 Added Interface tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "iline.h" + + +// lineHold +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized case (testcase in uline.c) +// 2) Valid Case +// 3) No owner priveledge for hCall +// 4) Invalid hCall +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// + +BOOL TestLineHold(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEspFlag = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineHold <<<<<<<<" + ); + + // + // Initialize and Negotiate, then find an ESP device that + // supports lineHold + // + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION)) + { + TLINE_FAIL(); + } + + if (!FindESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + lpTapiLineTestInfo->dwDeviceID = 0; + TLINE_FAIL(); + fTestPassed = TRUE; //check why this is being done + //also check whether it might not be a bad idea to 'return' here + } + + // Shutdown + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN)) + { + TLINE_FAIL(); + } + + //test valid case + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params.", + dwTestCase+1 + ); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | LMAKECALL)) + { + TLINE_FAIL(); + } + if(fEspFlag) + { + if (!DoLineHold(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + } + else + { + if (!DoLineHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // invalid hCall + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | LMAKECALL)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + + if (! DoLineHold(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, FALSE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN )) + { + TLINE_FAIL(); + } + + + // no owner priveledges for hCall + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | LMAKECALL)) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineHold(lpTapiLineTestInfo, LINEERR_NOTOWNER, FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN)) + { + 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(); + } + + if ( ! DoLineHold(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineHold(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(); + } + + + + //logging test results + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineHold: 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 lineHold <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlnev.c b/private/tapi/qa/trapper/itest/tiline/itlnev.c new file mode 100644 index 000000000..6b6b45498 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlnev.c @@ -0,0 +1,609 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlnev.c + +Abstract: + + This module contains the test functions for lineNegotiateExtVersion + +Author: + + Oliver Wallace (OliverW) 1-Aug-1995 + +Revision History: + + Rama Koneru (a-ramako) 4/3/96 Added Interface tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "iline.h" + + +// lineNegotiateExtVersion +// +// The following tests are made: +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized case (testcase in uline.c) +// 2) Valid Case +// 3) Invalid hLineApp +// 4) Invalid dwDeviceId +// 5) Invalid dwAPIVersion +// 6) Bad dwExtLowVersion & dwExtHighVersion +// 7) Bad lpdwExtVersion +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// -------------------------------------------------------------------------- +// + +BOOL TestLineNegotiateExtVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + + int i, n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEspFlag, fUnimdm; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineNegotiateExtVersion"); + + //test valid case + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Go/No-Go Test", dwTestCase + 1); + + 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; + + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION1_4; + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoTapiLineFuncs(lpTapiLineTestInfo, LINITIALIZEEX)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + for (i = 0; i < NUMINVALIDHANDLES; i++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[i]; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try a bad device id (= dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (= dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoTapiLineFuncs( lpTapiLineTestInfo, LINITIALIZEEX)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoTapiLineFuncs( lpTapiLineTestInfo, LINITIALIZEEX )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try invalid higher version...valid low version + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid ext version", dwTestCase + 1); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoTapiLineFuncs(lpTapiLineTestInfo, LINITIALIZEEX )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtVersion = 0x00000000; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + fUnimdm = TRUE; + } + else + { + fEspFlag = FALSE; + fUnimdm = FALSE; + } + + + + lpTapiLineTestInfo->dwExtHighVersion = BAD_EXTVERSION; + if(fEspFlag) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_INCOMPATIBLEEXTVERSION)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + // Make the high parameter too low to be valid and the low too high. + // This checks that the low is being checked as the low version and the + // high is being checked as the high version. + lpTapiLineTestInfo->dwExtLowVersion = BAD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = BAD_EXTVERSION; + if(fEspFlag) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo,LINEERR_INCOMPATIBLEEXTVERSION)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo,LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check bad lpdwExtVersion pointer + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad lpdwExtVersion pointer", dwTestCase + 1); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoTapiLineFuncs(lpTapiLineTestInfo, LINITIALIZEEX )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpdwExtVersion = (LPDWORD) gdwInvalidPointers[i]; + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpdwExtVersion = &(lpTapiLineTestInfo->dwExtVersion); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible High API Version", dwTestCase + 1); + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + + if (! DoTapiLineFuncs(lpTapiLineTestInfo, LINITIALIZEEX )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + //high API version + lpTapiLineTestInfo->dwAPIVersion_Orig = lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TOOHIGH_APIVERSION; + if(fEspFlag) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo,LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible Low API Version", dwTestCase + 1); + //low API version + lpTapiLineTestInfo->dwAPIVersion = TOOLOW_APIVERSION; + if(fEspFlag) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo,LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + lpTapiLineTestInfo->dwAPIVersion = lpTapiLineTestInfo->dwAPIVersion_Orig; + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Free the memory from heap + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + if ( ! DoLineNegotiateExtVersion(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + if ( ! DoLineNegotiateExtVersion(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + + //logging test results + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineNegotiateExtVersion: 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 lineNegotiateExtVersion <<<<<<<<" + ); + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlruui.c b/private/tapi/qa/trapper/itest/tiline/itlruui.c new file mode 100644 index 000000000..4228a72d4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlruui.c @@ -0,0 +1,730 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlruui.c + +Abstract: + + This module contains the test functions for lineReleaseUserUserInfo + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + + + +// lineReleaseUserUserInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. No owner privilege for hCall +// 3. Bad hCall +// +// * = Stand-alone test case +// +// + +BOOL TestLineReleaseUserUserInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n**************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineReleaseUserUserInfo"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineReleaseUserUserInfo for go/no-go", + dwTestCase+1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: No owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No owner privilege for hCall", + dwTestCase+1); + + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, LINEERR_NOTOWNER, FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hCall", + dwTestCase+1); + + // + // save original hCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[i]; + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original hCall + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + + 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(); + } + + if ( ! DoLineReleaseUserUserInfo(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineReleaseUserUserInfo(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(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineReleaseUserUserInfo: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineReleaseUserUserInfo <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itlsas.c b/private/tapi/qa/trapper/itest/tiline/itlsas.c new file mode 100644 index 000000000..eea48e663 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlsas.c @@ -0,0 +1,467 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsas.c + +Abstract: + + This module contains the test functions for lineSetAppSpecific + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + + Rama Koneru (a-ramako) 4/3/96 Added Interface tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "ttest.h" +#include "doline.h" +#include "tcore.h" +#include "iline.h" + + +#define DWAPPSPECIFICVALUE 0x12349876 + + +// lineSetAppSpecific +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized case (testcase included in uline.c) +// 2) Valid testcase +// 3) No owner priveledges for hCall +// 4) Invalid hCall values +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// + +BOOL TestLineSetAppSpecific(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + BOOL fResult; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetAppSpecific <<<<<<<<" + ); + + // Try a valid test case + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid params and state", + dwTestCase + 1); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION )) + { + TLINE_FAIL(); + } + + // Get the device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with LINECALLPRIVILEGE_OWNER + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAppSpecific = DWAPPSPECIFICVALUE; + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + //Invalid hCall values + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Invalid hCall values", + dwTestCase + 1); + + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION)) + { + TLINE_FAIL(); + } + + // Get the device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line with LINECALLPRIVILEGE_OWNER + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + //testcase with no owner privileges + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no owner privileges for hCall", + dwTestCase + 1); + + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Get the device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +// BUGBUG + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } +//set monitor privileges + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, LINEERR_NOTOWNER)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + //-------------------------------------------- + + FreeTestHeap(); + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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->dwAppSpecific = DWAPPSPECIFICVALUE; + if ( ! DoLineSetAppSpecific(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAppSpecific = DWAPPSPECIFICVALUE; + if ( ! DoLineSetAppSpecific(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + + //logging test results + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetAppSpecific: 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 lineSetAppSpecific <<<<<<<<" + ); + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/tiline/itlst.c b/private/tapi/qa/trapper/itest/tiline/itlst.c new file mode 100644 index 000000000..61f6c4b8b --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlst.c @@ -0,0 +1,1340 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlst.c + +Abstract: + + This module contains the test functions for lineSetupTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + +#define NUMTOTALSIZES 5 + + +// lineSetupTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. No owner privilege for hCall +// 3. Bad hCall +// 4. Bad lphConsultCall +// 5. Bad lpCallParams +// 6. Bad lpCallParams->dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetupTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams=NULL; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwCallParamFixedSize = sizeof(LINECALLPARAMS); + DWORD lExpected; + DWORD dwCallParamTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwCallParamFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n**************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineSetupTransfer"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + lpCallbackParams = GetCallbackParams(); + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // restore hLine1 + // + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + +#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(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineSetupTransfer for go/no-go", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + // + // Add the message LINE_CALLSTATE for which we are waiting for. + // This Go/No-go test also takes care of another test case in which we + // have to verify if LINE_CALLSTATE msg is sent. + // + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + AddMessage(LINE_CALLSTATE, + 0x00000000, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLD, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1) + ); + + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if(! WaitForAllMessages()) + { + TLINE_FAIL(); + + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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 = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No owner privilege for hCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if (! DoLineSetupTransfer(lpTapiLineTestInfo, + LINEERR_NOTOWNER, + FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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 = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + // + // save original hCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[i]; + if (! DoLineSetupTransfer(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original hCall + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lphConsultCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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 = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lphConsultCall", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lphConsultCall = (LPHCALL) gdwInvalidPointers[i]; + if (! DoLineSetupTransfer(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpCallParams. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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 = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) gdwInvalidPointers[i]; + if (! DoLineSetupTransfer(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpCallParams->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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 = &(lpTapiLineTestInfo->CallParams); + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams->dwTotalSize", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + +/* + lpTapiLineTestInfo->lpCallParams->dwTotalSize=0; + + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL, FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams->dwTotalSize=fixedSize-1", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize=sizeof(LINECALLPARAMS)-1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL, FALSE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpCallParams->dwTotalSize=real big", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap( + sizeof(LINECALLPARAMS)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize=0x7fffffff; + + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_INVALPOINTER, FALSE)) + { + TLINE_FAIL(); + } +*/ + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + dwCallParamTotalSizes[n]; + if(dwCallParamTotalSizes[n] < dwCallParamFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_STRUCTURETOOSMALL; + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwCallParamTotalSizes[n]); + if (! DoLineSetupTransfer(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = dwCallParamFixedSize; + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Verify LINECALLSTATE_UNKNOWN msg sent to monitors on + // success + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify LINECALLSTATE_DIALTONE msg sent" + " to monitors on success", + dwTestCase+1); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // + // Add the LINECALLSTATE_UNKNOWN message to the list of expected + // messages. + // + + AddMessage( + LINE_CALLSTATE, + (DWORD) lpTapiLineTestInfo->hLine1, + (DWORD) lpCallbackParams, + LINECALLSTATE_DIALTONE, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1) + ); + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + // + // Wait for the LINECALLSTATE_UNKNOWN message + // + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + 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->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if ( ! DoLineSetupTransfer(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_INVALRATE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetupTransfer(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(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineSetupTransfer: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineSetupTransfer <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tiline/itlsuui.c b/private/tapi/qa/trapper/itest/tiline/itlsuui.c new file mode 100644 index 000000000..b3306e245 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itlsuui.c @@ -0,0 +1,1220 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlruui.c + +Abstract: + + This module contains the test functions for lineSendUserUserInfo + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-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 "iline.h" + +#define NUMTOTALSIZES 5 + + +// lineSendUserUserInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. No owner privilege for hCall +// 3. Bad hCall +// 4. Bad lpsUseruserInfo +// 5. Bad dwSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineSendUserUserInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwFixedSize = BIGBUFSIZE; + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + InitTestNumber(); + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n**************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineSendUserUserInfo"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineSendUserUserInfo for go/no-go", + dwTestCase+1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: No owner privilege for hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No owner privilege for hCall", + dwTestCase+1); + + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, LINEERR_NOTOWNER, FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hCall. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hCall", + dwTestCase+1); + + // + // save original hCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL) gdwInvalidHandles[i]; + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // restore original hCall + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpsUserUserInfo. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpsUserUserInfo", + dwTestCase+1); + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) gdwInvalidPointers[i]; + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + 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(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwSize", + dwTestCase+1); + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + for (i = 0; i < NUMTOTALSIZES; i++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[i]; + if(dwTotalSizes[i] < dwFixedSize) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[i]); + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, lExpected, FALSE)) + { + TLINE_FAIL(); + } + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### After: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Null lpsUserUserInfo(Success case). + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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; +// lpTapiLineTestInfo->lpCallParams = &(lpTapiLineTestInfo->CallParams); + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Before: dwUserUserInfoSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoSize, + lpTapiLineTestInfo->lpCallInfo->dwUserUserInfoOffset); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Null lpsUserUserInfo(Success case)", + dwTestCase+1); + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) NULL; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, + TAPISUCCESS, + TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSendUserUserInfo(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->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + if ( ! DoLineSendUserUserInfo(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpsUserUserInfo = (LPSTR) AllocFromTestHeap(128); + lpTapiLineTestInfo->dwSize = sizeof(lpTapiLineTestInfo->lpsUserUserInfo); + lpTapiLineTestInfo->lpsUserUserInfo = "This is a test"; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSendUserUserInfo(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(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineSendUserUserInfo: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineSendUserUserInfo <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tiline/itluh.c b/private/tapi/qa/trapper/itest/tiline/itluh.c new file mode 100644 index 000000000..1ae52d884 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/itluh.c @@ -0,0 +1,510 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itluh.c + +Abstract: + + This module contains the test functions for lineUnhold + +Author: + + Oliver Wallace (OliverW) 27-Oct-1995 + +Revision History: + + Rama Koneru (a-ramako) 4/3/96 Added Interface tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "iline.h" + + +// lineUnhold +// +// The following tests are made: +// +// ------------------------------------------------------------------------- +// +// * 1) Uninitialized (called before any lines are initialized) +// 2) Valid Case +// 3) No owner priveledge for hCall +// 4) Invalid hCall +// +// * = Stand-alone test -- executed only when this is the only TAPI app +// or thread running +// + +BOOL TestLineUnhold(BOOL fQuietMode, BOOL fStandAloneTest) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fEspFlag = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + TapiLineTestInit(); + + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) + AllocFromTestHeap( + sizeof(LINEEXTENSIONID) + ); + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineUnhold <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld : valid params", + dwTestCase+1); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION)) + { + TLINE_FAIL(); + } + + if (!FindESPLineDevice(lpTapiLineTestInfo)) + { + fEspFlag = FALSE; + lpTapiLineTestInfo->dwDeviceID = 0; + TLINE_FAIL(); + fTestPassed = TRUE; + } + + // Open a line with LINECALLPRIVILEGE_OWNER + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL)) + { + TLINE_FAIL(); + } + + // Put the call on hold + if(fEspFlag) + { + if (!DoLineHold(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + else + { // Retrieve the held call + if (! DoLineUnhold(lpTapiLineTestInfo, TAPISUCCESS, FALSE)) + { + TLINE_FAIL(); + } + } + } + else + { + if (!DoLineHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE |LSHUTDOWN + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + + // invalid hCall + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN |LMAKECALL)) + { + TLINE_FAIL(); + } + + if(fEspFlag) + { + if (! DoLineHold(lpTapiLineTestInfo, TAPISUCCESS , TRUE)) + { + TLINE_FAIL(); + } + else + { + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + + // Retrieve the held call + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE , FALSE)) + { + TLINE_FAIL(); + } + } + } + } + else + { + if (!DoLineHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // no owner priveledges for hCall + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | LMAKECALL)) + { + TLINE_FAIL(); + } + + + if(fEspFlag) + { + if (! DoLineHold(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + else + { + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_NOTOWNER , FALSE)) + { + TLINE_FAIL(); + } + } + } + else + { + if (!DoLineHold(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Free the memory from heap + 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(); + } + + if ( ! DoLineUnhold(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_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineUnhold(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(); + } + + + + //logging test results + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineUnhold: 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 lineUnhold <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/test.c b/private/tapi/qa/trapper/itest/tiline/test.c new file mode 100644 index 000000000..79ec889f5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/test.c @@ -0,0 +1,170 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + test.c + +Abstract: + + This module contains the test functions for lineTest + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + +VOID +WINAPI +TestCallback( + DWORD hDevice, + DWORD dwMsg, + DWORD dwCallbackInstance, + DWORD dwParam1, + DWORD dwParam2, + DWORD dwParam3 + ); + + + +// lineTest +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTest(BOOL fQuietMode, BOOL fStandAlone) +{ + HLINEAPP hLineApp; + LPHLINEAPP lphLineApp; + HINSTANCE hInstance; + LINECALLBACK lpfnCallback; + LPTSTR lpszAppName; + DWORD dwNumDevs; + LPDWORD lpdwNumDevs; + DWORD dwAPILowVersion; + DWORD dwAPIHighVersion; + DWORD dwAPIVersion; + LPDWORD lpdwAPIVersion; + LINEEXTENSIONID ExtensionID; + LPLINEEXTENSIONID lpExtensionID; + DWORD dwDeviceID; + BOOL fTestPassed = TRUE; + LONG lRet; + char szAppName[10]; + + + hInstance = (HINSTANCE) GetModuleHandle("trapper.exe"); + strcpy(szAppName, "tcore.dll"); + lphLineApp = &hLineApp; + lpfnCallback = TestCallback; + lpszAppName = &szAppName[0]; + lpdwNumDevs = &dwNumDevs; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineInitalize"); + + // Initialize a line app + lRet = lineInitialize (lphLineApp, hInstance, lpfnCallback, lpszAppName, lpdwNumDevs); + TapiLogDetail( + DBUG_SHOW_DETAIL, + " lRet = %lx", lRet); + if(lRet != 0) + { + fTestPassed = FALSE; + } + + + dwDeviceID = 0; + dwAPILowVersion = LOW_APIVERSION; + dwAPIHighVersion = HIGH_APIVERSION; + lpdwAPIVersion = &dwAPIVersion; + lpExtensionID = &ExtensionID; + + + // Negotiate the API Version + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> lineNegotiateAPIVersion"); + + + lRet = lineNegotiateAPIVersion( + hLineApp, + dwDeviceID, + dwAPILowVersion, + dwAPIHighVersion, + lpdwAPIVersion, + lpExtensionID); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " lRet = %lx", lRet); + if(lRet != 0) + { + fTestPassed = FALSE; + } + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> lineShutdown"); + + // Shutdown and end the tests + lRet = lineShutdown(hLineApp); + TapiLogDetail( + DBUG_SHOW_DETAIL, + " lRet = %lx", lRet); + if(lRet != 0) + { + fTestPassed = FALSE; + } + + + + return fTestPassed; +} + +VOID +WINAPI +TestCallback( + DWORD hDevice, + DWORD dwMsg, + DWORD dwCallbackInstance, + DWORD dwParam1, + DWORD dwParam2, + DWORD dwParam3 + ) +{ + +; +} diff --git a/private/tapi/qa/trapper/itest/tiline/testx.c b/private/tapi/qa/trapper/itest/tiline/testx.c new file mode 100644 index 000000000..a65b2a78f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/testx.c @@ -0,0 +1,83 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + test.c + +Abstract: + + This module contains the test functions for lineTest + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + + + +// lineTest +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTestX(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineTest"); + + // Initialize a line app + if(! DoLineInitialize (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/testy.c b/private/tapi/qa/trapper/itest/tiline/testy.c new file mode 100644 index 000000000..b5a62dc30 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/testy.c @@ -0,0 +1,95 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + test.c + +Abstract: + + This module contains the test functions for lineTest + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "iline.h" + + + +// lineTest +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTestY(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineTest"); + + // Initialize a line app + if(! DoLineInitialize (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tiline/tiline.def b/private/tapi/qa/trapper/itest/tiline/tiline.def new file mode 100644 index 000000000..46c5ff13f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/tiline.def @@ -0,0 +1,25 @@ +LIBRARY tiline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 diff --git a/private/tapi/qa/trapper/itest/tiline/tiline.inc b/private/tapi/qa/trapper/itest/tiline/tiline.inc new file mode 100644 index 000000000..b1f7c106a --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/tiline.inc @@ -0,0 +1,69 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tiline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + +DLLDEF= ..\tiline.def +DLLBASE=0x68000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + +USE_CRTDLL=1 + +SOURCES=..\iline.c \ + ..\itlac.c \ + ..\itlas.c \ + ..\itlbt.c \ + ..\itlfw.c \ + ..\itlfw1.c \ + ..\itlfw2.c \ + ..\itlruui.c \ + ..\itlsuui.c \ + ..\itlst.c \ + ..\itlct.c \ + ..\itlnev.c \ + ..\itlh.c \ + ..\itluh.c \ + ..\itlsas.c \ + ..\uline.c \ + ..\version.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=TILineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tiline/uline.c b/private/tapi/qa/trapper/itest/tiline/uline.c new file mode 100644 index 000000000..56e823f93 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/uline.c @@ -0,0 +1,217 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the uninitialized testcases for all the iline apis + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + + Rama Koneru (a-ramako) 4-3-96 modified this for the ILINE set of APIs + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "iline.h" + + +char szApiName[12][48] = + { + "lineAccept", + "lineAnswer", + "lineBlindTransfer", + "lineCompleteTransfer", + "lineForward", + "lineReleaseUserUserInfo", + "lineSendUserUserInfo", + "lineNegotiateExtVersion", + "lineSetupTransfer", + "lineHold", + "lineSetAppSpecific", + "lineUnhold" + }; + + +BOOL TestLineUninitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + + // + // Allocate more than enough to store a call handle + // + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing Uninitialized Cases <<<<<<<<" + ); + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + // + // Test for UNINITIALIZED if this is the only TAPI app running + // + + if (fStandAlone) + { + for(n = 0; n < 12; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineAnswer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 1: + if (! DoLineAccept(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineBlindTransfer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + + case 4: + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 5: + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 6: + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 7: + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 9: + if (! DoLineHold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 10: + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 11: + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + + diff --git a/private/tapi/qa/trapper/itest/tiline/version.rc b/private/tapi/qa/trapper/itest/tiline/version.rc new file mode 100644 index 000000000..95300ae2d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tiline/version.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI ILINE Library" +#define VER_INTERNALNAME_STR "tiline.dll" +#define VER_ORIGINALFILENAME_STR "tiline.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/tline20/dirs b/private/tapi/qa/trapper/itest/tline20/dirs new file mode 100644 index 000000000..45c8c70cb --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/dirs @@ -0,0 +1,2 @@ +DIRS= tline20a \ + tline20w diff --git a/private/tapi/qa/trapper/itest/tline20/itlas.c b/private/tapi/qa/trapper/itest/tline20/itlas.c new file mode 100644 index 000000000..33358ce5c --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlas.c @@ -0,0 +1,917 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlas.c + +Abstract: + + This module contains the test functions for lineAgentSpecific + +Author: + + Xiao Ying Ding (XiaoD) 21-Dec-1995 + +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 "line20.h" + + +#define NUMTOTALSIZES 5 + + +// lineAgentSpecific +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad dwAgentExtensionIDIndex +// 4. Bad lpParams +// 5. Bad dwSize +// 6. Open with no PROXY request +// +// * = Stand-alone test case +// +// + +BOOL TestLineAgentSpecific(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + DWORD dwFixedSize = BIGBUFSIZE; + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineAgentSpecific"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineAgentSpecific go/no-go test", + dwTestCase+1); + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + WaitForAllMessages(); + } + + fTestPassed = ShowTestCase(fTestPassed); + // + // close line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hLine", + dwTestCase+1); + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineAgentSpecific(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwAgentExtensionIDIndex. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwAgentExtensionIDIndex", + dwTestCase+1); + + // + // Bad dwAgentExtensionIDIndex + // + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = (DWORD)-1; + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, + TAPISUCCESS,//LINEERR_INVALAGENTID, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpParams. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0x100; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpParam", + dwTestCase+1); + + // + // Bad lpParam + // + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiLineTestInfo->lpParams = (LPVOID)gdwInvalidPointers[i]; + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; +/* + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; +*/ + lpTapiLineTestInfo->lpParams = (LPVOID) AllocFromTestHeap(BIGBUFSIZE); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->dwSize = 0x7FFFFFFF; + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } +*/ + for (i = 0; i < NUMTOTALSIZES; i++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[i]; + if(dwTotalSizes[i] < dwFixedSize) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[i]); + if (! DoLineAgentSpecific(lpTapiLineTestInfo, lExpected, FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSize = dwFixedSize; + + // + // close line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Open with no PROXY request. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + 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; + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineAgentSpecific unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER ;//| + //LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Open with no PROXY request", + dwTestCase+1); + + // + // Bad lpParam + // + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, + LINEERR_OPERATIONUNAVAIL, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineAgentSpecific: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineAgentSpecific <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlgaal.c b/private/tapi/qa/trapper/itest/tline20/itlgaal.c new file mode 100644 index 000000000..dc9f5bd7b --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlgaal.c @@ -0,0 +1,974 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgaal.c + +Abstract: + + This module contains the test functions for lineGetAgentActivityList + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + +#define NUMTOTALSIZES 5 + + +// lineGetAgentActivityList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad dwAddressID +// 4. Bad lpAgentGroupList +// 5. Bad dwTotalSize +// 6. Open with no proxy request +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentActivityList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + DWORD dwFixedSize = sizeof(LINEAGENTACTIVITYLIST); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineGetAgentActivityList"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go / No Go test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = sizeof(LINEAGENTACTIVITYLIST); + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL, "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwNumEntries = 2; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwNumEntries = %lx", + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize, + lpTapiLineTestInfo->lpAgentActivityList->dwNeededSize, + lpTapiLineTestInfo->lpAgentActivityList->dwNumEntries); + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = + sizeof(LINEAGENTACTIVITYLIST); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLine", + dwTestCase+1); + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwAddressID. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = + sizeof(LINEAGENTACTIVITYLIST); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID = -1", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = (DWORD)-1; + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID = dwNumAddress", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpAgentActivityList. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentActivityList", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpAgentActivityList = + (LPLINEAGENTACTIVITYLIST) gdwInvalidPointers[i]; + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpAgentActivityList->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentActivityList->dwTotalSiz", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = 0; + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentActivityList->dwTotalSize=fixedSize-1", + dwTestCase+1); + + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = + sizeof(LINEAGENTACTIVITYLIST)-1; + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentActivityList->dwTotalSize=realBig", + dwTestCase+1); + + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = 0x7FFFFFFF; + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } +*/ + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = 0x7FFFFFFF; + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: open with no proxy request. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Open with no Proxy request", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = sizeof(LINEAGENTACTIVITYLIST); + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, + LINEERR_OPERATIONUNAVAIL, + TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineGetAgentActivityList: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineGetAgentActivityList <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlgac.c b/private/tapi/qa/trapper/itest/tline20/itlgac.c new file mode 100644 index 000000000..352cb5172 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlgac.c @@ -0,0 +1,1307 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgac.c + +Abstract: + + This module contains the test functions for lineGetAgentCaps + +Author: + + Xiao Ying Ding (XiaoD) 21-Dec-1995 + +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 "line20.h" + +#define NUMTOTALSIZES 5 + + + +// lineGetAgentCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLineApp +// 3. Bad dwDeviceID +// 4. Bad dwAddressID +// 5. Bad dwAppAPIVersion +// 6. Bad lpAgentCaps +// 7. Bad dwTotalSize +// 8. Open with no proxy request +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + DWORD dwFixedSize = sizeof(LINEAGENTCAPS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineGetAgentCaps"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go / No Go test", + dwTestCase+1); + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentCaps.AgentCaps.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentCaps.AgentCaps.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentCaps.AgentCaps.dwFeatures = LINEAGENTFEATURE_GETAGENTGROUP; + lpTapiLineTestInfo->dwResult = 0; + + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwFeatures = %lx", + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize, + lpTapiLineTestInfo->lpAgentCaps->dwNeededSize, + lpTapiLineTestInfo->lpAgentCaps->dwFeatures); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLineApp. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLineApp", + dwTestCase+1); + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + // + // save previous hLineApp + // + + lpTapiLineTestInfo->hLineApp_Orig = lpTapiLineTestInfo->hLineApp1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLineApp = (HLINEAPP)gdwInvalidHandles[i]; + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INVALAPPHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLineApp1 = lpTapiLineTestInfo->hLineApp_Orig; + + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwDeviceID. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + // + // Bad dwDeviceID + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwDeviceID=-1", + dwTestCase+1); + + lpTapiLineTestInfo->dwDeviceID = (DWORD)-1; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_BADDEVICEID, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwDeviceID=dwNumDevs", + dwTestCase+1); + + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_BADDEVICEID, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwAddressID. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + // + // Bad dwAddressID + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID=-1", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = (DWORD)-1; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID= dwNumAddress", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwAppAPIVersion. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAPIVersion(high)", + dwTestCase+1); + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + + // + // + // Bad dwAPIVersion + // + // + + lpTapiLineTestInfo->dwAppAPIVersion = WAYTOOHIGH_APIVERSION; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAPIVersion(low)", + dwTestCase+1); + lpTapiLineTestInfo->dwAppAPIVersion = TOOLOW_APIVERSION; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpAgentCaps. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentCaps", + dwTestCase+1); + + // + // + // Bad lpAgentCaps + // + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS)gdwInvalidPointers[i]; + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad lpAgentCaps->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + + + // + // + // Bad lpAgentCaps->dwTotalSize + // + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentCaps->dwTotalSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = 0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentCaps->dwTotalSize=fixed_size-1", + dwTestCase+1); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS)-1; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentCaps->dwTotalSize=real big", + dwTestCase+1); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = 0x7FFFFFFF; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } +*/ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = dwFixedSize; + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Open with no Proxy request. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Open with no proxy request", + dwTestCase+1); + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_OPERATIONUNAVAIL, + TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineGetAgentCaps: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineGetAgentCaps <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlgagl.c b/private/tapi/qa/trapper/itest/tline20/itlgagl.c new file mode 100644 index 000000000..37cf9d82f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlgagl.c @@ -0,0 +1,982 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgagl.c + +Abstract: + + This module contains the test functions for lineGetAgentGroupList + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + +#define NUMTOTALSIZES 5 + + +// lineGetAgentGroupList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad dwAddressID +// 4. Bad lpAgentGroupList +// 5. Bad dwTotalSize +// 6. Open with no Proxy request +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentGroupList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + DWORD dwFixedSize = sizeof(LINEAGENTGROUPLIST); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineGetAgentGroupList"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go/No Go Test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentGroupList.GroupList.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentGroupList.GroupList.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentGroupList.GroupList.dwNumEntries = 2; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwNumEntries = %lx", + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize, + lpTapiLineTestInfo->lpAgentGroupList->dwNeededSize, + lpTapiLineTestInfo->lpAgentGroupList->dwNumEntries); + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLine", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwAddressID. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID=-1", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = (DWORD)-1; + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID= dwNumAddress", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpAgentGroupList. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentGroupList", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiLineTestInfo->lpAgentGroupList = + (LPLINEAGENTGROUPLIST)gdwInvalidPointers[i]; + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwTotalSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = 0; + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwTotalSize=fixed_size-1", + dwTestCase+1); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = + sizeof(LINEAGENTGROUPLIST)-1; + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwTotalSize=real big", + dwTestCase+1); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = 0x7FFFFFFF; + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } +*/ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = dwFixedSize; + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Open with no Proxy request. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER ; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTGROUPLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Open with no Proxy request", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineGetAgentGroupList: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineGetAgentGroupList <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlgas.c b/private/tapi/qa/trapper/itest/tline20/itlgas.c new file mode 100644 index 000000000..5a505fcf4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlgas.c @@ -0,0 +1,879 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgas.c + +Abstract: + + This module contains the test functions for lineGetAgentStatus + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + +#define NUMTOTALSIZES 5 + + +// lineGetAgentStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad dwAddressID +// 4. Bad lpAgentStatus +// 5. Bad dwTotalSizw +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + DWORD dwFixedSize = sizeof(LINEAGENTSTATUS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineGetAgentStatus"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go/No Go Test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL, "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentStatus.AgentStatus.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentStatus.AgentStatus.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentStatus.AgentStatus.dwActivityID = 1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwActivityID = %lx", + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize, + lpTapiLineTestInfo->lpAgentStatus->dwNeededSize, + lpTapiLineTestInfo->lpAgentStatus->dwActivityID); + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLine", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwAddressID. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID=-1", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = (DWORD)-1; + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwAddressID= dwNumAddress", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_INVALADDRESSID, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpAgentStatus. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpAgentStatus", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiLineTestInfo->lpAgentStatus = + (LPLINEAGENTSTATUS)gdwInvalidPointers[i]; + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get lineDevCaps + // + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwTotalSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = 0; + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwTotalSize=fixed_size-1", + dwTestCase+1); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = + sizeof(LINEAGENTSTATUS)-1; + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwTotalSize=real big", + dwTestCase+1); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = 0x7FFFFFFF; + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } +*/ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = dwFixedSize; + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineGetAgentStatus: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineGetAgentStatus <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlgm.c b/private/tapi/qa/trapper/itest/tline20/itlgm.c new file mode 100644 index 000000000..9ed7cceac --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlgm.c @@ -0,0 +1,366 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgm.c + +Abstract: + + This module contains the test functions for lineGetMessage + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "line20.h" + + + +// lineGetMessage +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLineApp +// 3. Bad lpMessage +// +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetMessage(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n*********************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineGetMessage"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEEVENT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + 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, FALSE)) + { + TLINE_FAIL(); + } + + WaitForAllMessages(); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go/No-Go Test", + dwTestCase+1); + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE) AllocFromTestHeap ( + sizeof(LINEMESSAGE)); + + if(! DoLineGetMessage (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: hDevice = %lx, dwMessageID = %lx, dwCallbackInst = %lx", + lpTapiLineTestInfo->lpMessage->hDevice, + lpTapiLineTestInfo->lpMessage->dwMessageID, + lpTapiLineTestInfo->lpMessage->dwCallbackInstance); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: dwParam1 = %lx, dwParam2 = %lx, dwParam3 = %lx", + lpTapiLineTestInfo->lpMessage->dwParam1, + lpTapiLineTestInfo->lpMessage->dwParam2, + lpTapiLineTestInfo->lpMessage->dwParam3); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLineApp. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEEVENT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLineApp", + dwTestCase+1); + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE) AllocFromTestHeap ( + sizeof(LINEMESSAGE)); + + // + // save previous hLineApp + // + + lpTapiLineTestInfo->hLineApp_Orig = lpTapiLineTestInfo->hLineApp1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLineApp = (HLINEAPP)gdwInvalidHandles[i]; + if (! DoLineGetMessage(lpTapiLineTestInfo, + LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLineApp1 = lpTapiLineTestInfo->hLineApp_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpMessage. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEEVENT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpMessage", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE)gdwInvalidPointers[i]; + + if (! DoLineGetMessage(lpTapiLineTestInfo,LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineGetMessage: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineGetMessage <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlie.c b/private/tapi/qa/trapper/itest/tline20/itlie.c new file mode 100644 index 000000000..4bff161fc --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlie.c @@ -0,0 +1,1898 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlie.c + +Abstract: + + This module contains the test functions for lineInitializeEx + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "line20.h" + + +#define NUMTOTALSIZES 5 + + +// lineInitializeEx +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLineApp +// 3. Bad hInstance +// 4. Bad lpfnCallback +// 5. Bad lpszFriendlyName +// 6. Inval lpszFriendlyAppName +// 7. Bad lpdwNumDevs +// 8. Bad lpdwAPIVersion +// 9. Bad lpLineInitializeExparams +// 10. Bad dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestLineInitializeEx(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + BOOL fTestPassed = TRUE; + TAPIRESULT lastTapiResult; + DWORD dwFixedSize = sizeof(LINEINITIALIZEEXPARAMS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n**************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineInitializeEx"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Go/No-Go test", + dwTestCase+1); + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLineApp. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hLineApp", + dwTestCase+1); + + // + // Test invalid hLineApp + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lphLineApp = (LPHLINEAPP)gdwInvalidPointers[i]; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 3. Test Case: hLineApp == lpdwNumDevs + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: hLineApp == lpdwNumDevs", + dwTestCase+1); + + // + // Test invalid hLineApp + // + + lpTapiLineTestInfo->lphLineApp = + (LPHLINEAPP)lpTapiLineTestInfo->lpdwNumDevs; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 4. Test Case: hLineApp == lpdwAPIVersion + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: hLineApp == lpdwAPIVersion", + dwTestCase+1); + + // + // Test invalid hLineApp + // + + lpTapiLineTestInfo->lphLineApp = + (LPHLINEAPP)lpTapiLineTestInfo->lpdwAPIVersion; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 5. Test Case: hLineApp == lpLineInitializeExParams + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: hLineApp == lpLineInitializeExParams", + dwTestCase+1); + + // + // Test invalid hLineApp + // + + lpTapiLineTestInfo->lphLineApp = + (LPHLINEAPP)lpTapiLineTestInfo->lpLineInitializeExParams; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad hInstance. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hInstance", + dwTestCase+1); + + // + // save previous hInstance + // + + lpTapiLineTestInfo->hInstance_Orig = lpTapiLineTestInfo->hInstance; + + // + // Test invalid handles + // + + for(i = 1; i < NUMINVALIDHANDLES; i++) + { + lpTapiLineTestInfo->hInstance = (HINSTANCE)gdwInvalidHandles[i]; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + // + // Reset hInstance + // + + lpTapiLineTestInfo->hInstance = lpTapiLineTestInfo->hInstance_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad lpfnCallback. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpfnCallback", + dwTestCase+1); + + // + // Test invalid lpfnCallback + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpfnCallback = + (LINECALLBACK)gdwInvalidPointers[i]; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Bad lpszFriendlyAppName. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + +#ifdef WUNICODE + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpwszFriendlyAppName", + dwTestCase+1); +#else + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpszFriendlyAppName", + dwTestCase+1); +#endif + + // + // Test invalid lpszFriendlyAppName + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFriendlyAppName = + (LPWSTR)gdwInvalidPointers[i]; +#else + lpTapiLineTestInfo->lpszFriendlyAppName = + (LPSTR)gdwInvalidPointers[i]; +#endif + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 9. Test Case: Bad lpszFriendlyAppName. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + +#ifdef WUNICODE + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpwszFriendlyAppName", + dwTestCase+1); +#else + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpszFriendlyAppName", + dwTestCase+1); +#endif + + // + // Test invalid lpszAppName + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFriendlyAppName = + (LPWSTR)gdwInvalidPointers[i]; +#else + lpTapiLineTestInfo->lpszFriendlyAppName = + (LPSTR)gdwInvalidPointers[i]; +#endif + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 10. Test Case: Bad lpdwNumDevs. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwNumDevs", + dwTestCase+1); + + // + // Test invalid lpdwNumDevs + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpdwNumDevs = + (LPDWORD)gdwInvalidPointers[i]; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 11. Test Case: lpdwNumDevs == lpdwAPIVersion + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwNumDevs == lpdwAPIVersion", + dwTestCase+1); + + // + // Test invalid lpdwNumDevs + // + + lpTapiLineTestInfo->lpdwNumDevs = + (LPDWORD) lpTapiLineTestInfo->lpdwAPIVersion; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 12. Test Case: lpdwNumDevs == lpLineInitializeExParams + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwNumDevs == lpLineInitializeExParams", + dwTestCase+1); + + // + // Test invalid lpdwNumDevs + // + + lpTapiLineTestInfo->lpdwNumDevs = + (LPDWORD) lpTapiLineTestInfo->lpLineInitializeExParams; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 13. Test Case: Bad lpdwAPIVersion. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwAPIVersion", + dwTestCase+1); + + // + // Test invalid lpdwAPIVersion + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpdwAPIVersion = + (LPDWORD)gdwInvalidPointers[i]; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 14. Test Case: lpdwAPIVersion == lpLineInitializeExParams + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwAPIVersion == lpLineInitializeExParams", + dwTestCase+1); + + // + // Test invalid lpdwAPIVersion + // + + lpTapiLineTestInfo->lpdwAPIVersion = + (LPDWORD) lpTapiLineTestInfo->lpLineInitializeExParams; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 15. Test Case: Bad lpLineInitializeExParams. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpLineInitializeExParams", + dwTestCase+1); + + // + // Test invalid lpLineInitializeExParams + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS)gdwInvalidPointers[i]; + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 16. Test Case: Bad dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); +// lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = +// sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", + dwTestCase+1); + +/* + + + // + // lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = 0; + // + + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = 0; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=fixedSize-1", + dwTestCase+1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS)-1; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=real big", + dwTestCase+1); + + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = 0x7FFFFFFF; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + + // + // if we initialized successfully,i.e lineInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + +*/ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineInitializeEx(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = dwFixedSize; + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 17. Test Case:Null (valid) lpLineInitializeExParams. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Null (valid) lpLineInitializeExParams", + dwTestCase+1); + + // + // Test valid Null lpLineInitializeExParams + // + + lpTapiLineTestInfo->lpLineInitializeExParams = NULL; + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 18. Test Case: forward compatibility + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020001; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0xfffffffc & LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Forward compatibility", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + TapiLogDetail( + DBUG_SHOW_PASS, + "dwAPIVersion = %lx", + lpTapiLineTestInfo->dwAPIVersion); + + if(lpTapiLineTestInfo->dwAPIVersion == 0x00020000) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + 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 + + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 19. Test Case: verify 3 options in lpLineInitParam + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0xfffffffc & LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Verify 3 options: USECOMPLETIONPORT", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + 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 + + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 20. Test Case: verify 3 options in lpLineInitParam + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0xfffffffc & LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Verify 3 options: USEHIDDENWINDOW", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + 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 + + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 21. Test Case: verify 3 options in lpLineInitParam + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0xfffffffc & LINEINITIALIZEEXOPTION_USEEVENT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Verify 3 options: USEEVENT", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + 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 + + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 22. Test Case: verify uppart bits in options ignor + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0xfffffff0; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Verify uppart bits in options ignor", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + 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 + + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // + // 23. Test Case: verify uppart bits in options ignor + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0x0000fff1; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Verify uppart bits in options ignor", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + 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 + + + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + + // =================================================================== + // =================================================================== + // + // 24. Test Case: options 4, in lpLineInitParam should fail + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = 4; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: options 4 should fail", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + + GetLastTapiResult(&lastTapiResult); + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 25. Test Case: options 15, in lpLineInitParam should fail + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00020000; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = 15; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: options 15 should fail", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + + GetLastTapiResult(&lastTapiResult); + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 26. Test Case: Anything < 20000 should fail + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a line app + // + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = 0x00010004; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS) + 1); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS) + 1; + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + 0xfffffffc & LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Anything < 2000 should fail", + dwTestCase+1); + + if (! DoLineInitializeEx(lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + + GetLastTapiResult(&lastTapiResult); + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineInitializeEx: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineInitializeEx <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlpm.c b/private/tapi/qa/trapper/itest/tline20/itlpm.c new file mode 100644 index 000000000..7dacf67d1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlpm.c @@ -0,0 +1,800 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpm.c + +Abstract: + + This module contains the test functions for lineProxyMessage + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "line20.h" + + + +// lineProxyMessage +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad hCall +// 4. Bad dwMsg +// 5. Bad dwParam1 +// 6. Bad dwParam2 +// 7. Bad dwParam3 +// 8. Open with no PROXY request +// +// * = Stand-alone test case +// +// + +BOOL TestLineProxyMessage(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineProxyMessage"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## ProxyMessage: unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineProxyMessage for go/no-go", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## ProxyMessage: unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hLine", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineProxyMessage(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwMsg + // 4. Bad dwParam1 + // 5. Bad dwParam2 + // 6. Bad dwParam3 + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## ProxyMessage: unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwMsg", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = (DWORD)~LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwParam1", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0xFFFFFFFF; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwParam2", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = (DWORD)~0x1FF; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwParam3", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_STATE; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Open with no proxy request + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## ProxyMessage: unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER ;//| + // LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: open with no PROXY request", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, LINEERR_NOTREGISTERED)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Bad hCall + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## ProxyMessage: unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hCall", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSPECIFIC; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = 0; + lpTapiLineTestInfo->dwParam3 = 0; + + // + // save previous hCall + // + + lpTapiLineTestInfo->hCall_Orig = lpTapiLineTestInfo->hCall1; + + // + // Test invalid handles + // + + for(i = 1; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphCall = (HCALL)gdwInvalidHandles[i]; + if (! DoLineProxyMessage(lpTapiLineTestInfo, + LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hCall + // + + lpTapiLineTestInfo->hCall1 = lpTapiLineTestInfo->hCall_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the line + // + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineProxyMessage: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineProxyMessage <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlpr.c b/private/tapi/qa/trapper/itest/tline20/itlpr.c new file mode 100644 index 000000000..ddcea7638 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlpr.c @@ -0,0 +1,689 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpr.c + +Abstract: + + This module contains the test functions for lineProxyResponse + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineProxyResponse +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad lpProxyBuffer +// 4. Bad dwResult +// 5. Call second with same lpProxyBuffer +// +// * = Stand-alone test case +// +// + +BOOL TestLineProxyResponse(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineProxyResponse"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go / No Go test", + dwTestCase+1); + + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLine", + dwTestCase+1); + // + // Get the line device capabilities + // + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiMsg = NULL; + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + + if (! DoLineProxyResponse(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + + WaitForAllMessages(); + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpProxyBuffer. + // + // =================================================================== + // =================================================================== + +/* + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpProxyBuffer", + dwTestCase+1); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + + // + // Test bad lpProxy Buffer + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST)gdwInvalidPointers[i]; + if (! DoLineProxyResponse(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwResult. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineProxyResponse unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTCAPS; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwResult", + dwTestCase+1); + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST) AllocFromTestHeap (sizeof(LINEPROXYREQUEST)); + lpTapiLineTestInfo->lpProxyRequest->dwSize = sizeof(LINEPROXYREQUEST); + lpTapiLineTestInfo->dwResult = 0; + + + + // + // Test bad dwResult + // + // + // a positive value is a bad dwResult value + // + + lpTapiLineTestInfo->dwResult = 0x100; + if (! DoLineProxyResponse(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineProxyResponse: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineProxyResponse <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlsaa.c b/private/tapi/qa/trapper/itest/tline20/itlsaa.c new file mode 100644 index 000000000..9097ce4f5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlsaa.c @@ -0,0 +1,627 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgaal.c + +Abstract: + + This module contains the test functions for lineSetAgentActivity + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + + + +// lineSetAgentActivity +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad dwAddressId +// 4. Bad dwActivity +// 5. Open with no Proxy Request +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAgentActivity(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test LineSetAgentActivity"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentActivity unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTACTIVITY; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go / No Go test", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwActivityID = 1; + + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = + (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentActivity unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTACTIVITY; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hLine", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwActivityID = 1; + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwActivityID. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentActivity unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTACTIVITY; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad dwActivityID", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + // + // Bad dwActivityID + // + + lpTapiLineTestInfo->dwActivityID = (DWORD)-1; + + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, + TAPISUCCESS,//LINEERR_INVALAGENTACTIVITY, + TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Open with No Proxy Request. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentActivity unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER ; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTACTIVITY; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Open with no proxy request", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwActivityID = 1; + + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, + LINEERR_OPERATIONUNAVAIL, + TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineSetAgentActivity: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineSetAgentActivity <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlsag.c b/private/tapi/qa/trapper/itest/tline20/itlsag.c new file mode 100644 index 000000000..3748a3015 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlsag.c @@ -0,0 +1,828 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsag.c + +Abstract: + + This module contains the test functions for lineSetAgentGroup + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + +#define NUMTOTALSIZES 5 + + +// lineSetAgentGroup +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. Bad lpAgentGroupList +// 4. Bad dwTotalSize +// 5. Set dwOffSet To different Value +// 6. Open wirh no Proxy Request +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAgentGroup(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i, n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + DWORD dwFixedSize = sizeof(LINEAGENTGROUPLIST); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test LineSetAgentGroup"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentGroup unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTGROUP; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Go/No-Go Test", + dwTestCase+1); + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentGroup unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTGROUP; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hLine", + dwTestCase+1); + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpAgentGroupList. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentGroup unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTGROUP; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpAgentGroupList", + dwTestCase+1); + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiLineTestInfo->lpAgentGroupList = + (LPLINEAGENTGROUPLIST)gdwInvalidPointers[i]; + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentGroup unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTGROUP; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", + dwTestCase+1); + +/* + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = 0; + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = + sizeof(LINEAGENTGROUPLIST)-1; + + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=fixedSize-1", + dwTestCase+1); + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL, + FALSE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = 0x7FFFFFFF; + + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=realbig", + dwTestCase+1); + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_INVALPOINTER, + FALSE)) + { + TLINE_FAIL(); + } +*/ + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = 0x7FFFFFFF; + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Open with no proxy request. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentGroup unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTGROUP; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Open with no proxy request", + dwTestCase+1); + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_OPERATIONUNAVAIL, + TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineSetAgentGroup: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineSetAgentGroup <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/itlsas.c b/private/tapi/qa/trapper/itest/tline20/itlsas.c new file mode 100644 index 000000000..d16c911c7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/itlsas.c @@ -0,0 +1,949 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsas.c + +Abstract: + + This module contains the test functions for lineSetAgentState + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + +#define ALLAGENTSTATE (LINEAGENTSTATE_LOGGEDOFF | \ + LINEAGENTSTATE_NOTREADY | \ + LINEAGENTSTATE_READY | \ + LINEAGENTSTATE_BUSYACD | \ + LINEAGENTSTATE_BUSYINCOMING | \ + LINEAGENTSTATE_BUSYOUTBOUND | \ + LINEAGENTSTATE_BUSYOTHER | \ + LINEAGENTSTATE_WORKINGAFTERCALL | \ + LINEAGENTSTATE_UNKNOWN | \ + LINEAGENTSTATE_UNAVAIL) + + +// lineSetAgentState +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hLine +// 3. BitVectorParamErrorTest for dwAgentState +// 4. BitVectorParamErrorTest for dwNextAgentState +// 5. BitVectorParamValidTest for dwAgentState +// 6. BitVectorParamValidTest for dwNextAgentState +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAgentState(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test LineSetAgentState"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Go/No-Go Test", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + if (! DoLineSetAgentState(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; +// lpMatch->dwParam1 = (DWORD) lpProxyBuffer; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail(DBUG_SHOW_DETAIL,"##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, + 0, + 0, + 0, + lpTapiLineTestInfo->dwResult, + 0, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hLine. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hLine", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + // + // save previous hLine + // + + lpTapiLineTestInfo->hLine_Orig = lpTapiLineTestInfo->hLine1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiLineTestInfo->lphLine = (HLINE)gdwInvalidHandles[i]; + if (! DoLineSetAgentState(lpTapiLineTestInfo, + LINEERR_INVALLINEHANDLE, + FALSE)) + { + TLINE_FAIL(); + } + } + + // + // Reset hLine + // + + lpTapiLineTestInfo->hLine1 = lpTapiLineTestInfo->hLine_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: BitVectorParamErrorTest for dwAgentState. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld:BitVectorParamErrorTest for dwAgentState", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = 0; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + // + // BitVectorParamErrorTest for dwAgentState + // + + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetAgentState, + (LPDWORD) &lpTapiLineTestInfo->dwAgentState, + LINEERR_INVALAGENTSTATE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_16, + ALLAGENTSTATE, + ~dwBitVectorMasks[(int) FIELDSIZE_16], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: BitVectorParamErrorTest for dwNextAgentState. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld:BitVectorParamErrorTest for dwNextAgentState", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = 0; + + // + // BitVectorParamErrorTest for dwNextAgentState + // + + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetAgentState, + (LPDWORD) &lpTapiLineTestInfo->dwNextAgentState, + LINEERR_INVALAGENTSTATE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_16, + ALLAGENTSTATE, + ~dwBitVectorMasks[(int) FIELDSIZE_16], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: BitVectorParamValidTest for dwAgentState. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld:BitVectorParamValidTest for dwAgentState", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = 0; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + // + // BitVectorParamValidTest for dwAgentState + // + + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetAgentState, + (LPDWORD) &lpTapiLineTestInfo->dwAgentState, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALLAGENTSTATE, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: BitVectorParamValidTest for dwNextAgentState. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + + // + // Initialize a line app + // + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = + (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## LineSetAgentState unimodem didn't support"); + return fTestPassed; + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // + // Negotiate the API Ext Version + // + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // + // Open a line + // + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_SETAGENTSTATE; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld:BitVectorParamValidTest for dwNextAgentState", + dwTestCase+1); + + // + // Set the line device capabilities + // + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = 0; + + // + // BitVectorParamValidTest for dwNextAgentState + // + + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetAgentState, + (LPDWORD) &lpTapiLineTestInfo->dwNextAgentState, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALLAGENTSTATE, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // + // Shutdown + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineSetAgentState: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineSetAgentState <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tline20/line20.c b/private/tapi/qa/trapper/itest/tline20/line20.c new file mode 100644 index 000000000..124ed2c88 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/line20.c @@ -0,0 +1,440 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + line20.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "line20.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTline20Dll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +Tline20DllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTline20Dll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninitialize(TRUE, FALSE)); +} + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineAgentSpecific(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentCaps(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentActivityList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentGroupList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentStatus(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineProxyMessage(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineProxyResponse(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAgentActivity(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAgentGroup(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAgentState(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineInitializeEx(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineGetMessage(TRUE, FALSE)); +} + + + +VOID +TapiShowProxyBuffer( LPLINEPROXYREQUEST lpProxyBuffer) +{ + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## lpProxyBuffer = %lx", + lpProxyBuffer); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwSize = %lx, dwRequestType = %lx", + lpProxyBuffer->dwSize, + lpProxyBuffer->dwRequestType); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwClientMachineNameSize = %lx, dwClientMachineNameOffset = %lx", + lpProxyBuffer->dwClientMachineNameSize, + lpProxyBuffer->dwClientMachineNameOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwClientUserNameSize = %lx, dwClientUserNameOffset = %lx", + lpProxyBuffer->dwClientUserNameSize, + lpProxyBuffer->dwClientUserNameOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwClientAppAPIVersion = %lx", + lpProxyBuffer->dwClientAppAPIVersion); + + /* + TapiLogDetail( + DBUG_SHOW_DETAIL, + "username= %ls", + ((LPBYTE)lpProxyBuffer)+lpProxyBuffer->dwClientUserNameOffset); + */ + + TapiShowAgent(lpProxyBuffer); +} + + +VOID +TapiShowAgent(LPLINEPROXYREQUEST lpProxyBuffer) +{ + switch(lpProxyBuffer->dwRequestType) + { + case LINEPROXYREQUEST_SETAGENTGROUP: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->SetAgentGroup.GroupList.dwTotalSize, + lpProxyBuffer->SetAgentGroup.GroupList.dwNeededSize); + break; + + case LINEPROXYREQUEST_SETAGENTSTATE: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwAgentState = %lx, dwNextAgentState = %lx", + lpProxyBuffer->SetAgentState.dwAgentState, + lpProxyBuffer->SetAgentState.dwNextAgentState); + break; + + case LINEPROXYREQUEST_SETAGENTACTIVITY: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwAddressID = %lx, dwActivityID = %lx", + lpProxyBuffer->SetAgentActivity.dwAddressID, + lpProxyBuffer->SetAgentActivity.dwActivityID); + break; + + + case LINEPROXYREQUEST_GETAGENTCAPS: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentCaps.AgentCaps.dwTotalSize, + lpProxyBuffer->GetAgentCaps.AgentCaps.dwNeededSize); + break; + + case LINEPROXYREQUEST_GETAGENTSTATUS: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentStatus.AgentStatus.dwTotalSize, + lpProxyBuffer->GetAgentStatus.AgentStatus.dwNeededSize); + break; + + case LINEPROXYREQUEST_AGENTSPECIFIC: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwAgentExtensionIDIndex = %lx", + lpProxyBuffer->AgentSpecific.dwAgentExtensionIDIndex); + break; + + case LINEPROXYREQUEST_GETAGENTACTIVITYLIST: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentActivityList.ActivityList.dwTotalSize, + lpProxyBuffer->GetAgentActivityList.ActivityList.dwNeededSize); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwNumentries = %lx", + lpProxyBuffer->GetAgentActivityList.ActivityList.dwNumEntries); + + break; + + case LINEPROXYREQUEST_GETAGENTGROUPLIST: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentGroupList.GroupList.dwTotalSize, + lpProxyBuffer->GetAgentGroupList.GroupList.dwNeededSize); + break; + + } + +} + + +BOOL +ShouldTapiPhoneTestAbort(BOOL fQuiteMode) +{ + return FALSE; +} diff --git a/private/tapi/qa/trapper/itest/tline20/line20.h b/private/tapi/qa/trapper/itest/tline20/line20.h new file mode 100644 index 000000000..e698d4c2a --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/line20.h @@ -0,0 +1,266 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + line20.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 29-Jan-1996 + +Revision History: + +--*/ + + +#ifndef LINE20_H +#define LINE20_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineAgentSpecific( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentActivityList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentGroupList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAgentStatus( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineProxyMessage( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineProxyResponse( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineSetAgentActivity( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAgentGroup( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAgentState( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineInitializeEx( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineGetMessage( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineUninitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ); + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ); + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ); + +VOID +TapiShowProxyBuffer( LPLINEPROXYREQUEST); + +VOID +TapiShowAgent(LPLINEPROXYREQUEST ); + + + +#endif // LINE20_H diff --git a/private/tapi/qa/trapper/itest/tline20/tline20.def b/private/tapi/qa/trapper/itest/tline20/tline20.def new file mode 100644 index 000000000..1f5fc2791 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/tline20.def @@ -0,0 +1,23 @@ +LIBRARY tline20 + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 diff --git a/private/tapi/qa/trapper/itest/tline20/tline20.inc b/private/tapi/qa/trapper/itest/tline20/tline20.inc new file mode 100644 index 000000000..914f58c54 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/tline20.inc @@ -0,0 +1,69 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tline20 +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLDEF=..\tline20.def +DLLBASE=0x69000000 + +INCLUDES=..\..;..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES=..\line20.c \ + ..\itlas.c \ + ..\itlgac.c \ + ..\itlgaal.c \ + ..\itlgagl.c \ + ..\itlgas.c \ + ..\itlpm.c \ + ..\itlpr.c \ + ..\itlsaa.c \ + ..\itlsag.c \ + ..\itlsas.c \ + ..\itlie.c \ + ..\itlgm.c \ + ..\uline.c \ + ..\version.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=Tline20DllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tline20/tline20a/makefile b/private/tapi/qa/trapper/itest/tline20/tline20a/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/tline20a/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tline20/tline20a/sources b/private/tapi/qa/trapper/itest/tline20/tline20a/sources new file mode 100644 index 000000000..21e4d3e10 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/tline20a/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tline20.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/tline20/tline20w/makefile b/private/tapi/qa/trapper/itest/tline20/tline20w/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/tline20w/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tline20/tline20w/sources b/private/tapi/qa/trapper/itest/tline20/tline20w/sources new file mode 100644 index 000000000..9a7595268 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/tline20w/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tline20.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tline20/uline.c b/private/tapi/qa/trapper/itest/tline20/uline.c new file mode 100644 index 000000000..c7b0e3313 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/uline.c @@ -0,0 +1,431 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpr.c + +Abstract: + + This module contains the test functions for lineProxyResponse + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +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 "line20.h" + +// +// UnInitialize tests +// + +BOOL TestLineUninitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineUninitialize"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: lineAgentSpecific uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineAgentSpecific uninit test", + dwTestCase+1); + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: LineGetAgentActivityList uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentActivityList uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = + sizeof(LINEAGENTACTIVITYLIST); + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: LineGetAgentCaps uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentCaps uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: LineGetAgentGroupList uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentGroupList uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = + (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = + sizeof(LINEAGENTGROUPLIST); + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: LineGetAgentStatus uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentStatus uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: LineGetMessage uninit test(returns INVALAPPHANDLE). + // see raid bug #33177(4/10/1996) + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetMessage uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE) AllocFromTestHeap ( + sizeof(LINEMESSAGE)); + + if (! DoLineGetMessage(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: LineProxyMessage uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineProxyMessage uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: LineProxyResponse uninit test(returns INVALPOINTER). + // see raid bug #33177(4/10/1996) + // + // =================================================================== + // =================================================================== + +/* + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineProxyResponse uninit test", + dwTestCase+1); + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) AllocFromTestHeap( + sizeof(LINEPROXYREQUEST)); + lpTapiLineTestInfo->lpProxyRequest->dwSize = sizeof(LINEPROXYREQUEST); + if (! DoLineProxyResponse(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); +*/ + + // =================================================================== + // =================================================================== + // + // 9. Test Case: LineSetAgentActivity uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineSetAgentActivity uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwActivityID = 1; + + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + // =================================================================== + // =================================================================== + // + // 10. Test Case: LineSetAgentGroup uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineSetAgentGroup uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 11. Test Case: LineSetAgentState uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineSetAgentState uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + if (! DoLineSetAgentState(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineUnitialize: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineUnitialize <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tline20/version.rc b/private/tapi/qa/trapper/itest/tline20/version.rc new file mode 100644 index 000000000..420f96b38 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tline20/version.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI Line 2.0 API test Library" +#define VER_INTERNALNAME_STR "tline20.dll" +#define VER_ORIGINALFILENAME_STR "tline20.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/tphone/dirs b/private/tapi/qa/trapper/itest/tphone/dirs new file mode 100644 index 000000000..ce1caddd0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/dirs @@ -0,0 +1,2 @@ +DIRS= tphonea \ + tphonew diff --git a/private/tapi/qa/trapper/itest/tphone/itpc.c b/private/tapi/qa/trapper/itest/tphone/itpc.c new file mode 100644 index 000000000..f30e1b55e --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpc.c @@ -0,0 +1,1553 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpc.c + +Abstract: + + This module contains the test functions for phoneClose + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + + pgopi March 1996 Added additional tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneClose +// +// The following tests are made: +// +// Test +// ----------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. *Verify Closed hPhone No longer Valid +// 3. Bad hPhone +// 4. Verify PHONESTATE_MONITOR msgs sent to other monitor on same hPhoneApp +// 5. Verify PHONESTATE_MONITOR msgs sent to owner on different hPhoneApp +// 6. Verify PHONESTATE_OWNER msgs sent to other monitor on same hPhoneApp +// 7. Verify PHONESTATE_MONITOR msgs sent to monitor on different hPhoneApp +// 8. Verify PHONESTATE_MONITOR msgs sent to owner on different hPhoneApp +// 9. Verify PHONESTATE_OWNER msgs sent to monitor on different hPhoneApp +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneClose(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + + + BOOL fTestPassed = TRUE; + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>>> Test phoneClose <<<<<<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go tests + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go Test. + // + // =================================================================== + // =================================================================== + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld for go/no-go ", + dwTestCase+1); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: This next test, tests if phoneClose returns + // PHONEERR_INVALPHONEHANDLE when an already closed handle is closed + // again(without doing a open). + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify closed hPhone no" + " longer valid(try phoneClose agaian). ", + dwTestCase+1); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + // =================================================================== + // =================================================================== + // + // 3. Test Case: The next test tries to close an invalid hPhone. + // phoneClose should return PHONEERR_INVALPHONEHANDLE. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + { + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Bad hPhone", + dwTestCase+1); + // + // Try the close of a hPhone which is invalid. + // lphPhone is initialized to point to hPhone1, so set it to an invalid + // value (e.g. the hPhoneApp value). + // + + lpTapiPhoneTestInfo->hPhone1 = + (HPHONE) *lpTapiPhoneTestInfo->lphPhoneApp; + if (! DoPhoneClose(lpTapiPhoneTestInfo, PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Verify PHONESTATE_MONITOR msgs sent to other + // monitor on same hPhoneApp. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + if(fStandAlone) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify PHONESTATE_MONITOR msgs sent" + " to other monitor on same hPhoneApp.", + dwTestCase+1); + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITORS msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_MONITORS | + PHONESTATE_OWNER; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a second monitor on with the same hPhoneApp.Save the original + // hPhone in hPhone2. + // + + lpTapiPhoneTestInfo->hPhone2 = *lpTapiPhoneTestInfo->lphPhone; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Now close the second monitor and verify that PHONESTATE_MONITORS + // status message is sent to the first monitor. + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Restore the saved hPhone2 to hPhone1. + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone2; + + // + // Add the PHONESTATE_MONITORS message to the list of expected + // messages. + // + + AddMessage( + PHONE_STATE, + (DWORD) lpTapiPhoneTestInfo->hPhone2, + (DWORD) lpCallbackParams, + PHONESTATE_MONITORS, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1) + ); + + // + // Wait for the PHONESTATE_MONITORS message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Now close the first monitor . + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown to isolate the test case + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + } + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Verify PHONESTATE_MONITOR msgs sent to + // owner on same hPhoneApp. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + if(fStandAlone) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify PHONESTATE_MONITOR msgs sent" + " to owner on same hPhoneApp.", + dwTestCase+1); + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone with owner privilege + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITORS msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_MONITORS | + PHONESTATE_OWNER; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a monitor on the same hPhoneApp.Save the original + // hPhone in hPhone2. + // + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + lpTapiPhoneTestInfo->hPhone2 = *lpTapiPhoneTestInfo->lphPhone; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Now close the monitor and verify that PHONESTATE_MONITORS + // status message is sent to the owner. + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Restore the saved hPhone2 to hPhone1. + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone2; + + // + // Add the PHONESTATE_MONITORS message to the list of expected + // messages. + // + + AddMessage( + PHONE_STATE, + (DWORD) lpTapiPhoneTestInfo->hPhone2, + (DWORD) lpCallbackParams, + PHONESTATE_MONITORS, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1) + ); + + // + // Wait for the PHONESTATE_MONITORS message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Now close the owner . + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + } + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Verify PHONESTATE_OWNER msgs sent to a + // monitor on same hPhoneApp. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + if(fStandAlone) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify PHONESTATE_OWNER msgs sent " + "to a monitor on same hPhoneApp.", + dwTestCase+1); + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITORS msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_MONITORS | + PHONESTATE_OWNER; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a owner on the same hPhoneApp.Save the original + // hPhone in hPhone2. + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + lpTapiPhoneTestInfo->hPhone2 = *lpTapiPhoneTestInfo->lphPhone; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Now close the owner and verify that PHONESTATE_OWNER + // status message is sent to the monitor. + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Restore the saved hPhone2 to hPhone1. + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone2; + + // + // Add the PHONESTATE_OWNER message to the list of expected + // messages. + // + + AddMessage( + PHONE_STATE, + (DWORD) lpTapiPhoneTestInfo->hPhone2, + (DWORD) lpCallbackParams, + PHONESTATE_OWNER, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1) + ); + + // + // Wait for the PHONESTATE_OWNER message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Now close the first monitor . + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown to isolate the test case + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + } + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Verify PHONESTATE_MONITORS msgs sent to + // monitor on different hPhoneApp. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + if(fStandAlone) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify PHONESTATE_MONITOR msgs sent " + "to monitor on different hPhoneApp.", + dwTestCase+1); + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Initialize another phoneApp, save the previous one in + // hPhoneApp2. + // + + lpTapiPhoneTestInfo->hPhoneApp2 = *lpTapiPhoneTestInfo->lphPhoneApp; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone on hPhoneApp1 + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITORS msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_MONITORS | + PHONESTATE_OWNER; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a second monitor on the different phone app (hPhoneApp2). + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Now close the second monitor and verify that PHONESTATE_MONITORS + // status message is sent to the first monitor. + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Reset the handles to hPhone1 and hPhoneApp1. + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + + // + // Add the PHONESTATE_MONITORS message to the list of expected + // messages. + // + + AddMessage( + PHONE_STATE, + (DWORD) lpTapiPhoneTestInfo->hPhone1, + (DWORD) lpCallbackParams, + PHONESTATE_MONITORS, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1) + ); + + // + // Wait for the PHONESTATE_MONITORS message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Now close the first monitor . + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown hPhoneApp1. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown hPhoneApp2. + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + } + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Verify PHONESTATE_MONITORS msgs sent to + // owner on different hPhoneApp. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + if(fStandAlone) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify PHONESTATE_MONITOR msgs sent " + "to owner on different hPhoneApp.", + dwTestCase+1); + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Initialize another phoneApp, save the previous one in + // hPhoneApp2. + // + + lpTapiPhoneTestInfo->hPhoneApp2 = *lpTapiPhoneTestInfo->lphPhoneApp; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone on hPhoneApp1 with owner privilege. + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITORS msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_MONITORS | + PHONESTATE_OWNER; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a monitor on a different phone app (hPhoneApp2). + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Now close the monitor and verify that PHONESTATE_MONITORS + // status message is sent to the owner. + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Reset the handles to hPhone1 and hPhoneApp1. + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + + // + // Add the PHONESTATE_MONITORS message to the list of expected + // messages. + // + + AddMessage( + PHONE_STATE, + (DWORD) lpTapiPhoneTestInfo->hPhone1, + (DWORD) lpCallbackParams, + PHONESTATE_MONITORS, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1) + ); + + // + // Wait for the PHONESTATE_MONITORS message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Now close the owner . + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown hPhoneApp1. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown hPhoneApp2. + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + } + + // =================================================================== + // =================================================================== + // + // 9. Test Case: Verify PHONESTATE_OWNER msgs sent to + // monitor on different hPhoneApp. + // + // =================================================================== + // =================================================================== + + fTestPassed = TRUE; + + if(fStandAlone) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Verify PHONESTATE_OWNER msgs sent " + "to monitor on different hPhoneApp.", + dwTestCase+1); + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Initialize another phoneApp, save the previous one in + // hPhoneApp2. + // + + lpTapiPhoneTestInfo->hPhoneApp2 = *lpTapiPhoneTestInfo->lphPhoneApp; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone on hPhoneApp1 + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITORS msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_MONITORS | + PHONESTATE_OWNER; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a second monitor on the different phone app (hPhoneApp2). + // + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Now close the second monitor and verify that PHONESTATE_OWNER + // status message is sent to the first monitor. + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Reset the handles to hPhone1 and hPhoneApp1. + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + + // + // Add the PHONESTATE_OWNER message to the list of expected + // messages. + // + + AddMessage( + PHONE_STATE, + (DWORD) lpTapiPhoneTestInfo->hPhone1, + (DWORD) lpCallbackParams, + PHONESTATE_OWNER, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1) + ); + + // + // Wait for the PHONESTATE_OWNER message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Now close the first monitor . + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown hPhoneApp1. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown hPhoneApp2. + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + } + + // =================================================================== + // =================================================================== + // + // 10. Test Case: generate a PHONE_CLOSE message and try to open + // the phone device again. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld : Generate PHONE_CLOSE msg and try to open" + " hPhone -- should succeed", + dwTestCase+1); + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = PHONE_CLOSE; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiPhoneTestInfo->lpParams = &info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + // + // Add the PHONESTATE_CLOSE message to the list of expected + // messages. + // + + AddMessage(PHONE_CLOSE, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG)); + + if(!DoPhoneDevSpecific(lpTapiPhoneTestInfo,TAPISUCCESS,TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "TestPhoneClose: Did not receive PHONE_CLOSE message."); + } + + if (! DoPhoneClose(lpTapiPhoneTestInfo, PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneClose: 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 PhoneClose <<<<<<"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tphone/itpcd.c b/private/tapi/qa/trapper/itest/tphone/itpcd.c new file mode 100644 index 000000000..146f49bac --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpcd.c @@ -0,0 +1,740 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpcd.c + +Abstract: + + This module contains the test functions for phoneConfigDialog + +Author: + + Xiao Ying Ding (XiaoD) 05-Dec-1995 + + +Revision History: + + pgopi March 1996 added additional tests + a-ramako 5-April-96 added unicode support + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + +// extern HANDLE ghTphoneDll; + + +// phoneConfigDialog +// +// The following tests are made: +// +// Test Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad hwndOwner +// 4. Bad lpszDeviceClass +// 5. Invalid lpszDeviceclass +// 6. NULL lpszDeviceClass +// 7. Empty lpszDeviceClass string(""). +// * = Stand-alone test case +// +// +void +CALLBACK +AutoDismissTranslateDlgTimerProc( + HWND hwnd, + UINT msg, + UINT idTimer, + DWORD dwTime + ); + +BOOL +PrepareToAutoDismissTranslateDlg( + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo, + BOOL bEnable + ); + +#define DLG_TITLE "TUISPI_phoneConfigDialog" +#define TIMEOUT 1000 + +UINT uiTimer; + +BOOL TestPhoneConfigDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "****************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>> Test phoneConfigDialog <<<<<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go / No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneConfigDialog for go/no-go", + dwTestCase+1); + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, TRUE); + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, FALSE); + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad deviceId. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad deviceId(-1)", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + // + // Call phoneConfigDialog + // + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad deviceId(numDevs)", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDeviceID = *(lpTapiPhoneTestInfo->lpdwNumDevs); + + // + // Call phoneConfigDialog + // + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hwndOwner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + // + // Choose an invalid handle to window owner + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hwndOwner", + dwTestCase+1); + + // + // zero is a valid hwndOwner, so we start from index 1 as + // gdwInvalidHandles[0] is equal to 0. + // + + for(i=1; i < NUMINVALIDHANDLES; i++) + { + lpTapiPhoneTestInfo->hwndOwner = (HWND)gdwInvalidHandles[i]; + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, + PHONEERR_INVALPARAM)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpszDeviceClass. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpwszDeviceClass", + dwTestCase+1); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpszDeviceClass", + dwTestCase+1); +#endif + + // + // Give a bad pointer to lpszDeviceClass(Null is valid value so we + // start the index fom 1 since, gdwInvalidPointers[0] is a null value) + // + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = (LPWSTR) gdwInvalidPointers[i]; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = (LPSTR) gdwInvalidPointers[i]; +#endif + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // =================================================================== + // + // 5. Test Case: Invalid Device Class + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"junk-device-class"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "junk-device-class"; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Invalid Device Class", + dwTestCase+1); + + // + // Call phoneConfigDialog + // + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, TRUE); + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: NULL lpszDeviceClass . + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + + // + // empty string + // + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = NULL; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: NULL lpwszDeviceClass", + dwTestCase+1); +#else + lpTapiPhoneTestInfo->lpszDeviceClass = NULL; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: NULL lpszDeviceClass", + dwTestCase+1); +#endif + + // + // Call phoneConfigDialog + // + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, TRUE); + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: empty lpszDeviceClass string(""). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + + // + // empty string + // +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L""; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: empty lpwszDeviceClass string", + dwTestCase+1); + +#else + lpTapiPhoneTestInfo->lpszDeviceClass = ""; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: empty lpszDeviceClass string", + dwTestCase+1); + +#endif + + // + // Call phoneConfigDialog + // + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, TRUE); + + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + PrepareToAutoDismissTranslateDlg (lpTapiPhoneTestInfo, FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneConfigDialog: 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); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneConfigDialog <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + +void +CALLBACK +AutoDismissTranslateDlgTimerProc( + HWND hwnd, + UINT msg, + UINT idTimer, + DWORD dwTime + ) +{ + HWND hwndChild = GetWindow (GetDesktopWindow(), GW_CHILD); + + + while (hwndChild) + { + char buf[32]; + + + GetWindowText (hwndChild, buf, 31); + + if (strcmp (buf, DLG_TITLE) == 0) + { + break; + } + + hwndChild = GetWindow (hwndChild, GW_HWNDNEXT); + } + + if (hwndChild) + { + // + // We found the right hwnd, so nuke the timer, post a + // key msg to dismiss the dlg, & reset the global + // uiTimer to zero so we don't try to kill the timer again + // + + KillTimer ((HWND) NULL, idTimer); + PostMessage (hwndChild, WM_KEYDOWN, 0x0D, 0x00010001); // key + uiTimer = 0; + } +} + + +BOOL +PrepareToAutoDismissTranslateDlg( + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo, + BOOL bEnable + ) +{ + if (bEnable) + { + if (!(uiTimer = SetTimer( + (HWND) NULL, + 0, + TIMEOUT, + (TIMERPROC) AutoDismissTranslateDlgTimerProc + ))) + { + TapiLogDetail( + DBUG_SHOW_FAILURE, + 0, + (LPCSTR)"[TestPhoneConfigDialog] SetTimer failed" + ); + + return FALSE; + } + } + else if (uiTimer) + { + KillTimer ((HWND) NULL, uiTimer); + } + + return TRUE; +} + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpds.c b/private/tapi/qa/trapper/itest/tphone/itpds.c new file mode 100644 index 000000000..6bfd5d424 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpds.c @@ -0,0 +1,776 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpds.c + +Abstract: + + This module contains the test functions for phoneDevSpecific + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Added additional tests +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneDevSpecific +// +// The following tests are made: +// +// Test +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpParams +// 4. Bad dwSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneDevSpecific(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + PHONEBUTTONINFO TapiTestPhoneButtonInfo; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneDevSpecific <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go / No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneDevSpecfic for go/no-go", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&TapiTestPhoneButtonInfo; + lpTapiPhoneTestInfo->dwSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&TapiTestPhoneButtonInfo; + lpTapiPhoneTestInfo->dwSize = sizeof(PHONEBUTTONINFO); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpParams(NULL). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // + // Negotiate the API Version + // + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpParams", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwSize = sizeof(PHONEBUTTONINFO); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpParams = (LPVOID)gdwInvalidPointers[i]; + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + // + // Negotiate the API Version + // + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwSize(0)", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpParams = &TapiTestPhoneButtonInfo; + + // + // give a bad dwSize + // + + lpTapiPhoneTestInfo->dwSize = 0; + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, FALSE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwSize(real big)", dwTestCase+1); + + lpTapiPhoneTestInfo->lpParams = &TapiTestPhoneButtonInfo; + + // + // give a bad dwSize + // + + lpTapiPhoneTestInfo->dwSize = 0x7FFFFFFF; + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER, + FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if ( ! DoPhoneDevSpecific(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneDevSpecific(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + } + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneDevSpecific: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneDevSpecific <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgbi.c b/private/tapi/qa/trapper/itest/tphone/itpgbi.c new file mode 100644 index 000000000..cd4ad5922 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgbi.c @@ -0,0 +1,901 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgbi.c + +Abstract: + + This module contains the test functions for phoneGetButtonInfo + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 added additional tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + +// phoneGetButtonInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. bad hPhone +// 3. Bad lpButtonInfo +// 4. Bad lpButtonInfo->dwTotalSize +// 5. Success using hPhone with MONITOR privilege +// 6. Verify returned data for hPhone with OWNER privilege +// (see tests for phoneSetButtonInfo) +// +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetButtonInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + int i, n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "*****************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetButtonInfo <<<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go / No-Go test for OWNER. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetButtonInfo for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap(sizeof(PHONEBUTTONINFO)); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap(sizeof(PHONEBUTTONINFO)); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpButtonInfo(NULL). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpButtonInfo(NULL) for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + + // + // Bad lpButtonInfo + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpParams = (LPVOID)gdwInvalidPointers[i]; + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpButtonInfo->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap(sizeof(PHONEBUTTONINFO)); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpButtonInfo->dwTotalSize(0)", + dwTestCase+1); + + // + // Bad lpButtonInfo->dwTotalSize(0). + // + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = 0; + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpButtonInfo->dwTotalSize(fixed_size-1)", + dwTestCase+1); + + // + // Bad lpButtonInfo->dwTotalSize(fixed_size-1). + // + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)-1; + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpButtonInfo->dwTotalSize(real big)", + dwTestCase+1); + + // + // Bad lpButtonInfo->dwTotalSize(realbig). + // + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = 0x7FFFFFFF; + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Go / No-Go test for MONITOR. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetButtonInfo for go/no-go for MONITOR", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap(sizeof(PHONEBUTTONINFO)); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap(sizeof(PHONEBUTTONINFO)); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + if ( ! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap(sizeof(PHONEBUTTONINFO)); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + if ( ! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetButtonInfo: 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); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetButtonInfo <<<<<<<<"); + + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgd.c b/private/tapi/qa/trapper/itest/tphone/itpgd.c new file mode 100644 index 000000000..6b4f2097e --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgd.c @@ -0,0 +1,895 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgd.c + +Abstract: + + This module contains the test functions for phoneGetData + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional tests. + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + +// phoneGetData +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpData +// 4. Bad dwSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetData(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetData <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go / No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneGetData for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap(sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + // + // Get Data + // + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap(sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpData. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: bad lpData", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + // + // Bad lpData + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpData = (LPVOID)gdwInvalidPointers[i]; + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwSize(0). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap(sizeof(DWORD)); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: bad dwSize(0)", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwSize = 0; + + // + // Get Data + // + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: bad dwSize(real big)", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwSize = 0x7FFFFFFF; + + // + // Get Data + // + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwDataId. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap(sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + // + // Bad dwDataId + // + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad dwDataId=-1", + dwTestCase+1); + lpTapiPhoneTestInfo->dwDataID = (DWORD)-1; + if (! DoPhoneGetData(lpTapiPhoneTestInfo, + PHONEERR_INVALDATAID)) + { + TPHONE_FAIL(); + } + + // + // Bad dwDataId + // + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad dwDataId=lpPhoneCaps->dwNumGetData", + dwTestCase+1); + lpTapiPhoneTestInfo->dwDataID = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData; + if (! DoPhoneGetData(lpTapiPhoneTestInfo, + PHONEERR_INVALDATAID)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap(sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if ( ! DoPhoneGetData(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumGetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap(sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if ( ! DoPhoneGetData(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetData: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetData <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + + +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgdc.c b/private/tapi/qa/trapper/itest/tphone/itpgdc.c new file mode 100644 index 000000000..afa7a2ad4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgdc.c @@ -0,0 +1,961 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgdc.c + +Abstract: + + This module contains the test functions for phoneGetDevCaps + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-1996 + + +Revision History: + + pgopi March 1996 Additional Tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetDevCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhoneApp +// 3. Bad dwDeviceId +// 4. Bad dwAPIVersion +// 5. Bad lpPhoneCaps +// 6. Bad lpPhoneCaps->dwTotalSize +// 7. Bad dwExtVersion +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetDevCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSaveAPIVersion = 0; + DWORD dwSaveExtVersion = 0; + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetDevCaps <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetDevCaps for go/no-go ", + dwTestCase+1); + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhoneApp ", + dwTestCase+1); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhoneApp_Orig = lpTapiPhoneTestInfo->hPhoneApp1; + + + // + // bad hPhoneApp (zero is a valid app handle, so we start the index + // at 1, as gdwInvalidHandles[0] is = 0). + // + + for(i=1; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhoneApp = (HPHONEAPP)gdwInvalidHandles[i]; + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, + PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhoneApp1 = lpTapiPhoneTestInfo->hPhoneApp_Orig; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwDeviceId. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwDeviceID(=numDevs) ", + dwTestCase+1); + + // + // Bad DeviceId + // + + lpTapiPhoneTestInfo->dwDeviceID = *(lpTapiPhoneTestInfo->lpdwNumDevs); + + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwDeviceID(=-1) ", + dwTestCase+1); + + // + // Bad DeviceId + // + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Reset deviceId + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwAPIVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwAPIVersion ", + dwTestCase+1); + + // + // Bad dwAPIVersion + // + + dwSaveAPIVersion = lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = WAYTOOHIGH_APIVERSION; + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Reset dwAPIVersion + // + + lpTapiPhoneTestInfo->dwAPIVersion = dwSaveAPIVersion; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpPhoneCaps(NULL). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Bad lpPhoneCaps + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpPhoneCaps ", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS)gdwInvalidPointers[i]; + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad dwTotalSize(0). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = 0; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwTotalSize(0) ", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = 0; + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwTotalSize(fixed_size-1) ", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS)-1; + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwTotalSize(real big) ", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = 0x7FFFFFFF; + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad dwExtVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwExtVersion ", + dwTestCase+1); + + // + // Bad dwExtVersion + // + + dwSaveExtVersion = lpTapiPhoneTestInfo->dwExtVersion; + lpTapiPhoneTestInfo->dwExtVersion = BAD_EXTVERSION; + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEEXTVERSION)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Reset dwExtVersion + // + + lpTapiPhoneTestInfo->dwExtVersion = dwSaveExtVersion; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if ( ! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if ( ! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetDevCaps: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetDevCaps <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgdp.c b/private/tapi/qa/trapper/itest/tphone/itpgdp.c new file mode 100644 index 000000000..6443d26ea --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgdp.c @@ -0,0 +1,772 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgdp.c + +Abstract: + + This module contains the test functions for phoneGetDiaplay + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional tests. + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + +// phoneGetDisplay +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpDisplay +// 4. Bad dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetDisplay(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwNumRows, dwNumColumns; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetDisplay <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Go / No-Go test", + dwTestCase+1); + + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + lpTapiPhoneTestInfo->lpDisplay = + (LPVARSTRING) AllocFromTestHeap(sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING); + + + + // + // phoneGetDisplay + // + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone test + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + lpTapiPhoneTestInfo->lpDisplay = + (LPVARSTRING) AllocFromTestHeap(sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + // + // phoneCLose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpDisplay. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpDisplay", + dwTestCase+1); + + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpDisplay = (LPVARSTRING)gdwInvalidPointers[i]; + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + lpTapiPhoneTestInfo->lpDisplay = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwTotalSize=0", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = 0; + + // + // phoneGetDisplay + // + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwTotalSize=fixed_size-1", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING)-1; + + // + // phoneGetDisplay + // + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwTotalSize=(real big)", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = 0x7FFFFFFF; + + // + // phoneGetDisplay + // + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + lpTapiPhoneTestInfo->lpDisplay = + (LPVARSTRING) AllocFromTestHeap(sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING); + + if ( ! DoPhoneGetDisplay(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + + lpTapiPhoneTestInfo->lpDisplay = + (LPVARSTRING) AllocFromTestHeap(sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = sizeof(VARSTRING); + + if ( ! DoPhoneGetDisplay(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetDisplay: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetDisplay <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgg.c b/private/tapi/qa/trapper/itest/tphone/itpgg.c new file mode 100644 index 000000000..bd5bcb42e --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgg.c @@ -0,0 +1,888 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgg.c + +Abstract: + + This module contains the test functions for phoneGetGain + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + pgopi March 1996 Additional Tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetGain +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. BitVectorParamErrorTest Invalid for dwHookSwitchDev +// 4. BitVectorParamErrorTest Valid for dwHookSwitchDev +// 5. Bad lpdwGain +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetGain(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetGain <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetGain for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: BitVectorParamErrorTest (Invalid). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: BitVectorParamErrorTest", + dwTestCase+1); + + // + // BitVectorParamErrorTest for dwHookSwitchDev + // + + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if(! TestPhoneInvalidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneGetGain, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + PHONEERR_INVALHOOKSWITCHDEV, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: BitVectorParamErrorTest (Valid). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: BitVectorParamValidTest", + dwTestCase+1); + + // + // BitVectorParamValidTest for dwHookSwitchDev + // + + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if(! TestPhoneValidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneGetGain, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: lpdwGain. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + // + // phoneGetDevCaps + // + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lpdwGain", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + + // + // Bad lpdwGain + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwGain = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown. + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if ( ! DoPhoneGetGain(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + + } + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if ( ! DoPhoneGetGain(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetGain: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetGain <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpghs.c b/private/tapi/qa/trapper/itest/tphone/itpghs.c new file mode 100644 index 000000000..cd1a16a0f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpghs.c @@ -0,0 +1,612 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpghs.c + +Abstract: + + This module contains the test functions for phoneGetHookSwitch + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional Tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + + +// phoneGetHookSwitch +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpdwHookSwitchDevs +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetHookSwitch(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + int i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetHookSwitch <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetHookSwitch for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpdwHookSwitchDev. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwHookSwitchDevs", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + + + if ( ! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + + if ( ! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetHookSwitch: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetHookSwitch <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgi.c b/private/tapi/qa/trapper/itest/tphone/itpgi.c new file mode 100644 index 000000000..63b5e169b --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgi.c @@ -0,0 +1,943 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgi.c + +Abstract: + + This module contains the test functions for phoneGetIcon + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional Tests + a-ramako 5-April-96 Added unicode support + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + + + +// phoneGetIcon +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad dwDeviceId +// 3. Bad lpszDeviceClass +// 4. Bad lphIcon +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetIcon(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + int i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetIcon <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneGetIcon for go/no-go", + dwTestCase+1); + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + // + // phoneGetIcon + // + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneGetIcon for go/no-go(null lpwszDeviceClass)", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpwszDeviceClass = NULL; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneGetIcon for go/no-go(null lpszDeviceClass)", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpszDeviceClass = NULL; +#endif + + // + // phoneGetIcon + // + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneGetIcon for go/no-go(empty string for " + "lpwszDeviceClass)", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpwszDeviceClass = L""; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneGetIcon for go/no-go(empty string for " + "lpszDeviceClass)", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpszDeviceClass = ""; +#endif + + // + // phoneGetIcon + // + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad dwDeviceID. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad dwDeviceID(-1)", + dwTestCase+1); + + // + // Bad dwDeviceID + // + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + // + // phoneGetIcon + // + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad dwDeviceID(numDevs)", + dwTestCase+1); + + // + // Bad dwDeviceID + // + + lpTapiPhoneTestInfo->dwDeviceID = *(lpTapiPhoneTestInfo->lpdwNumDevs); + + // + // phoneGetIcon + // + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore dwDeviceID + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpszDeviceClass . + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad lpwszDeviceClass", + dwTestCase+1); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad lpszDeviceClass", + dwTestCase+1); +#endif + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; + + // + // NULL is a valid value for lpszDeviceClass, so we start the index at 1 + // as gldwInvalidHandles[0] has the value zero. + // + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = (LPWSTR)gdwInvalidPointers[i]; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = (LPSTR)gdwInvalidPointers[i]; +#endif + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case:Bad lphIcon. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad lphIcon", + dwTestCase+1); + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lphIcon = (LPHICON)gdwInvalidPointers[i]; + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Invalid lpszDeviceClass . + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Invalid lpwszDeviceClass", + dwTestCase+1); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Invalid lpszDeviceClass", + dwTestCase+1); +#endif + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; + + // + // when testing with esp32.tsp, always use "tapi/InvalidDeviceClass" + // as your invalid device class, because esp32.tsp passes every other + // device class name as a valid device class. + // + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/InvalidDeviceClass"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/InvalidDeviceClass"; +#endif + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo,PHONEERR_INVALDEVICECLASS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; + + if ( ! DoPhoneGetIcon(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; + + if ( ! DoPhoneGetIcon(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetIcon: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetIcon <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgid.c b/private/tapi/qa/trapper/itest/tphone/itpgid.c new file mode 100644 index 000000000..49820816f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgid.c @@ -0,0 +1,759 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgid.c + +Abstract: + + This module contains the test functions for phoneGetID + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional tests + a-ramako 5-April-96 Added unicode support + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetID +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpDeviceID +// 4. Bad lpszDeviceClass +// 5. Bad lpDeviceID->dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetID(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + int i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetID <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + lpTapiPhoneTestInfo->lpDeviceID = &(lpTapiPhoneTestInfo->DeviceID); + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetID for go/no-go", + dwTestCase+1); + + // + // phoneGetID + // + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### passedSize = %lx, dwNeededSize = %lx", + sizeof(lpTapiPhoneTestInfo->DeviceID), + lpTapiPhoneTestInfo->lpDeviceID->dwNeededSize); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + lpTapiPhoneTestInfo->lpDeviceID = &(lpTapiPhoneTestInfo->DeviceID); + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpDeviceID. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpDeviceID", + dwTestCase+1); + + // + // phoneGetID + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpDeviceID = (LPVARSTRING)gdwInvalidPointers[i]; + + if (! DoPhoneGetID(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpszDeviceClass. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->lpDeviceID = &(lpTapiPhoneTestInfo->DeviceID); + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpwszDeviceClass(NULL)", + dwTestCase+1); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpszDeviceClass(NULL)", + dwTestCase+1); +#endif + + // + // phoneGetID + // + for(i=0; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = (LPWSTR)gdwInvalidPointers[i]; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = (LPSTR)gdwInvalidPointers[i]; +#endif + + if (! DoPhoneGetID(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpDeviceID->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + lpTapiPhoneTestInfo->lpDeviceID = &(lpTapiPhoneTestInfo->DeviceID); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpDeviceID->dwTotalSize=0", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = 0; + + // + // phoneGetID + // + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpDeviceID->dwTotalSize=real big", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = 0x7FFFFFFF; + + // + // phoneGetID + // + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpDeviceID->dwTotalSize=fixed_size-1", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING)-1; + + // + // phoneGetID + // + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetID: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetID <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgl.c b/private/tapi/qa/trapper/itest/tphone/itpgl.c new file mode 100644 index 000000000..268d90289 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgl.c @@ -0,0 +1,648 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgl.c + +Abstract: + + This module contains the test functions for phoneGetLamp + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetLamp +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpdwLampMode +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetLamp(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + int i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetLamp <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetLamp for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + + // + // phoneGetLamp + // + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwLampMode = %lx", + lpTapiPhoneTestInfo->dwLampMode); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwLampMode = %lx", + lpTapiPhoneTestInfo->dwLampMode); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpdwLampMode. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwLampMode", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = NULL; + + // + // phoneGetLamp + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwLampMode = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwLampMode = %lx", + lpTapiPhoneTestInfo->dwLampMode); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + + + if ( ! DoPhoneGetLamp(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + + + if ( ! DoPhoneGetLamp(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhonGetLamp: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetLamp <<<<<<<<" ); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgm.c b/private/tapi/qa/trapper/itest/tphone/itpgm.c new file mode 100644 index 000000000..b08c71c8d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgm.c @@ -0,0 +1,363 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgm.c + +Abstract: + + This module contains the test functions for phoneGetMessage + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetMessage +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhoneApp +// 3. Bad lpMessage +// +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetMessage(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n*********************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test phoneGetMessage"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEEVENT; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, TAPISUCCESS, FALSE)) + { + TPHONE_FAIL(); + } + + WaitForAllMessages(); + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Go/No-Go Test", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpMessage = (LPPHONEMESSAGE) AllocFromTestHeap ( + sizeof(PHONEMESSAGE)); + + if(! DoPhoneGetMessage (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: hDevice = %lx, dwMessageID = %lx, dwCallbackInst = %lx", + lpTapiPhoneTestInfo->lpMessage->hDevice, + lpTapiPhoneTestInfo->lpMessage->dwMessageID, + lpTapiPhoneTestInfo->lpMessage->dwCallbackInstance); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpMessage: dwParam1 = %lx, dwParam2 = %lx, dwParam3 = %lx", + lpTapiPhoneTestInfo->lpMessage->dwParam1, + lpTapiPhoneTestInfo->lpMessage->dwParam2, + lpTapiPhoneTestInfo->lpMessage->dwParam3); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEEVENT; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad hPhoneApp", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpMessage = (LPPHONEMESSAGE) AllocFromTestHeap ( + sizeof(PHONEMESSAGE)); + + // + // save previous hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp_Orig = lpTapiPhoneTestInfo->hPhoneApp1; + + // + // Test invalid handles + // + + for(i = 0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhoneApp = (HPHONEAPP)gdwInvalidHandles[i]; + if (! DoPhoneGetMessage(lpTapiPhoneTestInfo, + PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + } + } + + // + // Reset hPhone + // + + lpTapiPhoneTestInfo->hPhoneApp1 = lpTapiPhoneTestInfo->hPhoneApp_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpMessage. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEEVENT; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">>Test Case %ld: Bad lpMessage", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiPhoneTestInfo->lpMessage = (LPPHONEMESSAGE)gdwInvalidPointers[i]; + + if (! DoPhoneGetMessage(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + // + // +----------------------edit above this phone------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetMessage: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetMessage <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgr.c b/private/tapi/qa/trapper/itest/tphone/itpgr.c new file mode 100644 index 000000000..670aed87f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgr.c @@ -0,0 +1,840 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgr.c + +Abstract: + + This module contains the test functions for phoneGetRing + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional Tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetRing +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpdwRingMode +// 4. Bad lpdwVolume +// +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetRing(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwVolume; + int i; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetRing <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetRing for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwRingMode = %lx", + lpTapiPhoneTestInfo->dwRingMode); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwVolume = %lx", + lpTapiPhoneTestInfo->dwVolume); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpdwRingMode. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwRingMode.", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwRingMode = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 4. Test Case: lpdwRingMode == lpdwVolume + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lpdwRingMode == lpdwVolume.", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->lpdwRingMode = + (LPDWORD) lpTapiPhoneTestInfo->lpdwVolume; + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpdwVolume. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwVolume.", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwVolume = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if ( ! DoPhoneGetRing(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if ( ! DoPhoneGetRing(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetRing: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetRing <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgs.c b/private/tapi/qa/trapper/itest/tphone/itpgs.c new file mode 100644 index 000000000..d9b32a891 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgs.c @@ -0,0 +1,774 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgs.c + +Abstract: + + This module contains the test functions for phoneGetStatus + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional Tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpPhoneStatus +// 4. Bad lpPhoneStatus->dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + int i; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetStatus <<<<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetStatus for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS); + + // + // phoneGetStatus + // + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpPhoneStatus->dwNeededSize = %lx", + lpTapiPhoneTestInfo->lpPhoneStatus->dwNeededSize); + + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpPhoneStatus. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpPhoneStatus", + dwTestCase+1); + + // + // phoneGetStatus + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpPhoneStatus = + (LPPHONESTATUS)gdwInvalidPointers[i]; + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo,PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpPhoneStatus->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpPhoneStatus->dwTotalSize=0", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = 0; + + // + // phoneGetStatus + // + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpPhoneStatus->dwTotalSize=fixedSize-1", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS)-1; + + // + // phoneGetStatus + // + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpPhoneStatus->dwTotalSize=real big", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = 0x7FFFFFFF; + + // + // phoneGetStatus + // + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS); + + + if ( ! DoPhoneGetStatus(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS); + + + if ( ! DoPhoneGetStatus(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetStatus: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetStatus <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgsm.c b/private/tapi/qa/trapper/itest/tphone/itpgsm.c new file mode 100644 index 000000000..c93cbca28 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgsm.c @@ -0,0 +1,1067 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgsm.c + +Abstract: + + This module contains the test functions for phoneGetStatusMessages + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi 20-Mar-1996 Additional parameter tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetStatusMessages +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. Bad lpdwPhoneStates +// 4. Bad lpdwButtonModes +// 5. Bad lpdwButtonStates +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetStatusMessages(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + int i; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetStatusMessages <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetStatusMessages for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + // + // phoneGetStatusMessages + // + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwPhoneStates = %lx", + lpTapiPhoneTestInfo->dwPhoneStates); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwButtonMode = %lx", + lpTapiPhoneTestInfo->dwButtonModes); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwButtonStates = %lx", + lpTapiPhoneTestInfo->dwButtonStates); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad lpdwPhoneStates + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwPhoneStates", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + // + // phoneGetStatusMessages + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwPhoneStates = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 4. Test Case: lpdwPhoneStates == lpdwButtonModes + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lpdwPhoneStates == lpdwButtonModes", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + // + // phoneGetStatusMessages + // + + lpTapiPhoneTestInfo->lpdwPhoneStates = + (LPDWORD) lpTapiPhoneTestInfo->lpdwButtonModes; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpdwPhoneStates == lpdwButtonStates + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lpdwPhoneStates == lpdwButtonStates", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + // + // phoneGetStatusMessages + // + + lpTapiPhoneTestInfo->lpdwPhoneStates = + (LPDWORD) lpTapiPhoneTestInfo->lpdwButtonStates; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpdwButtonModes. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwButtonModes", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + // + // phoneGetStatusMessages + // + + for(i= 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwButtonModes = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad lpdwButtonStates. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwButtonStates", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + + + // + // phoneGetStatusMessages + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwButtonStates = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 8. Test Case: lpdwButtonStates == lpdwButtonModes + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwButtonStates == lpdwButtonModes", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + + + // + // phoneGetStatusMessages + // + + lpTapiPhoneTestInfo->lpdwButtonStates = + (LPDWORD)lpTapiPhoneTestInfo->lpdwButtonModes; + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetStatusMessages: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetStatusMessages <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpgv.c b/private/tapi/qa/trapper/itest/tphone/itpgv.c new file mode 100644 index 000000000..742815004 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpgv.c @@ -0,0 +1,877 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpgv.c + +Abstract: + + This module contains the test functions for phoneGetVolume + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional Param Test +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneGetVolume +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. BitVectorParamErrorTest +// 4. Bad lpdwVolume +// 5. BitVectorParamValidTest. +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetVolume(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + int i = 0; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneGetVolume <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: phoneGetVolume for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + // + // phoneGetVolume + // + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpTapiPhoneTestInfo->dwVolume = %lx", + lpTapiPhoneTestInfo->dwVolume); + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case:Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + // + // bad hPhone for phoneGetVolume + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // close phone + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: BitVectorParameErrorTest. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: BitVectorParamErrorTest", + dwTestCase+1); + + // + // BitVectorParamErrorTest + // + + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + + if(! TestPhoneInvalidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneGetVolume, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + PHONEERR_INVALHOOKSWITCHDEV, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpdwVolume. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwVolume", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + // + // Bad lpdwVolumne for phoneGetVolume + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwVolume = (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Valid BitVectorParamValidTest. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get Device Capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: BitVectorParamValidTest", + dwTestCase+1); + + // + // BitVectorParamValidTest + // + + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + + if(! TestPhoneValidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneGetVolume, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close phone + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if ( ! DoPhoneGetVolume(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + + if ( ! DoPhoneGetVolume(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneGetVolume: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneGetVolume <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + +} + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpi.c b/private/tapi/qa/trapper/itest/tphone/itpi.c new file mode 100644 index 000000000..af88986f5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpi.c @@ -0,0 +1,712 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpi.c + +Abstract: + + This module contains the test functions for phoneInitialize + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + + pgopi March 1996 Additional Param Test + a-ramako 5-April-96 Added unicode support + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneInitialize +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad lpPhoneApp +// 3. Bad hInstance +// 4. Bad lpfnCallback +// 5. Bad lpszAppName +// 6. Bad lpdwNumDevs +// 7. Go/No-Go test(empty appName). +// 8. Force a REINIT message & verify that attempts to phoneInitialize +// fail with REINIT +// * = Stand-alone test case +// +// + + + +BOOL TestPhoneInitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + TAPIRESULT lastTapiResult; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneInitialize <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:phoneInitialize for go/no-go ", + dwTestCase+1); + + // + // Initialize a phone app + // + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad lphPhoneApp test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lphPhoneApp ", + dwTestCase+1); + + // + // Bad lpPhoneApp for phoneinitialize + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lphPhoneApp = (LPHPHONEAPP)gdwInvalidPointers[i]; + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + FreeTestHeap(); + + + + // =================================================================== + // + // 3. Test Case: lphPhoneApp == lpdwNumDevs + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lphPhoneApp == lpdwNumDevs", + dwTestCase+1); + + // + // Bad lpPhoneApp for phoneinitialize + // + + lpTapiPhoneTestInfo->lphPhoneApp = + (LPHPHONEAPP) lpTapiPhoneTestInfo->lpdwNumDevs; + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad hInstance test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hInstance ", + dwTestCase+1); + + // + // Bad hInstance for phoneinitialize + // + + // + // hInstance=0 seems to be a valid hInstance, so we start the test + // from 1. gdwInvalidHandles[0] has the value 0, so we start the + // index at 1. + // + + for(i=1; i < NUMINVALIDHANDLES; i++) + { + lpTapiPhoneTestInfo->hInstance = (HINSTANCE)gdwInvalidHandles[i]; + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, PHONEERR_INVALPARAM)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + } + + fTestPassed = ShowTestCase(fTestPassed); + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpfnCallback test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpfnCallback ", + dwTestCase+1); + + // + // Bad lpfnCallback for phoneinitialize + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpfnCallback = + (PHONECALLBACK)gdwInvalidPointers[i]; + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpszAppName test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpwszAppName ", + dwTestCase+1); +#else +*/ + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpszAppName ", + dwTestCase+1); +//#endif + + // + // invalid lpszAppName test + // + + // + // gldwInvalidPointer[0] is NULL and a valid value for lpszAppName, + // so we start the test from index 1. + // + + for(i=1; i < NUMINVALIDPOINTERS; i++) + { +/* +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszAppName = (LPWSTR)gdwInvalidPointers[i]; +#else +*/ + lpTapiPhoneTestInfo->lpszAppName = (LPSTR)gdwInvalidPointers[i]; +//#endif + + // + // Initialize a phone app + // + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpdwNumDevs test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwNumDevs ", + dwTestCase+1); + + // + // invalid lpszAppName test + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + + lpTapiPhoneTestInfo->lpdwNumDevs = (LPDWORD)gdwInvalidPointers[i]; + + // + // Initialize a phone app + // + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Go/No-Go test(empty appName). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:phoneInitialize for go/no-go( empty appName) ", + dwTestCase+1); + +/* +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszAppName = L""; +#else +*/ + lpTapiPhoneTestInfo->lpszAppName = ""; +//#endif + + // + // Initialize a phone app + // + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Force a REINIT message and verify that + // phoneInitialize returns REINIT error. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Force a REINIT message & verify that" + " phoneInitialize returns reinit error", + dwTestCase+1); + +/* +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszAppName = L""; +#else +*/ + lpTapiPhoneTestInfo->lpszAppName = ""; +//#endif + + // + // Initialize a phone app + // + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for owner + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = PHONE_STATE; + info.u.EspMsg.dwParam1 = PHONESTATE_REINIT; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiPhoneTestInfo->lpParams = &info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + // + // Add the PHONESTATE_REINIT message to the list of expected + // messages. + // + + AddMessage(PHONE_STATE, + 0x00000000, + (DWORD) lpCallbackParams, + PHONESTATE_REINIT, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1)); + + if(!DoPhoneDevSpecific(lpTapiPhoneTestInfo,TAPISUCCESS,TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "TestPhoneInitailize: Did not receive REINIT message."); + } + + // + // Initialize hPhonepp2. + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, PHONEERR_REINIT)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully, i.e phoneInitialize returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + + } + + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneInitialize: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneInitialize <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + +} diff --git a/private/tapi/qa/trapper/itest/tphone/itpie.c b/private/tapi/qa/trapper/itest/tphone/itpie.c new file mode 100644 index 000000000..f74185389 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpie.c @@ -0,0 +1,1619 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpie.c + +Abstract: + + This module contains the test functions for phoneInitializeEx + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + + a-ramako 5-April-96 Added unicode support + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneInitializeEx +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad lphPhoneApp +// 3. Bad hInstance +// 4. Bad lpfnCallback +// 5. Bad lpszFriendlyName +// 6. Bad lpdwNumDevs +// 7. Bad lpdwAPIVersion +// 8. Bad lpPhoneInitializeParams +// 9. Bad dwTotalSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneInitializeEx(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + TAPIRESULT lastTapiResult; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>>>> Test phoneInitializeEx <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:phoneInitializeEx for go/no-go ", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad lphPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lphPhoneApp ", + dwTestCase+1); + // + // Test invalid hPhoneApp + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lphPhoneApp = (LPHPHONEAPP)gdwInvalidPointers[i]; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // + // 3. Test Case: Bad lphPhoneApp == lpdwNumDevs + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lphPhoneApp == lpdwNumDevs", + dwTestCase+1); + // + // Test invalid hPhoneApp + // + + lpTapiPhoneTestInfo->lphPhoneApp = + (LPHPHONEAPP) lpTapiPhoneTestInfo->lpdwNumDevs; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // + // 4. Test Case: Bad lphPhoneApp == lpdwAPIVersion + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lphPhoneApp == lpdwAPIVersion", + dwTestCase+1); + // + // Test invalid hPhoneApp + // + + lpTapiPhoneTestInfo->lphPhoneApp = + (LPHPHONEAPP) lpTapiPhoneTestInfo->lpdwAPIVersion; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // + // 5. Test Case: Bad lphPhoneApp == lpPhoneInitializeExParams; + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lphPhoneApp == lpPhoneInitializeExParams", + dwTestCase+1); + // + // Test invalid hPhoneApp + // + + lpTapiPhoneTestInfo->lphPhoneApp = + (LPHPHONEAPP) lpTapiPhoneTestInfo->lpPhoneInitializeExParams; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad hInstance. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hInstance ", + dwTestCase+1); + + // + // save previous hInstance + // + + lpTapiPhoneTestInfo->hInstance_Orig = lpTapiPhoneTestInfo->hInstance; + + // + // Test invalid handles + // + + for(i = 1; i < NUMINVALIDHANDLES; i++) + { + lpTapiPhoneTestInfo->hInstance = (HINSTANCE)gdwInvalidHandles[i]; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPARAM)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + // + // Reset hInstance + // + + lpTapiPhoneTestInfo->hInstance = lpTapiPhoneTestInfo->hInstance_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad lpfnCallback. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpfnCallback ", + dwTestCase+1); + + // + // Test invalid lpfnCallback + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpfnCallback = + (PHONECALLBACK)gdwInvalidPointers[i]; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Bad lpszFriendlyName. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + +#ifdef WUNICODE + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpwszFriendlyAppName", + dwTestCase+1); +#else + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpszFriendlyAppName", + dwTestCase+1); +#endif + + // + // Test invalid lpszFriendlyAppName + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = + (LPWSTR)gdwInvalidPointers[i]; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = + (LPSTR)gdwInvalidPointers[i]; +#endif + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 9. Test Case: Bad lpdwNumDevs. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwNumDevs", + dwTestCase+1); + + // + // Test invalid lpdwNumDevs + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwNumDevs = + (LPDWORD)gdwInvalidPointers[i]; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 10. Test Case: lpdwNumDevs == lpdwAPIVersion + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwNumDevs == lpdwAPIVersion", + dwTestCase+1); + + // + // Test invalid lpdwNumDevs + // + + lpTapiPhoneTestInfo->lpdwNumDevs = + (LPDWORD) lpTapiPhoneTestInfo->lpdwAPIVersion; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 11. Test Case: lpdwNumDevs == lpPhoneInitializeExParams + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwNumDevs == lpPhoneInitializeExParams", + dwTestCase+1); + + // + // Test invalid lpdwNumDevs + // + + lpTapiPhoneTestInfo->lpdwNumDevs = + (LPDWORD) lpTapiPhoneTestInfo->lpPhoneInitializeExParams; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 12. Test Case: Bad lpdwAPIVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwAPIVersion", + dwTestCase+1); + + // + // Test invalid lpdwAPIVersion + // + + for(i = 0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwAPIVersion = + (LPDWORD)gdwInvalidPointers[i]; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + // =================================================================== + // =================================================================== + // + // 13. Test Case: lpdwAPIVersion == lpPhoneInitializeExParams + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: lpdwAPIVersion == lpPhoneInitializeExParams", + dwTestCase+1); + + // + // Test invalid lpdwAPIVersion + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = + (LPDWORD)lpTapiPhoneTestInfo->lpPhoneInitializeExParams; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 14. Test Case: Bad lpPhoneInitializeExParams.. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpPhoneInitializeExParams", + dwTestCase+1); + + // + // Test invalid lpPhoneInitializeExParams + // + + for(i = 1; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS)gdwInvalidPointers[i]; + if (! DoPhoneInitializeEx(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // + // 15. Test Case: Bad dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); +// lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = +// sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=0", + dwTestCase+1); + + // + // lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = 0; + // + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = 0; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=fixedSize-1", + dwTestCase+1); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS)-1; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_STRUCTURETOOSMALL)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + TapiLogDetail(DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize=real big", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = 0x7FFFFFFF; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if we initialized successfully,i.e phoneInitializeEx returned 0, + // then we better shutdown. + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 16. Test Case: Go/No-Go test with non-empty lpszFriendlyAppName. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:go/no-go, non-empty lpszFriendlyAppName", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 17. Test Case: Verify 3 options + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Verify 3 options: USECOMPLETIONPORT", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 18. Test Case: Verify 3 options + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Verify 3 options: USEHIDDENWINDOW", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 19. Test Case: Verify 3 options + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Verify 3 options: USEEVENT", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEEVENT; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 20. Test Case: Verify uppart bits ignor + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Verify uppart bits ignor", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + 0xfffffff1; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 21. Test Case: Verify uppart bits ignor + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Verifyuppart bits ignor", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + 0x0000fff1; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + + + // =================================================================== + // =================================================================== + // + // 22. Test Case: Verify option > 3 & < 16 should fail + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Verify options 4 should fail", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = 0x00020000; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = 4; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_INVALPARAM)) + { + TPHONE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 23. Test Case: Verify option > 3 & < 16 should fail + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Verify option 15 should fail", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = 0x00020000; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = 15; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_INVALPARAM)) + { + TPHONE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 24. Test Case: Anything < 20000 should fail + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Anything less than 2000 should fail", + dwTestCase+1); + + // + // InitializeEx a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = 0x00010004; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEEVENT; + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszFriendlyAppName = L"TestApp"; +#else + lpTapiPhoneTestInfo->lpszFriendlyAppName = "TestApp"; +#endif + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + + + + // + // +----------------------edit above this phone------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneInitializeEx: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneInitializeEx <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpnav.c b/private/tapi/qa/trapper/itest/tphone/itpnav.c new file mode 100644 index 000000000..c767a3603 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpnav.c @@ -0,0 +1,640 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpnav.c + +Abstract: + + This module contains the test functions for phoneNegotiateAPIVersion + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + + pgopi March 1996 Additional param tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneNegotiateAPIVersion +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhoneApp +// 3. Bad dwDeviceId +// 4. Bad dwAPILowVersion +// 5. Bad dwAPIHighVersion +// 6. Bad lpdwAPIVersion +// 7. Bad lpExtensionID +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneNegotiateAPIVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneNegotiateAPIVersion <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:phoneNegotiateAPIVersion for go/no-go", + dwTestCase+1); + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad hPhoneApp", + dwTestCase+1); + + // + // save original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp_Orig = lpTapiPhoneTestInfo->hPhoneApp1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhoneApp = (HPHONEAPP)gdwInvalidHandles[i]; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // restore original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp1 = lpTapiPhoneTestInfo->hPhoneApp_Orig; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwDeviceID. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad dwDeviceID", + dwTestCase+1); + + // + // use bad dwDeviceId of -1 + // + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + // + // use bad dwDeviceId of dwNumDevs + // + + lpTapiPhoneTestInfo->dwDeviceID = *(lpTapiPhoneTestInfo->lpdwNumDevs); + + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwLowAPIVersion. + // + // 5. Test Case: Bad dwHighAPIVersion + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + + // + // use bad dwLowAPIVersion + // + + lpTapiPhoneTestInfo->dwAPILowVersion = TOOHIGH_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Bad dwLowAPIVersion", + dwTestCase+1); + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + + // + // use bad dwHighAPIVersion + // + + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = TOOLOW_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Bad dwHighAPIVersion", + dwTestCase+1); + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpdwAPIVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Bad lpdwAPIVersion", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwAPIVersion = (LPDWORD) gdwInvalidPointers[i]; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // + // 7. Test Case: lpdwAPIVersion == lpExtensionID + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: lpdwAPIVersion == lpExtensionID", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwAPIVersion = + (LPDWORD) lpTapiPhoneTestInfo->lpExtensionID; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 8. Test Case: Bad lpExtensionID. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld:Bad lpExtensionID", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpExtensionID = + (LPPHONEEXTENSIONID) gdwInvalidPointers[i]; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneNegotiateAPIVersion: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneNegotiateAPIVersion <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpne.c b/private/tapi/qa/trapper/itest/tphone/itpne.c new file mode 100644 index 000000000..8b959950d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpne.c @@ -0,0 +1,839 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpnev.c + +Abstract: + + This module contains the test functions for phoneNegotiateExtVersion + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional param tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneNegotiateExtVersion +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhoneApp +// 3. Bad dwDeviceID +// 4. Bad dwAPIVersion +// 5. Bad dwExtLowVersion +// 6. Bad dwExtHighVersion +// 7. Bad lpdwExtVersion +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneNegotiateExtVersion(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneNegotiateExtVersion <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:phoneNegotiateExtVersion for go/no-go for OWNER", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hPhoneApp", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + // + // save original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp_Orig = lpTapiPhoneTestInfo->hPhoneApp1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhoneApp = (HPHONEAPP)gdwInvalidHandles[i]; + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // restore original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp1 = lpTapiPhoneTestInfo->hPhoneApp_Orig; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad dwDeviceId. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwDeviceID", + dwTestCase+1); + + // + // use bad dwDeviceID of -1 + // + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + // + // use bad dwDeviceID of dwNumDevs + // + + lpTapiPhoneTestInfo->dwDeviceID = *(lpTapiPhoneTestInfo->lpdwNumDevs); + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad dwAPIVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwAPIVersion", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + // + // Use a Bad dwAPIVersion = TOOLOW_APIVERSION + // + + lpTapiPhoneTestInfo->dwAPIVersion = TOOLOW_APIVERSION; + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + } + + // + // Use a Bad dwAPIVersion = TOOHIGH_APIVERSION + // + + lpTapiPhoneTestInfo->dwAPIVersion = TOOHIGH_APIVERSION; + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwExtLowVersion & dwExtHighVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwExtLowVersion & dwExtHighVersion", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + lpTapiPhoneTestInfo->dwExtHighVersion = BAD_EXTVERSION; + lpTapiPhoneTestInfo->dwExtLowVersion = BAD_EXTVERSION; + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_INCOMPATIBLEEXTVERSION)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lpdwExtVersion. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpdwExtVersion", + dwTestCase+1); + + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpdwExtVersion = (LPDWORD) gdwInvalidPointers[i]; + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + if ( ! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwExtVersion = &(lpTapiPhoneTestInfo->dwExtVersion); + + if ( ! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneNegotiateExtVersion: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneNegotiateExtVersion <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpo.c b/private/tapi/qa/trapper/itest/tphone/itpo.c new file mode 100644 index 000000000..5f878a0e4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpo.c @@ -0,0 +1,1672 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpo.c + +Abstract: + + This module contains the test functions for phoneOpen + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + + pgopi March 1996 Additional param tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" + +// phoneOpen +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test for onwer +// 2. Verify Cannot open same phone as owner. +// 3. Test Case: Go/No-Go for Monitor. +// 4. Bad hPhoneApp +// 5. Bad dwDeviceId +// 6. Bad lphPhone +// 7. Bad dwAPIVersion(OWNER) +// 8. Bad dwAPIVersion(MONITOR) +// 9. BitVectorErrorParamTest for dwPrivilege +// 10. Bad dwExtVersion(MONITOR) +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneOpen(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo=NULL; + INT i=0; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + TAPIRESULT lastTapiResult; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneOpen <<<<<<<<<<<<<<<<<"); +/* + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + lpTapiPhoneTestInfo->dwExtVersion = 0x0; + lpTapiPhoneTestInfo->dwDeviceID = 0; + + if ( ! DoPhoneOpen(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); +*/ + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // 2. Test Case: Verify Cannot open same phone as owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for owner + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: phoneOpen for go/no-go for owner", + dwTestCase+1); + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // verify cannot open same phone as owner + // + + fTestPassed = TRUE; + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: verify cannot open same phone as owner", + dwTestCase+1); + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_INVALPRIVILEGE)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // restore lphPhone + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + + // + // phone close + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Go/No-Go for Monitor. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for monitor + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: phoneOpen for go/no-go for monitor", + dwTestCase+1); + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phone close + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad hPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hPhoneApp", + dwTestCase+1); + + // + // save original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp_Orig = lpTapiPhoneTestInfo->hPhoneApp1; + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhoneApp = (HPHONEAPP)gdwInvalidHandles[i]; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // restore original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp1 = lpTapiPhoneTestInfo->hPhoneApp_Orig; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwDeviceID. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwDeviceID", + dwTestCase+1); + + // + // use bad dwDeviceID of -1 + // + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + // + // use bad dwDeviceID of dwNumDevs + // + + lpTapiPhoneTestInfo->dwDeviceID = *(lpTapiPhoneTestInfo->lpdwNumDevs); + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Bad lphPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lphPhone", + dwTestCase+1); + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lphPhone = (LPHPHONE) gdwInvalidPointers[i]; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Bad dwAPIVersion for OWNER. + // 8. Test Case: Bad dwAPIVersion for MONITOR. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for owner + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwAPIVersion for OWNER", + dwTestCase+1); + + // + // Use a bad dwAPIVersion to phone open + // + + lpTapiPhoneTestInfo->dwAPIVersion = WAYTOOHIGH_APIVERSION; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwAPIVersion for MONITOR", + dwTestCase+1); + + // + // Use a bad dwAPIVersion to phone open + // + + lpTapiPhoneTestInfo->dwAPIVersion = WAYTOOHIGH_APIVERSION; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_INCOMPATIBLEAPIVERSION)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 9. Test Case: BitVectorParamErrorTest. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: BitVectorParamErrorTest", + dwTestCase+1); + + // + // BitVectorParamErrorTest + // + + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwPrivilege = 0; + + if(! TestPhoneInvalidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneOpen, + (LPDWORD) &lpTapiPhoneTestInfo->dwPrivilege, + PHONEERR_INVALPRIVILEGE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEPRIVILEGE_OWNER | PHONEPRIVILEGE_MONITOR), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 10. Test Case: Bad dwExtVersion for MONITOR. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for monitor + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwextVersion for MONITOR", + dwTestCase+1); + + // + // Use a bad dwExtVersion to phone open + // + + lpTapiPhoneTestInfo->dwExtVersion = BAD_EXTVERSION; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_INCOMPATIBLEEXTVERSION)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 11. Test Case: Verify hPhone invalid if phoneOpen returns error + // (try phoneClose). + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify hPhone invalid if phoneOpen returns" + " error(try phoneClose)", + dwTestCase+1); + + // + // use bad dwDeviceID of -1 + // + + lpTapiPhoneTestInfo->dwDeviceID = (DWORD)-1; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_BADDEVICEID)) + { + TPHONE_FAIL(); + + } + + // + // try a phoneClose of the bad hPhone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 12. Test Case: Force REINIT message and verify PhoneOpen returns + // REINIT error + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test case %ld: Force REINIT message and verify phoneOpen returns" + " PHONEERR_REINIT error", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + // + // try a phoneOpen of the another hPhone with privilege + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = PHONE_STATE; + info.u.EspMsg.dwParam1 = PHONESTATE_REINIT; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiPhoneTestInfo->lpParams = &info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + // + // Add the PHONESTATE_REINIT message to the list of expected + // messages. + // + + AddMessage(PHONE_STATE, + 0x00000000, + (DWORD) lpCallbackParams, + PHONESTATE_REINIT, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1)); + + if(!DoPhoneDevSpecific(lpTapiPhoneTestInfo,TAPISUCCESS,TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + // + // try a phoneOpen of the another hPhone with privilege + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_REINIT)) + { + TPHONE_FAIL(); + + // + // if phoneOpen succeeded, i.e. returns SUCCESS, then we + // better do a phoneCLose + // + + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + lpTapiPhoneTestInfo->dwDeviceID = 0; + + if ( ! DoPhoneOpen(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + lpTapiPhoneTestInfo->dwExtVersion = 0x0; + lpTapiPhoneTestInfo->dwDeviceID = 0; + + if ( ! DoPhoneOpen(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + GetLastTapiResult(&lastTapiResult); + + if(lastTapiResult.lActual == TAPISUCCESS) + { + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneOpen: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneOpen <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tphone/itps.c b/private/tapi/qa/trapper/itest/tphone/itps.c new file mode 100644 index 000000000..6284df503 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itps.c @@ -0,0 +1,813 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itps.c + +Abstract: + + This module contains the test functions for phoneShutdown + +Author: + + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + + pgopi March 1996 Additional param tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneShutdown +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhoneApp +// 3. Verify hPhoneApp can't be used after successful shutdown(try +// phoneShutdown again) with no other existing hPhoneApps. +// 4. Verify hPhoneApp can't be used after successful shutdown(try +// phoneShutdown again) when other hPhoneApps exists. +// 5. Verify hPhoneApp can't be used after (try phoneShutdown again) +// when phoneInitialize returns error. +// 6. Verify expected PHONE_STATE/OWNER,MONITOR msgs sent when +// hPhoneApp shutdown. +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneShutdown(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams=NULL; + + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneShutdown <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: phoneShutdown for go/no-go", + dwTestCase+1); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhoneApp. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hPhoneApp", + dwTestCase+1); + + // + // Save original hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp_Orig = lpTapiPhoneTestInfo->hPhoneApp1; + + // + // bad hPhoneApp + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhoneApp = (HPHONEAPP)gdwInvalidHandles[i]; + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, + PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhoneApp + // + + lpTapiPhoneTestInfo->hPhoneApp1 = lpTapiPhoneTestInfo->hPhoneApp_Orig; + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Verify hPhoneApp can't be used after successful + // shutdown(try phoneShutdown again) with no other + // existing hPhoneApps. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify hPhoneApp can't be used after successful" + " shutdown(try phoneShutdown again)with no other existing hPhoneApps.", + dwTestCase+1); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown again + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Verify hPhoneApp can't be used after successful + // shutdown(try phoneShutdown again) when other + // hPhoneApps exist. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize phone app 1 + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Initialize phone app 2 + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify hPhoneApp can't be used after successful" + " shutdown(try phoneShutdown again)when other hPhoneApps exist.", + dwTestCase+1); + + + // + // Shutdown phone app 2 + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown phone app 2 again + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, PHONEERR_INVALAPPHANDLE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Shutdown phone app 1 + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Verify hPhoneApp can't be used after (try + // phoneShutdown again) when phoneInitialize returns + // error. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + lpTapiPhoneTestInfo->lpdwNumDevs = (LPDWORD)gdwInvalidPointers[0]; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify hPhoneApp can't be used after (try" + " phoneShutdown again) when phoneInitialize returns error.", + dwTestCase+1); + + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Verify expected PHONESTATE_OWNER/MONITOR msgs + // sent when hPhoneApp shutdown. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for owner + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify expected PHONESTATE_MONITOR " + "msgs are sent when hPhoneApp is shutdown .", + dwTestCase+1); + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITOR msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_OWNER| + PHONESTATE_MONITORS; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Add the PHONESTATE_OWNER/MONITOR message to the list of expected + // messages. + // + + AddMessage(PHONE_STATE, + 0x00000000, + (DWORD) lpCallbackParams, + PHONESTATE_MONITORS, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1)); + + // + // Initialize + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for MONITOR on hPhoneApp2. + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // shutdown + // + + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Wait for the PHONESTATE_OWNER message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + // + // shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: Verify expected PHONESTATE_OWNER/MONITOR msgs + // sent when hPhoneApp shutdown. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for owner + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Verify expected PHONESTATE_OWNER " + "msgs are sent when hPhoneApp is shutdown .", + dwTestCase+1); + + // + // Set the status messages to allow hphone1 to receive + // PHONESTATE_OWNER/MONITOR msgs. + // + + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_OWNER| + PHONESTATE_MONITORS; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Add the PHONESTATE_OWNER/MONITOR message to the list of expected + // messages. + // + + AddMessage(PHONE_STATE, + 0x00000000, + (DWORD) lpCallbackParams, + PHONESTATE_OWNER, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1)); + + // + // Initialize + // + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp2; + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone for OWNER on hPhoneApp2. + // + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone2; + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + // + // phone open + // + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // shutdown + // + + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Wait for the PHONESTATE_OWNER message + // + + if (! WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiPhoneTestInfo->lphPhoneApp = &lpTapiPhoneTestInfo->hPhoneApp1; + + // + // shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneShutdown: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneShutdown <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsbi.c b/private/tapi/qa/trapper/itest/tphone/itpsbi.c new file mode 100644 index 000000000..9a9f3f82d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsbi.c @@ -0,0 +1,2218 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsbi.c + +Abstract: + + This module contains the test functions for phoneSetButtonInfo + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 Additional param tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetButtonInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No owner privilege for hPhone +// 4. Bad lpButtonInfo +// 5. Bad lpButtonInfo->dwTotalSize +// +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetButtonInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + PHONEBUTTONINFO buttonInfo; + char* lpVoid=NULL; + DWORD dwAllocSize, dwTotalSize; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetButtonInfo <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: phoneSetButtonInfo for go/no-go for OWNER", + dwTestCase+1); + + + + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + (128 *sizeof(WCHAR)) + ); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + (128*sizeof(char)) + ); + } + else + { + } + + // + // Do set all field in ButtonInfo here + // + + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)+(128 *sizeof(WCHAR)); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)+(128 *sizeof(char)); + } + else + { + } + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + // + // also use the dwButtonTextSize fields for code coverage + // + + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize= wcslen(L"Test String")+1; + lpVoid = (char*)(lpTapiPhoneTestInfo->lpButtonInfo); + lpVoid += sizeof(PHONEBUTTONINFO); + wcscpy((WCHAR*)lpVoid, L"Test String"); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize= strlen("Test String")+1; + lpVoid = (char*)(lpTapiPhoneTestInfo->lpButtonInfo); + lpVoid += sizeof(PHONEBUTTONINFO); + strcpy((char*)lpVoid, "Test String"); + } + else + { + } + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextOffset = sizeof(PHONEBUTTONINFO); + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + // + // copy the original value of PHONEBUTTONINFO + // + + memcpy(&buttonInfo, + lpTapiPhoneTestInfo->lpButtonInfo, + sizeof(PHONEBUTTONINFO)); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetButtonInfo for verify"); + + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // compare the retrieved value and original set value of + // PHONEBUTTONINFO + // + + if(buttonInfo.dwButtonMode != + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hPhone", + dwTestCase+1); + + + + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + + // + // Do set all field in ButtonInfo here + // + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No OWNER privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone with MONITOR privilege + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No OWNER privilege for hPhone", + dwTestCase+1); + + + + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + + // + // Do set all field in ButtonInfo here + // + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpButtonInfo. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpButtonInfo", + dwTestCase+1); + + + + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + + // + // Do set all field in ButtonInfo here + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO)gdwInvalidPointers[i]; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad lpButtonInfo->dwTotalSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Bad lpButtonInfo->dwTotalSize=0", + dwTestCase+1); + + + + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + // + // lpButtonInfo->dwTotalSize =0 + // + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = 0; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_STRUCTURETOOSMALL, + FALSE)) + { + TPHONE_FAIL(); + } + + // + // lpButtonInfo->dwTotalSize = fixed_size-1 + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Bad lpButtonInfo->dwTotalSize=fixedSize-1", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)-1; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_STRUCTURETOOSMALL, + FALSE)) + { + TPHONE_FAIL(); + } + + // + // lpButtonInfo->dwTotalSize = real big + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld:Bad lpButtonInfo->dwTotalSize=realBig", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = 0x7FFFFFFF; + + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER, + TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: phoneButtonInfo->dwButtonText Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwButtonTextOffset between dwTotalSize and dwAllocSize, good dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize = 16; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextOffset = dwTotalSize + 16; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwButtonTextOffset between dwTotalSize and dwAllocSize, bad dwSize not test for bug postphone"); + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwButtonTextOffset between dwTotalSize and dwAllocSize, bad dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize = BIGBUFSIZE; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextOffset = dwTotalSize + 16; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwButtonTextOffset between dwTotalSize and dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize = 0xffffffff; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextOffset = dwTotalSize + 16; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwButtonTextOffset > dwAllocSize, good dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize = 16; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextOffset = BIGBUFSIZE; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwButtonTextOffset = -1, good dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextSize = 16; + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonTextOffset = 0xffffffff; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case: phoneButtonInfo->dwDevSpecificText Offset value"); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwDevSpecificButtonTextOffset between dwTotalSize and dwAllocSize, good dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize = 16; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwDevSpecificOffset between dwTotalSize and dwAllocSize, bad dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize = BIGBUFSIZE; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, PHONEERR_OPERATIONFAILED, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwDevSpecificOffset between dwTotalSize and dwAllocSize, bad dwSize(-1)", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize = 0xffffffff; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = dwTotalSize + 16; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, PHONEERR_OPERATIONFAILED, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwDevSpecificOffset > dwAllocSize, good dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize = 16; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = BIGBUFSIZE; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, PHONEERR_OPERATIONFAILED, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: dwDevSpecificOffset = -1, good dwSize", + dwTestCase+1); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwAllocSize = BIGBUFSIZE; + dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + dwAllocSize); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = dwAllocSize; + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize = 16; + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = 0xffffffff; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, PHONEERR_OPERATIONFAILED, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + (128 *sizeof(WCHAR)) + ); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + (128*sizeof(char)) + ); + } + else + { + } + + // + // Do set all field in ButtonInfo here + // + + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)+(128 *sizeof(WCHAR)); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)+(128 *sizeof(char)); + } + else + { + } + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + // + // also use the dwDevSpecificSize fields for code coverage + // + + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize= wcslen(L"Test String")+1; + lpVoid = (char*)(lpTapiPhoneTestInfo->lpButtonInfo); + lpVoid += sizeof(PHONEBUTTONINFO); + wcscpy((WCHAR*)lpVoid, L"Test String"); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize= strlen("Test String")+1; + lpVoid = (char*)(lpTapiPhoneTestInfo->lpButtonInfo); + lpVoid += sizeof(PHONEBUTTONINFO); + strcpy((char*)lpVoid, "Test String"); + } + else + { + } + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = sizeof(PHONEBUTTONINFO); + + if ( ! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + (128 *sizeof(WCHAR)) + ); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + (128*sizeof(char)) + ); + } + else + { + } + + // + // Do set all field in ButtonInfo here + // + + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)+(128 *sizeof(WCHAR)); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO)+(128 *sizeof(char)); + } + else + { + } + + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + // + // also use the dwDevSpecificSize fields for code coverage + // + + if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_UNICODE) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize= wcslen(L"Test String")+1; + lpVoid = (char*)(lpTapiPhoneTestInfo->lpButtonInfo); + lpVoid += sizeof(PHONEBUTTONINFO); + wcscpy((WCHAR*)lpVoid, L"Test String"); + } + else if(lpTapiPhoneTestInfo->lpPhoneCaps->dwStringFormat == STRINGFORMAT_ASCII) + { + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificSize= strlen("Test String")+1; + lpVoid = (char*)(lpTapiPhoneTestInfo->lpButtonInfo); + lpVoid += sizeof(PHONEBUTTONINFO); + strcpy((char*)lpVoid, "Test String"); + } + else + { + } + lpTapiPhoneTestInfo->lpButtonInfo->dwDevSpecificOffset = sizeof(PHONEBUTTONINFO); + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetButtonInfo: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetButtonInfo <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsd.c b/private/tapi/qa/trapper/itest/tphone/itpsd.c new file mode 100644 index 000000000..7300df3f6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsd.c @@ -0,0 +1,973 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsd.c + +Abstract: + + This module contains the test functions for phoneSetData + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 additional param test + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetData +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No Onwer privilege for hPhone +// 4. Bad lpData +// 5. Bad dwSize +// +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetData(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwData1, dwData2; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetData <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: phoneSetData for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + // + // save dwData1 in dwData2 + // + + dwData1 = 0x5; + dwData2 = dwData1; + + // + // lpTapiPhoneTestInfo->lpData points to dwData1 + // + + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // compare set data and retrieved data + // + + if(dwData2 != *((LPDWORD)lpTapiPhoneTestInfo->lpData)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + dwData1 = 0x5; + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No OWNER privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: No OWNER privilege for hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + dwData1 = 0x5; + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpData. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad lpData", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + dwData1 = 0x5; + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + // + // Bad lpData + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpData = + (LPDWORD)gdwInvalidPointers[i]; + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER, + FALSE)) + { + TPHONE_FAIL(); + } + } + + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwSize=0", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + dwData1 = 0x5; + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = 0; + + // + // Bad dwSize=0 is valid, so we expect success returned + // + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, TAPISUCCESS, FALSE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: Bad dwSize=realBig", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwSize = 0x7FFFFFFF; + + if (! DoPhoneSetData(lpTapiPhoneTestInfo, PHONEERR_INVALPOINTER, FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + // + // save dwData1 in dwData2 + // + + dwData1 = 0x5; + dwData2 = dwData1; + + // + // lpTapiPhoneTestInfo->lpData points to dwData1 + // + + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if ( ! DoPhoneSetData(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDataID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumSetData-1); + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + + // + // save dwData1 in dwData2 + // + + dwData1 = 0x5; + dwData2 = dwData1; + + // + // lpTapiPhoneTestInfo->lpData points to dwData1 + // + + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData1; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetData(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetData: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetData <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsdp.c b/private/tapi/qa/trapper/itest/tphone/itpsdp.c new file mode 100644 index 000000000..77da417a6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsdp.c @@ -0,0 +1,1000 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsdp.c + +Abstract: + + This module contains the test functions for phoneSetDisplay + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + + pgopi March 1996 additional param tests + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetDisplay +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No owner privilege for hPhone +// 4. Bad lpDisplay +// 5. Bad dwSize +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetDisplay(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + LPSTR lpsTestStr; + DWORD dwNumColumns; + DWORD dwNumRows; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetDisplay <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetDisplay for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = (dwNumRows*dwNumColumns)*sizeof(char); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwRow = %lx, dwColumn = %lx, dwSize = %lx", + dwNumRows, dwNumColumns, lpTapiPhoneTestInfo->dwSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpsDisplay = %s", + lpTapiPhoneTestInfo->lpsDisplay); + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetDisplay for verify"); + // + // since we can expect a unicode string, we will allocate twice the + // amount of bytes for the string. + // + + lpTapiPhoneTestInfo->lpDisplay = (LPVARSTRING)AllocFromTestHeap( + sizeof(VARSTRING)+(2*(dwNumRows*dwNumColumns)*sizeof(char))); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = + 2*(dwNumRows*dwNumColumns)*sizeof(char)+ sizeof(VARSTRING); + lpTapiPhoneTestInfo->lpDisplay->dwStringSize = + 2*(dwNumRows*dwNumColumns)*sizeof(char); + lpTapiPhoneTestInfo->lpDisplay->dwStringOffset = sizeof(VARSTRING); + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpDisplay->dwTotalSize = %lx, neededSize = %lx", + (DWORD) lpTapiPhoneTestInfo->lpDisplay->dwTotalSize, + lpTapiPhoneTestInfo->lpDisplay->dwNeededSize); + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpDisplay->dwTotalSize = %lx, neededSize = %lx", + (DWORD) lpTapiPhoneTestInfo->lpDisplay->dwTotalSize, + lpTapiPhoneTestInfo->lpDisplay->dwNeededSize); + + lpsTestStr = (LPSTR)lpTapiPhoneTestInfo->lpDisplay; + + // + // see raid bug #30836 (4/10/1996) for reason. + // we set dwStringFormat to STRINGFORMAT_ASCII even though + // phoneGetDisplay says it returning STRINGFORMAT_UNICODE + // + + lpTapiPhoneTestInfo->lpDisplay->dwStringFormat = STRINGFORMAT_ASCII; + if(lpTapiPhoneTestInfo->lpDisplay->dwStringFormat == STRINGFORMAT_ASCII) + { + if(strcmp(lpTapiPhoneTestInfo->lpsDisplay, + lpsTestStr+sizeof(VARSTRING))) + { + fTestPassed = FALSE; + } + } + else if(lpTapiPhoneTestInfo->lpDisplay->dwStringFormat == STRINGFORMAT_UNICODE) + { + LPSTR lpsAsciiStr = (LPSTR)AllocFromTestHeap + (lpTapiPhoneTestInfo->lpDisplay->dwStringSize/2); + wcstombs(lpsAsciiStr, + (WCHAR*)(lpsTestStr+sizeof(VARSTRING)), + wcslen((WCHAR*)(lpsTestStr+sizeof(VARSTRING)))+1); + if(strcmp(lpTapiPhoneTestInfo->lpsDisplay, + lpsTestStr)) + { + fTestPassed = FALSE; + } + } + else + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneCLose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = (dwNumRows*dwNumColumns)*sizeof(char); + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + + // + // phoneCLose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No Owner privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: No Owner privilege for hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = (dwNumRows*dwNumColumns)*sizeof(char); + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, + PHONEERR_NOTOWNER, + FALSE)) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneCLose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Bad lpsDisplay. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpsDisplay", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = (dwNumRows*dwNumColumns)*sizeof(char); + + // + // invalid pointer test for lpsDisplay + // + + for(i=0; i < NUMINVALIDPOINTERS; i++) + { + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)gdwInvalidPointers[i]; + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, + PHONEERR_INVALPOINTER, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneCLose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: Bad dwSize. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = 0; + + // + // bad dwSize + // + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, + TAPISUCCESS, + FALSE)) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneCLose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Shutdown and end the tests + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = (dwNumRows*dwNumColumns)*sizeof(char); + + + if ( ! DoPhoneSetDisplay(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwRow = 0; + dwNumRows = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumRows; + lpTapiPhoneTestInfo->dwColumn = 0; + dwNumColumns = lpTapiPhoneTestInfo->lpPhoneCaps->dwDisplayNumColumns; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + (dwNumRows*dwNumColumns)*sizeof(char)); + strcpy(lpTapiPhoneTestInfo->lpsDisplay,"this is a test"); + lpTapiPhoneTestInfo->dwSize = (dwNumRows*dwNumColumns)*sizeof(char); + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetDisplay(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetDisplay: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetDisplay <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsg.c b/private/tapi/qa/trapper/itest/tphone/itpsg.c new file mode 100644 index 000000000..50b544506 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsg.c @@ -0,0 +1,1017 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsg.c + +Abstract: + + This module contains the test functions for phoneSetGain + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetGain +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Verify Setting Gain that exceed maximum and that 0x0000FFFF is returned +// from phoneSetGain. +// 3. Bad hPhone +// 4. No Owner privilege for hPhone +// 5. BitVectorParamErrorTest for dwHookSwitchDevs +// 6. BitVectorParamValidTest for dwHookSwitchDevs +// +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetGain(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSaveSetGain; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetGain <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetGain for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + dwSaveSetGain = lpTapiPhoneTestInfo->dwGain ; + + if (! DoPhoneSetGain(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetGain for verify"); + + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(dwSaveSetGain != lpTapiPhoneTestInfo->dwGain) + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Verify Setting Gain that exceed maximum and that + // 0x0000FFFF is returned from phoneSetGain. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld:Verify Setting Gain that exceed maximum" + " and that 0x0000FFFF is returned from phoneSetGain.", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x7FFFFFFF; + + + if (! DoPhoneSetGain(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetGain for verify"); + + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(0x0000FFFF != lpTapiPhoneTestInfo->dwGain) + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetGain(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: No owner privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetGain for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + + if (! DoPhoneSetGain(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetGain for verify"); + + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: BitVectorParamErrorTest for dwHookSwitchDevs. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwHookSwitchDevs", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + lpTapiPhoneTestInfo->dwGain = 0x2; + + // + // BitVectorParamErrorTest for dwHookSwitchDevs + // + + if(! TestPhoneInvalidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetGain, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + PHONEERR_INVALHOOKSWITCHDEV, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET | + PHONEHOOKSWITCHDEV_SPEAKER | + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: BitVectorParamValidTest for dwHookSwitchDevs. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwHookSwitchDevs", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + lpTapiPhoneTestInfo->dwGain = 0x2; + + // + // BitVectorParamvalidTest for dwHookSwitchDevs + // + + if(! TestPhoneValidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetGain, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + dwSaveSetGain = lpTapiPhoneTestInfo->dwGain ; + + if ( ! DoPhoneSetGain(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + dwSaveSetGain = lpTapiPhoneTestInfo->dwGain ; + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetGain(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetGain: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetGain <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpshs.c b/private/tapi/qa/trapper/itest/tphone/itpshs.c new file mode 100644 index 000000000..8a0db389d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpshs.c @@ -0,0 +1,1157 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpshs.c + +Abstract: + + This module contains the test functions for phoneSetHookSwitch + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetHookSwitch +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No owner privilege for hPhone +// 4. BitVectorErrorTest for dwHookSwitchDev +// 5. BitVectorErrorTest for dwHookSwitchMode +// 6. BitVectorValidTest for dwHookSwitchDevs +// 7. BitVectorValidTest for dwHookSwitchMode +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetHookSwitch(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetHookSwitch <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetHookSwitch for go/no-go for OWNER", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + if (! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail(DBUG_SHOW_DETAIL, "#### Call phoneGetHookSwitch for verify"); + + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if((lpTapiPhoneTestInfo->dwHookSwitchMode != PHONEHOOKSWITCHMODE_ONHOOK)&& + (lpTapiPhoneTestInfo->dwHookSwitchDevs != PHONEHOOKSWITCHDEV_HANDSET)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hPhone", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No owner privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: No owner privilege for hPhone", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + if (! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: BitVectorParamErrorTest for dwHookSwitchDev. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwHookSwitchDev", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = 0; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + // + // BitVectorParamErrorTest for dwHookSwitchDevs + // + + if(! TestPhoneInvalidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetHookSwitch, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + PHONEERR_INVALHOOKSWITCHDEV, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET | + PHONEHOOKSWITCHDEV_SPEAKER | + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: BitVectorParamErrorTest for dwHookSwitchMode. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwHookSwitchMode", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = 0; + + // + // BitVectorParamErrorTest for dwHookSwitchMode + // + + if(! TestPhoneInvalidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetHookSwitch, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchMode, + PHONEERR_INVALHOOKSWITCHMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHMODE_ONHOOK | + PHONEHOOKSWITCHMODE_MIC | + PHONEHOOKSWITCHMODE_SPEAKER | + PHONEHOOKSWITCHMODE_MICSPEAKER), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: BitVectorParamValidTest for dwHookSwitchDev. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwHookSwitchDev", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + // + // BitVectorParamValidTest for dwHookSwitchDevs + // + + if(! TestPhoneValidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetHookSwitch, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: BitVectorParamValidTest for dwHookSwitchMode. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwHookSwitchDev", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + // + // BitVectorParamValidTest for dwHookSwitchMode + // + + if(! TestPhoneValidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetHookSwitch, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHMODE_ONHOOK | + PHONEHOOKSWITCHMODE_MIC | + PHONEHOOKSWITCHMODE_SPEAKER | + PHONEHOOKSWITCHMODE_MICSPEAKER), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // phoneClose + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + if ( ! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = PHONEHOOKSWITCHMODE_ONHOOK; + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetHookSwitch: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetHookSwitch <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsl.c b/private/tapi/qa/trapper/itest/tphone/itpsl.c new file mode 100644 index 000000000..65dd67c0f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsl.c @@ -0,0 +1,922 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsl.c + +Abstract: + + This module contains the test functions for phoneSetLamp + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetLamp +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No owner privilege for hPhone +// 4. BitVectorParamErrorTest for dwLampMode +// 5. BitVectorParamValidTest for dwLampMode +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetLamp(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetLamp <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetLamp for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + TapiLogDetail(DBUG_SHOW_DETAIL,"#### Call phoneGetLamp for verify"); + + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(lpTapiPhoneTestInfo->dwLampMode != PHONELAMPMODE_FLUTTER) + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No owner privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetLamp for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: BitVectorParamErrorTest for dwLampMode. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwLampMode", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + // + // BitVectorParamErrorTest for dwLampMode + // + + if(! TestPhoneInvalidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetLamp, + (LPDWORD) &lpTapiPhoneTestInfo->dwLampMode, + PHONEERR_INVALLAMPMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONELAMPMODE_BROKENFLUTTER| + PHONELAMPMODE_FLASH| + PHONELAMPMODE_FLUTTER | + PHONELAMPMODE_OFF| + PHONELAMPMODE_STEADY| + PHONELAMPMODE_WINK| + PHONELAMPMODE_DUMMY), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: BitVectorParamValidTest for dwLampMode. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwLampMode", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + // + // BitVectorParamValidTest for dwLampMode + // + + if(! TestPhoneValidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetLamp, + (LPDWORD) &lpTapiPhoneTestInfo->dwLampMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONELAMPMODE_BROKENFLUTTER| + PHONELAMPMODE_FLASH| + PHONELAMPMODE_FLUTTER | + PHONELAMPMODE_OFF| + PHONELAMPMODE_STEADY| + PHONELAMPMODE_WINK| + PHONELAMPMODE_DUMMY), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if ( ! DoPhoneSetLamp(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwButtonLampID = + (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpdwLampMode = &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetLamp(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetLamp: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetLamp <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsr.c b/private/tapi/qa/trapper/itest/tphone/itpsr.c new file mode 100644 index 000000000..08c2e10a2 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsr.c @@ -0,0 +1,789 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsr.c + +Abstract: + + This module contains the test functions for phoneSetRing + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetRing +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No owner privilege for hPhone +// 4. Verify setting ring volume that exceeds maximum and that 0x0000FFFF is +// returned from phoneGetRing +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetRing(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetRing <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetRing for go/no-go for OWNER", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + if (! DoPhoneSetRing(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetRing for verify"); + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(lpTapiPhoneTestInfo->dwVolume != 0x3) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hPhone", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetRing(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No owner privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: No owner privilege for hPhone. ", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + if (! DoPhoneSetRing(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: Verify setting ring volume that exceeds maximum and + // that 0x0000FFFF is returned from phoneGetRing. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify setting ring volume that exceeds maximum" + " and that 0x0000FFFF is returned from phoneGetRing", + dwTestCase+1); + + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x7FFFFFFF; + + if (! DoPhoneSetRing(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetRing for verify"); + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(lpTapiPhoneTestInfo->dwVolume != 0x0000FFFF) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + + if ( ! DoPhoneSetRing(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwRingMode = &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetRing(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetRing: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetRing <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + + +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpssm.c b/private/tapi/qa/trapper/itest/tphone/itpssm.c new file mode 100644 index 000000000..4d9a87718 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpssm.c @@ -0,0 +1,1646 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpssm.c + +Abstract: + + This module contains the test functions for phoneSetStatusMessages + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetStatusMessages +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Baf hPhone +// 3. BitVectorParamErrorTest for dwPhoneStates +// 4. BitVectorParamErrorTest for dwButtonModes +// 5. BitVectorParamErrorTest for dwButtonStates +// 6. BitVectorParamValidTest for dwPhoneStates +// 7. BitVectorParamValidTest for dwButtonModes +// 8. BitVectorParamValidTest for dwButtonStates +// 9. Verify that PHONE_STATE and PHONE_BUTTON msgs sent and filetered +// correctly. +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetStatusMessages(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwVariation=0; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetStatusMessages <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: phoneSetStatusMessages for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetStatusMessages for verify"); + + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // REINIT cannot be masked so we have to take care of that into account + // when we do the verification + // + + if((lpTapiPhoneTestInfo->dwPhoneStates != ( PHONESTATE_REINIT| PHONESTATE_CONNECTED)) || + (lpTapiPhoneTestInfo->dwButtonModes != PHONEBUTTONMODE_CALL) || + (lpTapiPhoneTestInfo->dwButtonStates != PHONEBUTTONSTATE_UP)) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: BitVectorParamErrorTest for dwPhoneStates. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: BitVectorParamErrorTest for dwPhoneStates.", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = 0; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + // + // BitVectorParamErrorTest for dwPhoneStates + // + + if(! TestPhoneInvalidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneSetStatusMessages, + (LPDWORD) &lpTapiPhoneTestInfo->dwPhoneStates, + PHONEERR_INVALPHONESTATE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONESTATE_OTHER| + PHONESTATE_CONNECTED| + PHONESTATE_DISCONNECTED| + PHONESTATE_OWNER| + PHONESTATE_MONITORS| + PHONESTATE_DISPLAY| + PHONESTATE_LAMP| + PHONESTATE_RINGMODE| + PHONESTATE_RINGVOLUME| + PHONESTATE_HANDSETHOOKSWITCH| + PHONESTATE_HANDSETVOLUME| + PHONESTATE_HANDSETGAIN| + PHONESTATE_SPEAKERHOOKSWITCH| + PHONESTATE_SPEAKERVOLUME| + PHONESTATE_SPEAKERGAIN| + PHONESTATE_HEADSETHOOKSWITCH| + PHONESTATE_HEADSETVOLUME| + PHONESTATE_HEADSETGAIN| + PHONESTATE_SUSPEND| + PHONESTATE_RESUME| + PHONESTATE_DEVSPECIFIC| + PHONESTATE_REINIT| + PHONESTATE_CAPSCHANGE| + PHONESTATE_REMOVED), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xFFFFFFFF, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: BitVectorParamErrorTest for dwButtonModes. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: BitVectorParamErrorTest for dwButtonModes.", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = 0;//PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + // + // BitVectorParamErrorTest for dwButtonModes + // + + if(! TestPhoneInvalidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneSetStatusMessages, + (LPDWORD) &lpTapiPhoneTestInfo->dwButtonModes, + PHONEERR_INVALBUTTONMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEBUTTONMODE_CALL| + PHONEBUTTONMODE_FEATURE| + PHONEBUTTONMODE_KEYPAD| + PHONEBUTTONMODE_LOCAL| + PHONEBUTTONMODE_DISPLAY), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x0000001F, + 0xFFFFFFFF, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: BitVectorParamErrorTest for dwButtonStates. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: BitVectorParamErrorTest for dwButtonStates.", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = 0;//PHONEBUTTONSTATE_UP; + + // + // BitVectorParamErrorTest for dwButtonStates + // + + if(! TestPhoneInvalidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneSetStatusMessages, + (LPDWORD) &lpTapiPhoneTestInfo->dwButtonStates, + PHONEERR_INVALBUTTONSTATE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEBUTTONSTATE_UP| + PHONEBUTTONSTATE_DOWN| + PHONEBUTTONSTATE_UNKNOWN| + PHONEBUTTONSTATE_UNAVAIL), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xFFFFFFFF, + FALSE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + + // =================================================================== + // =================================================================== + // + // 6. Test Case: BitVectorParamValidTest for dwPhoneStates. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: BitVectorParamValidTest for dwPhoneStates", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + // + // BitVectorParamValidTest for dwPhoneSTates + // + + if(! TestPhoneValidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneSetStatusMessages, + (LPDWORD) &lpTapiPhoneTestInfo->dwPhoneStates, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONESTATE_OTHER| + PHONESTATE_CONNECTED| + PHONESTATE_DISCONNECTED| + PHONESTATE_OWNER| + PHONESTATE_MONITORS| + PHONESTATE_DISPLAY| + PHONESTATE_LAMP| + PHONESTATE_RINGMODE| + PHONESTATE_RINGVOLUME| + PHONESTATE_HANDSETHOOKSWITCH| + PHONESTATE_HANDSETVOLUME| + PHONESTATE_HANDSETGAIN| + PHONESTATE_SPEAKERHOOKSWITCH| + PHONESTATE_SPEAKERVOLUME| + PHONESTATE_SPEAKERGAIN| + PHONESTATE_HEADSETHOOKSWITCH| + PHONESTATE_HEADSETVOLUME| + PHONESTATE_HEADSETGAIN| + PHONESTATE_SUSPEND| + PHONESTATE_RESUME| + PHONESTATE_DEVSPECIFIC| + PHONESTATE_REINIT| + PHONESTATE_CAPSCHANGE| + PHONESTATE_REMOVED), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: BitVectorParamValidTest for dwButtonModes. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: BitVectorParamValidTest for dwButtonModes", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + // + // BitVectorParamValidTest for dwButtonModes + // + + if(! TestPhoneValidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneSetStatusMessages, + (LPDWORD) &lpTapiPhoneTestInfo->dwButtonModes, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEBUTTONMODE_CALL| + PHONEBUTTONMODE_FEATURE| + PHONEBUTTONMODE_KEYPAD| + PHONEBUTTONMODE_LOCAL| + PHONEBUTTONMODE_DISPLAY), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: BitVectorParamValidTest for dwButtonStates. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: BitVectorParamValidTest for dwButtonStates", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + // + // BitVectorParamValidTest for dwButtonStates + // + + if(! TestPhoneValidBitFlags( + lpTapiPhoneTestInfo, + DoPhoneSetStatusMessages, + (LPDWORD) &lpTapiPhoneTestInfo->dwButtonStates, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEBUTTONSTATE_UP| + PHONEBUTTONSTATE_DOWN| + PHONEBUTTONSTATE_UNKNOWN| + PHONEBUTTONSTATE_UNAVAIL), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 9. Test Case:Verify PHONE_STATE and PHONE_BUTTON msgs sent and + // filtered correctly. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test case %ld: Verify PHONE_STATE and PHONE_BUTTON msgs are" + " sent and filtered correctly", + dwTestCase+1); + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_DISPLAY; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_DISPLAY; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = PHONE_STATE; + info.u.EspMsg.dwParam1 = PHONESTATE_DISPLAY; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiPhoneTestInfo->lpParams = &info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + // + // Add the PHONESTATE_DISPLAY message to the list of expected + // messages. + // + + AddMessage(PHONE_STATE, + 0x00000000, + (DWORD) lpCallbackParams, + PHONESTATE_DISPLAY, + 0x00000000, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1)); + + if(!DoPhoneDevSpecific(lpTapiPhoneTestInfo,TAPISUCCESS,TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "PHONESTATE_DISPLAY msg not received"); + dwVariation++; + + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = PHONE_BUTTON; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = PHONEBUTTONMODE_DISPLAY; + info.u.EspMsg.dwParam3 = 0; + + lpTapiPhoneTestInfo->lpParams = &info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + // + // Add the PHONESTATE_DISPLAY message to the list of expected + // messages. + // + + AddMessage(PHONE_BUTTON, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + PHONEBUTTONMODE_DISPLAY, + 0x00000000, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM2)); + + if(!DoPhoneDevSpecific(lpTapiPhoneTestInfo,TAPISUCCESS,TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "PHONEBUTTONMODE_DISPLAY msg not received"); + dwVariation++; + + } + + // + // Use a hook to generate an ESP event using phoneDevSpecific. + // look in tcore\devspec.h for details + // + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + // + // make sure to use the SPI (not API) msg params here (not + // necessarily the same) + // + + info.u.EspMsg.dwMsg = PHONE_BUTTON; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = PHONEBUTTONSTATE_UP; + + lpTapiPhoneTestInfo->lpParams = &info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + // + // Add the PHONESTATE_DISPLAY message to the list of expected + // messages. + // + + AddMessage(PHONE_BUTTON, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + 0x00000000, + PHONEBUTTONSTATE_UP, + (TAPIMSG_DWMSG | + TAPIMSG_DWPARAM3)); + + if(!DoPhoneDevSpecific(lpTapiPhoneTestInfo,TAPISUCCESS,TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "PHONEBUTTONSTATE_UP msg not received"); + dwVariation++; + + } + + if(dwVariation != 0) + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + + if ( ! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + if ( ! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, info.u.EspResult.lResult)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetStatusMessage: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetStatusMessage <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; + +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/itpsv.c b/private/tapi/qa/trapper/itest/tphone/itpsv.c new file mode 100644 index 000000000..6a4a656a3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/itpsv.c @@ -0,0 +1,1018 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpsv.c + +Abstract: + + This module contains the test functions for phoneSetVolume + +Author: + + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "tphone.h" + + + +// phoneSetVolume +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// 1. Go/No-Go test +// 2. Bad hPhone +// 3. No owner privilege for hPhone +// 4. BitVectorParamErrorTest for dwHookSwitchDev +// 5. BitVectorParamValidTest for dwHookSwitchDev +// 6. Verify Setting volume that exceeds maximum and that 0x0000FFFF is +// returned by phoneGetVolume +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetVolume(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT i; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + INT n; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>>>>>>>>>> Test phoneSetVolume <<<<<<<<<<<<<<<<<"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: Go/No-Go test for owner. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: phoneSetVolume for go/no-go for OWNER", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + if (! DoPhoneSetVolume(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetVolume for verify"); + + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(lpTapiPhoneTestInfo->dwVolume != 0x7) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: Bad hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + // + // save the original hPhone + // + + lpTapiPhoneTestInfo->hPhone_Orig = lpTapiPhoneTestInfo->hPhone1; + + + // + // bad hPhone + // + + for(i=0; i < NUMINVALIDHANDLES; i++) + { + *lpTapiPhoneTestInfo->lphPhone = (HPHONE)gdwInvalidHandles[i]; + + if (! DoPhoneSetVolume(lpTapiPhoneTestInfo, + PHONEERR_INVALPHONEHANDLE, + FALSE)) + { + TPHONE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Restore hPhone + // + + lpTapiPhoneTestInfo->hPhone1 = lpTapiPhoneTestInfo->hPhone_Orig; + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: No owner privilege for hPhone. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_MONITOR; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: No owner privilege for hPhone", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + if (! DoPhoneSetVolume(lpTapiPhoneTestInfo, PHONEERR_NOTOWNER, FALSE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: BitVectorParamErrorTest for dwHookSwitchDev. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwHookSwitchDev", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = 0; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + // + // BitVectorParamErrorTest for dwHookSwitchDev + // + + if(! TestPhoneInvalidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetVolume, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + PHONEERR_INVALHOOKSWITCHDEV, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: BitVectorParamValidTest for dwHookSwitchDev. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwHookSwitchDev", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + // + // BitVectorParamValidTest for dwHookSwitchDev + // + + if(! TestPhoneValidBitFlagsAsy( + lpTapiPhoneTestInfo, + DoPhoneSetVolume, + (LPDWORD) &lpTapiPhoneTestInfo->dwHookSwitchDev, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + (PHONEHOOKSWITCHDEV_HANDSET| + PHONEHOOKSWITCHDEV_SPEAKER| + PHONEHOOKSWITCHDEV_HEADSET), + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TPHONE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: Verify Setting volume that exceeds maximum and that + // 0x0000FFFF is returned by phoneGetVolume. + // + // =================================================================== + // =================================================================== + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + fTestPassed = TRUE; + + // + // Initialize a phone app + // + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify Setting volume that exceeds maximum" + " and that 0x0000FFFF is returned by phoneGetVolume", + dwTestCase+1); + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7FFFFFFF; + + if (! DoPhoneSetVolume(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Call phoneGetVolume for verify"); + + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if(lpTapiPhoneTestInfo->dwVolume != 0x0000FFFF) + { + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // + // Close the phone + // + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Shutdown + // + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = TAPISUCCESS; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + + if ( ! DoPhoneSetVolume(lpTapiPhoneTestInfo, info.u.EspResult.lResult, TRUE)) + { + TPHONE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_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 + ); + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->lphPhone = &lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = PHONEERR_RESOURCEUNAVAIL; + info.u.EspResult.dwCompletionType = n; + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + + if(! DoPhoneDevSpecific(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwHookSwitchDev = PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + + lpTapiPhoneTestInfo->fCompletionModeSet = TRUE; + if ( ! DoPhoneSetVolume(lpTapiPhoneTestInfo, info.u.EspResult.lResult, FALSE)) + { + TPHONE_FAIL(); + } + + AddMessage( + PHONE_REPLY, + 0x00000000, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TPHONE_FAIL(); + } + + + lpTapiPhoneTestInfo->fCompletionModeSet = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown to isolate the test case + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Free the memory allocated during the tests + FreeTestHeap(); + } + + + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ PhoneSetVolume: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing PhoneSetVolume <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tphone/msgphone.c b/private/tapi/qa/trapper/itest/tphone/msgphone.c new file mode 100644 index 000000000..579157673 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/msgphone.c @@ -0,0 +1,504 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + msgphone.c + +Abstract: + + This module contains the test functions for all message sent test + +Author: + + Xiao Ying Ding (XiaoD) 5-9-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "dophone.h" +#include "tphone.h" + +#define NUMMSGS 5 +#define NUMMSG 5 + + +#define ITP_BUTTON 0 +#define ITP_CLOSE 1 +#define ITP_CREATE 2 +#define ITP_DEVSPECIFIC 3 +#define ITP_STATE 4 + + +typedef struct _MSGLIST +{ + char szMsg[32]; + DWORD dwMsg; +} MSGLIST, *PMSGLIST; + +ESPDEVSPECIFICINFO info; +DWORD dwHandle; + + +DWORD MsgPhoneCommFunc(LPTAPIPHONETESTINFO lpTapiPhoneTestInfo, BOOL fQuietMode); + + +BOOL TestPhoneMessages(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + LONG lResult; + DWORD dwParam; + DWORD dwParam1; + DWORD dwMsg; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + MSGLIST MsgList[] = + { + { "PHONE_BUTTON", PHONE_BUTTON }, + { "PHONE_CLOSE", PHONE_CLOSE }, + { "PHONE_CREATE", PHONE_CREATE }, + { "PHONE_DEVSPECIFIC", PHONE_DEVSPECIFIC }, + { "PHONE_STATE", PHONE_STATE } + }; + + + + InitTestNumber(); + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiPhoneTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing phone messages <<<<<<<<" + ); + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + for(n = 0; n< NUMMSG; n++) + { + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test %s message", + dwTestCase + 1, MsgList[n].szMsg); + + info.u.EspMsg.dwMsg = MsgList[n].dwMsg; + + switch (n) + { + case ITP_BUTTON: + for(dwParam = PHONEBUTTONMODE_DUMMY; dwParam <= PHONEBUTTONMODE_DISPLAY; ) + { + for(dwParam1 = PHONEBUTTONSTATE_UP; dwParam1 <= PHONEBUTTONSTATE_UNAVAIL;) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = dwParam; + info.u.EspMsg.dwParam3 = dwParam1; + fTestPassed = MsgPhoneCommFunc(lpTapiPhoneTestInfo, TRUE); + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_DEVSPECIFIC; + lpTapiPhoneTestInfo->dwButtonModes = dwParam; + lpTapiPhoneTestInfo->dwButtonStates = dwParam1; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + dwHandle = (DWORD) lpTapiPhoneTestInfo->hPhone1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 | TAPIMSG_DWPARAM3 + ); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + if(! DoPhoneDevSpecific (lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + (INT) dwParam1 <<= 1; + } + (INT) dwParam <<= 1; + } + FreeTestHeap(); + break; + + case ITP_CLOSE: + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgPhoneCommFunc(lpTapiPhoneTestInfo, TRUE); + dwHandle = 0; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + if(! DoPhoneDevSpecific (lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + FreeTestHeap(); + break; + + case ITP_CREATE: + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgPhoneCommFunc(lpTapiPhoneTestInfo, TRUE); + dwHandle = (DWORD) lpTapiPhoneTestInfo->hPhone1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + if(! DoPhoneDevSpecific (lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + FreeTestHeap(); + break; + + case ITP_DEVSPECIFIC: + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgPhoneCommFunc(lpTapiPhoneTestInfo, TRUE); + dwHandle = (DWORD) lpTapiPhoneTestInfo->hPhone1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + if(! DoPhoneDevSpecific (lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + FreeTestHeap(); + break; + + case ITP_STATE: + for(dwParam = PHONESTATE_OTHER; dwParam <= PHONESTATE_REMOVED; ) + { +TapiLogDetail( +DBUG_SHOW_DETAIL, +"dwParam = %lx", dwParam); + info.u.EspMsg.dwParam1 = dwParam; + if(info.u.EspMsg.dwParam1 >= PHONESTATE_HANDSETHOOKSWITCH && + info.u.EspMsg.dwParam1 <= PHONESTATE_HEADSETVOLUME) + for(dwParam1 = PHONEHOOKSWITCHMODE_ONHOOK; + dwParam1 <= PHONEHOOKSWITCHMODE_UNKNOWN;) + { + info.u.EspMsg.dwParam2 = dwParam1; + info.u.EspMsg.dwParam3 = 0; + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + fTestPassed = MsgPhoneCommFunc(lpTapiPhoneTestInfo, TRUE); + dwHandle = (DWORD) lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = dwParam; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + if(! DoPhoneDevSpecific (lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + (INT) dwParam1 <<= 1; + } + else + { + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + + fTestPassed = MsgPhoneCommFunc(lpTapiPhoneTestInfo, TRUE); + dwHandle = (DWORD) lpTapiPhoneTestInfo->hPhone1; + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = dwParam; + lpTapiPhoneTestInfo->dwButtonModes = 0; + lpTapiPhoneTestInfo->dwButtonStates = 0; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiPhoneTestInfo->lpParams = (LPVOID)&info; + lpTapiPhoneTestInfo->dwSize = sizeof(info); + if(! DoPhoneDevSpecific (lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TPHONE_FAIL(); + } + + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + } + (INT) dwParam <<= 1; + } + FreeTestHeap(); + break; + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ phone Messages test: 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 phone messages <<<<<<<<" + ); + + return fTestPassed; +} + + + +DWORD MsgPhoneCommFunc(LPTAPIPHONETESTINFO lpTapiPhoneTestInfo, BOOL fQuietMode) +{ + BOOL fTestPassed = TRUE; + + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Negotiate the API Version + // + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Get the phone device capabilities + // + + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // + // Open a phone + // + + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + return fTestPassed; +} + + + + + diff --git a/private/tapi/qa/trapper/itest/tphone/tphone.c b/private/tapi/qa/trapper/itest/tphone/tphone.c new file mode 100644 index 000000000..0fac2d93f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphone.c @@ -0,0 +1,510 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + tphone.c + +Abstract: + + This module contains functions for testing Telephony phone device APIs. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "tphone.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTphoneDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TTphoneDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTphoneDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + + +BOOL +Test1( + HINSTANCE hAppInst + ) +{ + return (TestPhoneUninit(TRUE, TRUE)); +} + + +BOOL +Test2( + HINSTANCE hAppInst + ) +{ + return (TestPhoneDevSpecific(TRUE, TRUE)); +} + + +BOOL +Test3( + HINSTANCE hAppInst + ) +{ + return (TestPhoneNegotiateExtVersion(TRUE, TRUE)); +} + + +BOOL +Test4( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetIcon(TRUE, TRUE)); +} + + +BOOL +Test5( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetID(TRUE, TRUE)); +} + + + +BOOL +Test6( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetStatus(TRUE, TRUE)); +} + + +BOOL +Test7( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetButtonInfo(TRUE, TRUE)); +} + + +BOOL +Test8( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetButtonInfo(TRUE, TRUE)); +} + + +BOOL +Test9( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetData(TRUE, TRUE)); +} + +BOOL +Test10( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetData(TRUE, TRUE)); +} + + +BOOL +Test11( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetDisplay(TRUE, TRUE)); +} + + +BOOL +Test12( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetDisplay(TRUE, TRUE)); +} + + +BOOL +Test13( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetGain(TRUE, TRUE)); +} + + +BOOL +Test14( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetGain(TRUE, TRUE)); +} + + +BOOL +Test15( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetHookSwitch(TRUE, TRUE)); +} + + + +BOOL +Test16( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetHookSwitch(TRUE, TRUE)); +} + + + +BOOL +Test17( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetLamp(TRUE, TRUE)); +} + + + +BOOL +Test18( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetLamp(TRUE, TRUE)); +} + + + + + +BOOL +Test19( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetRing(TRUE, TRUE)); +} + + +BOOL +Test20( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetRing(TRUE, TRUE)); +} + + + + + + +BOOL +Test21( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetStatusMessages(TRUE, TRUE)); +} + + +BOOL +Test22( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetStatusMessages(TRUE, TRUE)); +} + + + + +BOOL +Test23( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetVolume(TRUE, TRUE)); +} + + +BOOL +Test24( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetVolume(TRUE, TRUE)); +} + + +BOOL +Test25( + HINSTANCE hAppInst + ) +{ + return (TestPhoneClose(TRUE, TRUE)); +} + + +BOOL +Test26( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetDevCaps(TRUE, TRUE)); +} + +BOOL +Test27( + HINSTANCE hAppInst + ) +{ + return (TestPhoneInitialize(TRUE, TRUE)); +} + +BOOL +Test28( + HINSTANCE hAppInst + ) +{ + return (TestPhoneNegotiateAPIVersion(TRUE, TRUE)); +} + +BOOL +Test29( + HINSTANCE hAppInst + ) +{ + return (TestPhoneOpen(TRUE, TRUE)); +} + +BOOL +Test30( + HINSTANCE hAppInst + ) +{ + return (TestPhoneShutdown(TRUE, TRUE)); +} + + + +BOOL +WINAPI +Test31( + HINSTANCE hAppInst + ) +{ + return (TestPhoneInitializeEx(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test32( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetMessage(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test33( + HINSTANCE hAppInst + ) +{ + return (TestPhoneConfigDialog(TRUE, TRUE)); +} + + +BOOL +WINAPI +Test34( + HINSTANCE hAppInst + ) +{ + return (TestPhoneMessages(TRUE, FALSE)); +} + + + + +BOOL +ShouldTapiPhoneTestAbort(BOOL fQuiteMode) +{ + return FALSE; +} diff --git a/private/tapi/qa/trapper/itest/tphone/tphone.h b/private/tapi/qa/trapper/itest/tphone/tphone.h new file mode 100644 index 000000000..10fc4f446 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphone.h @@ -0,0 +1,305 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + tphone.h + +Abstract: + + This module contains prototypes for testing TAPI phone device functions. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef TPHONE_H +#define TPHONE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +// Macro for handling failures +#define TPHONE_FAIL() { \ + if (ShouldTapiPhoneTestAbort(fQuietMode)) \ + { \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp1); \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp2); \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +ShouldTapiPhoneTestAbort( + BOOL fQuiteMode + ); + + +BOOL +TestPhoneConfigDialog( + BOOL fQuiteMode, + BOOL fStandAlong + ); + + +BOOL +TestPhoneDevSpecific( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetButtonInfo( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetData( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetDisplay( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetGain( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetHookSwitch( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetIcon( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetID( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetLamp( + BOOL fQuiteMode, + BOOL fStandAlong + ); + + +BOOL +TestPhoneGetRing( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetStatus( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +BOOL +TestPhoneGetStatusMessages( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneGetVolume( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneNegotiateExtVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetButtonInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneSetData( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneSetDisplay( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetGain( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetHookSwitch( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetLamp( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetRing( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneSetStatusMessages( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneSetVolume( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneClose( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneGetDevCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneInitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneNegotiateAPIVersion( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneOpen( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestPhoneShutdown( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestPhoneInitializeEx( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneGetMessage( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestPhoneMessages( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +#endif // TPHONE_H + diff --git a/private/tapi/qa/trapper/itest/tphone/tphone.inc b/private/tapi/qa/trapper/itest/tphone/tphone.inc new file mode 100644 index 000000000..5834818e0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphone.inc @@ -0,0 +1,90 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=Ttphone +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib + + +DLLDEF= ..\ttphone.def +DLLBASE=0x6a000000 + +INCLUDES=..\..;..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES=..\tphone.c \ + ..\itpcd.c \ + ..\itpds.c \ + ..\itpgbi.c \ + ..\itpgd.c \ + ..\itpgdp.c \ + ..\itpgg.c \ + ..\itpghs.c \ + ..\itpgi.c \ + ..\itpgid.c \ + ..\itpgl.c \ + ..\itpgr.c \ + ..\itpgs.c \ + ..\itpgsm.c \ + ..\itpgv.c \ + ..\itpsbi.c \ + ..\itpsd.c \ + ..\itpsdp.c \ + ..\itpsg.c \ + ..\itpshs.c \ + ..\itpsl.c \ + ..\itpsr.c \ + ..\itpssm.c \ + ..\itpsv.c \ + ..\itpne.c \ + ..\itpc.c \ + ..\itpgdc.c \ + ..\itpi.c \ + ..\itpnav.c \ + ..\itpo.c \ + ..\itps.c \ + ..\itpie.c \ + ..\itpgm.c \ + ..\uline.c \ + ..\msgphone.c \ + ..\version.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=TTphoneDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tphone/tphonea/makefile b/private/tapi/qa/trapper/itest/tphone/tphonea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphonea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tphone/tphonea/sources b/private/tapi/qa/trapper/itest/tphone/tphonea/sources new file mode 100644 index 000000000..6a831b846 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphonea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tphone.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/tphone/tphonew/makefile b/private/tapi/qa/trapper/itest/tphone/tphonew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphonew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tphone/tphonew/sources b/private/tapi/qa/trapper/itest/tphone/tphonew/sources new file mode 100644 index 000000000..cf622b33b --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/tphonew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tphone.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tphone/ttphone.def b/private/tapi/qa/trapper/itest/tphone/ttphone.def new file mode 100644 index 000000000..7b5d404c8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/ttphone.def @@ -0,0 +1,44 @@ +LIBRARY tphone + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 + Test16 + Test17 + Test18 + Test19 + Test20 + Test21 + Test22 + Test23 + Test24 + Test25 + Test26 + Test27 + Test28 + Test29 + Test30 + Test31 + Test32 + Test33 + Test34 diff --git a/private/tapi/qa/trapper/itest/tphone/uline.c b/private/tapi/qa/trapper/itest/tphone/uline.c new file mode 100644 index 000000000..cf8860c14 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/uline.c @@ -0,0 +1,543 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the test functions for all uninitialize + phone APIs test + +Author: + + Palamalai Gopalakrishnan (pgopi) 3-8-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "dophone.h" +#include "tphone.h" + + +#define DWNUMCALLS 1 + +#define DWNUMAPIS 29 + +char szApiName[DWNUMAPIS][48] = +{ + "phoneClose", + "phoneConfigDialog", + "phoneDevSpecific", + "phoneGetButtonInfo", + "phoneGetData", + "phoneGetDevCaps", + "phoneGetDisplay", + "phoneGetGain", + "phoneGetHookSwitch", + "phoneGetIcon", + "phoneGetId", + "phoneGetLamp", + "phoneGetRing", + "phoneGetStatus", + "phoneGetStatusMessages", + "phoneGetVolume", + "phoneNegotiateAPIVersion", + "phoneNegotiateExtVersion", + "phoneOpen", + "phoneSetButtonInfo", + "phoneSetData", + "phoneSetDisplay", + "phoneSetGain", + "phoneSetHookSwitch", + "phoneSetLamp", + "phoneSetRing", + "phoneSetStatusMessages", + "phoneSetVolume", + "phoneShutdown" +}; + + +BOOL TestPhoneUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT i=0; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">>>>>>>>>> Test phoneXXX Unintialize tests <<<<<<<<<<<<<<<"); + // + // Test for UNINITIALIZED if this is the only TAPI app running + // + + if (fStandAlone) + { + for(i = 0; i < DWNUMAPIS; i++) + { + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + lpCallbackParams = GetCallbackParams(); + lpTapiPhoneTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[i]); + + switch (i) + { + case 0: + + if(! DoPhoneClose(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + + break; + case 1: + + lpTapiPhoneTestInfo->dwDeviceID = + (*(lpTapiPhoneTestInfo->lpdwNumDevs)== 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + if(! DoPhoneConfigDialog(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + + break; + case 2: + + { + PHONEBUTTONINFO TapiTestPhoneButtonInfo; + lpTapiPhoneTestInfo->lpParams = + (LPVOID)&TapiTestPhoneButtonInfo; + lpTapiPhoneTestInfo->dwSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneDevSpecific(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + } + + break; + case 3: + lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO); + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 4: + lpTapiPhoneTestInfo->dwDataID = 0; + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + + if (! DoPhoneGetData(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 5: + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = + sizeof(PHONECAPS); + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 6: + lpTapiPhoneTestInfo->lpDisplay = + (LPVARSTRING) AllocFromTestHeap(sizeof(VARSTRING)); + lpTapiPhoneTestInfo->lpDisplay->dwTotalSize = + sizeof(VARSTRING); + + if (! DoPhoneGetDisplay(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 7: + lpTapiPhoneTestInfo->dwHookSwitchDev = + PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwGain = &(lpTapiPhoneTestInfo->dwGain); + + if (! DoPhoneGetGain(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 8: + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + + if (! DoPhoneGetHookSwitch(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 9: + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 10: +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + lpTapiPhoneTestInfo->lpDeviceID = + &(lpTapiPhoneTestInfo->DeviceID); + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = + sizeof(VARSTRING); + + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 11: + lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpdwLampMode = + &(lpTapiPhoneTestInfo->dwLampMode); + + if (! DoPhoneGetLamp(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 12: + lpTapiPhoneTestInfo->lpdwRingMode = + &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = + &(lpTapiPhoneTestInfo->dwVolume); + + if (! DoPhoneGetRing(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 13: + lpTapiPhoneTestInfo->lpPhoneStatus = + (LPPHONESTATUS) AllocFromTestHeap(sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = + sizeof(PHONESTATUS); + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 14: + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + + if (! DoPhoneGetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 15: + lpTapiPhoneTestInfo->dwHookSwitchDev = + PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = + &(lpTapiPhoneTestInfo->dwVolume); + + if (! DoPhoneGetVolume(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 16: + lpTapiPhoneTestInfo->dwDeviceID = 0; + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 17: + lpTapiPhoneTestInfo->lpdwExtVersion = + &(lpTapiPhoneTestInfo->dwExtVersion); + + if (! DoPhoneNegotiateExtVersion(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 18: + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 19: + lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpButtonInfo = + (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO)); + + // Do set all field in ButtonInfo here + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = + sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = + PHONEBUTTONMODE_CALL; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + break; + case 20: + { + + ULONG dwData = 0x5; + lpTapiPhoneTestInfo->dwDataID = 0; + lpTapiPhoneTestInfo->lpData = (LPVOID) AllocFromTestHeap( + sizeof(DWORD)); + lpTapiPhoneTestInfo->lpData = (LPVOID) &dwData; + lpTapiPhoneTestInfo->dwSize = sizeof(DWORD); + if (! DoPhoneSetData(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + } + break; + case 21: + { + + ULONG dwNumRows = lpTapiPhoneTestInfo->dwRow = 2; + ULONG dwNumColumns = lpTapiPhoneTestInfo->dwColumn = 10; + lpTapiPhoneTestInfo->lpsDisplay = (LPSTR)AllocFromTestHeap( + sizeof(dwNumRows*dwNumColumns)); + lpTapiPhoneTestInfo->lpsDisplay = "this is a test"; + lpTapiPhoneTestInfo->dwSize = + sizeof(lpTapiPhoneTestInfo->lpsDisplay); + + + if (! DoPhoneSetDisplay(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + } + break; + case 22: + lpTapiPhoneTestInfo->dwHookSwitchDev = + PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwGain = 0x2; + + if (! DoPhoneSetGain(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + break; + case 23: + lpTapiPhoneTestInfo->lpdwHookSwitchDevs = + &(lpTapiPhoneTestInfo->dwHookSwitchDevs); + lpTapiPhoneTestInfo->dwHookSwitchDevs = + PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->dwHookSwitchMode = + PHONEHOOKSWITCHMODE_ONHOOK; + + if (! DoPhoneSetHookSwitch(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + break; + case 24: + lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpdwLampMode = + &(lpTapiPhoneTestInfo->dwLampMode); + lpTapiPhoneTestInfo->dwLampMode = PHONELAMPMODE_FLUTTER; + + if (! DoPhoneSetLamp(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + break; + case 25: + lpTapiPhoneTestInfo->lpdwRingMode = + &(lpTapiPhoneTestInfo->dwRingMode); + lpTapiPhoneTestInfo->lpdwVolume = + &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->lpPhoneCaps = + (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = + sizeof(PHONECAPS); + lpTapiPhoneTestInfo->dwRingMode = + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumRingModes; + lpTapiPhoneTestInfo->dwVolume = 0x3; + + if (! DoPhoneSetRing(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + break; + case 26: + + lpTapiPhoneTestInfo->lpdwPhoneStates = + &(lpTapiPhoneTestInfo->dwPhoneStates); + lpTapiPhoneTestInfo->lpdwButtonModes = + &(lpTapiPhoneTestInfo->dwButtonModes); + lpTapiPhoneTestInfo->lpdwButtonStates = + &(lpTapiPhoneTestInfo->dwButtonStates); + lpTapiPhoneTestInfo->dwPhoneStates = PHONESTATE_CONNECTED; + lpTapiPhoneTestInfo->dwButtonModes = PHONEBUTTONMODE_CALL; + lpTapiPhoneTestInfo->dwButtonStates = PHONEBUTTONSTATE_UP; + + if (! DoPhoneSetStatusMessages(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + case 27: + lpTapiPhoneTestInfo->dwHookSwitchDev = + PHONEHOOKSWITCHDEV_HANDSET; + lpTapiPhoneTestInfo->lpdwVolume = + &(lpTapiPhoneTestInfo->dwVolume); + lpTapiPhoneTestInfo->dwVolume = 0x7; + + if (! DoPhoneSetVolume(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED, + TRUE)) + { + TPHONE_FAIL(); + } + break; + case 28: + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, + PHONEERR_UNINITIALIZED)) + { + TPHONE_FAIL(); + } + break; + default: + TapiLogDetail( + DBUG_SHOW_DETAIL, + "TestPhoneUninit -- error in FOR loop limits"); + break; + } // switch + + fTestPassed = ShowTestCase(fTestPassed); + FreeTestHeap(); + + } // for + + } // if + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ Phone Uninitialize: 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 PhoneUninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + + diff --git a/private/tapi/qa/trapper/itest/tphone/version.rc b/private/tapi/qa/trapper/itest/tphone/version.rc new file mode 100644 index 000000000..96117751b --- /dev/null +++ b/private/tapi/qa/trapper/itest/tphone/version.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI Phone API test Library" +#define VER_INTERNALNAME_STR "ttphone.dll" +#define VER_ORIGINALFILENAME_STR "ttphone.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/tsline/dirs b/private/tapi/qa/trapper/itest/tsline/dirs new file mode 100644 index 000000000..aad230aa8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/dirs @@ -0,0 +1,2 @@ +DIRS = tslinea\ + tslinew diff --git a/private/tapi/qa/trapper/itest/tsline/itlgad.c b/private/tapi/qa/trapper/itest/tsline/itlgad.c new file mode 100644 index 000000000..ed114d922 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlgad.c @@ -0,0 +1,1509 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgat.c + +Abstract: + + This module contains the test functions for lineGatherDigits + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/8/96 added unicode support + +--*/ + + +#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" + + +#define PULSESIZE 16 +#define DTMFSIZE 16 +#define ALL_DIGITMODES (LINEDIGITMODE_PULSE | \ + LINEDIGITMODE_DTMF) + + +// lineGatherDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGatherDigits(BOOL fQuietMode, BOOL fStandAlone) + { + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwSize; + DWORD dwErrorCode; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + LPCALLBACKPARAMS lpCallbackParams; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGatherDigits <<<<<<<<" + ); + + + /* + // 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 support 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(); + } + */ + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + lpTapiLineTestInfo->dwNumDigits = 2; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_NOTOWNER)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwDigitModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + dwErrorCode = LINEERR_INVALDIGITMODE; + else + dwErrorCode = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGatherDigits, + (LPDWORD) &lpTapiLineTestInfo->dwDigitModes, +// LINEERR_INVALDIGITMODE, + dwErrorCode, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DIGITMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamTest for dwDigitModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineGatherDigits, + (LPDWORD) &lpTapiLineTestInfo->dwDigitModes, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DIGITMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwsDigits pointer ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpsDigits pointer ", dwTestCase + 1 + ); +#endif + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsDigits = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpsDigits = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwNumDigits = 0", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwNumDigits = 0; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwNumDigits = -1", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwNumDigits = 0xffffffff; + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwNumDigits = 2; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszTerminationDigits pointer ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszTerminationDigits pointer ", dwTestCase + 1 + ); +#endif + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszTerminationDigits = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwFirstDigitTineout, -1", dwTestCase + 1 + ); + + // Initialize a line app + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = NULL; +#else + lpTapiLineTestInfo->lpszTerminationDigits = NULL; +#endif + + lpTapiLineTestInfo->dwFirstDigitTimeout = 0xffffffff; + lpTapiLineTestInfo->dwInterDigitTimeout = 0xffffffff; + + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + /* + if(fTestPassed) + { + AddMessage( + LINE_GATHERDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGATHERTERM_TERMDIGIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + */ + +#ifdef WUNICODE + if(lpTapiLineTestInfo->lpwsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwsDigits = %ws", + lpTapiLineTestInfo->lpwsDigits); +#else + if(lpTapiLineTestInfo->lpsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); +#endif + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_GATHERDIGITS msg sent", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + // 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; + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + 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->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + lpTapiLineTestInfo->dwNumDigits = 2; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(fTestPassed) + { + AddMessage( + LINE_GATHERDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGATHERTERM_TERMDIGIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST +// TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | +// TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + } + + fTestPassed = ShowTestCase(fTestPassed); +#ifdef WUNICODE + if(lpTapiLineTestInfo->lpwsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwsDigits = %ws", + lpTapiLineTestInfo->lpwsDigits); +#else + if(lpTapiLineTestInfo->lpsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); +#endif + + // 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: Success, verify LINE_GATHERDIGITS msg filtered", 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; + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + 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->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (2) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (2) * sizeof(HCALL) + 8; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + lpTapiLineTestInfo->dwNumDigits = 2; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if( ! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_GATHERDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGATHERTERM_TERMDIGIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST +// TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | +// TAPIMSG_DWPARAM1 + ); + + if ( WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); +#ifdef WUNICODE + if(lpTapiLineTestInfo->lpwsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwsDigits = %ws", + lpTapiLineTestInfo->lpwsDigits); +#else + if(lpTapiLineTestInfo->lpsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); +#endif + + // Close the line + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +*/ + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszTerminationDigits set to NULL", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszTerminationDigits set to NULL", dwTestCase + 1 + ); +#endif + + // Initialize a line app + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = NULL; +#else + lpTapiLineTestInfo->lpszTerminationDigits = NULL; +#endif + + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + /* + if(fTestPassed) + { + AddMessage( + LINE_GATHERDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGATHERTERM_TERMDIGIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + */ + +#ifdef WUNICODE + if(lpTapiLineTestInfo->lpwsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwsDigits = %ws", + lpTapiLineTestInfo->lpwsDigits); +#else + if(lpTapiLineTestInfo->lpsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); +#endif + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszTerminationDigits set to empty string", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszTerminationDigits set to empty string", dwTestCase + 1 + ); +#endif + + // 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; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + 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(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L""; +#else + lpTapiLineTestInfo->lpszTerminationDigits = ""; +#endif + + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + if(lpTapiLineTestInfo->lpwsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwsDigits = %ws", + lpTapiLineTestInfo->lpwsDigits); +#else + if(lpTapiLineTestInfo->lpsDigits) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); +#endif + + /* + if(fTestPassed) + { + AddMessage( + LINE_GATHERDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGATHERTERM_TERMDIGIT, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + */ + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + n = ESP_RESULT_RETURNRESULT; + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + lpTapiLineTestInfo->dwNumDigits = 2; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + if ( ! DoLineGatherDigits(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALTIMEOUT; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + lpTapiLineTestInfo->dwNumDigits = 2; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + if ( ! DoLineGatherDigits(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGatherDigits: 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 lineGatherDigits <<<<<<<<" + ); + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlgap.c b/private/tapi/qa/trapper/itest/tsline/itlgap.c new file mode 100644 index 000000000..2d3e9e89f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlgap.c @@ -0,0 +1,1142 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgap.c + +Abstract: + + This module contains the test functions for lineGetAppPriority + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/8/96 added unicode support + +--*/ + + +#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" + + + +// lineGetAppPriority +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAppPriority(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwPrioritySav, dwPriority; +#ifdef WUNICODE + WCHAR wszAppFilename[] = L"testapp.exe"; +#else + CHAR szAppFilename[] = "testapp.exe"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetAppPriority <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Test no initialized case <<<<<<<<" + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename pointers", dwTestCase + 1 + ); +#endif + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAppFilename = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + lpTapiLineTestInfo->dwPriority = 0; + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non excutable ", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpwszAppFilename = L"readme.txt"; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non excutable ", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpszAppFilename = "readme.txt"; +#endif + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPriority = 0; + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non 8.3 format ", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpwszAppFilename = L"testsga"; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non 8.3 format ", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpszAppFilename = "testsga"; +#endif + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad MediaMode > 1 bit set ", dwTestCase + 1 + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM | + LINEMEDIAMODE_INTERACTIVEVOICE; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALMEDIAMODE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPriority = 0; + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionID", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtID = + (LPLINEEXTENSIONID) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + lpTapiLineTestInfo->dwPriority = 0; + fTestPassed = ShowTestCase(fTestPassed); +*/ + + FreeTestHeap(); + + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwRequestMode, for dwMediaMode = 0 ", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = 0; + + for (n = 3; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->dwRequestMode = + (DWORD) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALREQUESTMODE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionName", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtensionName = + (LPVARSTRING) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); +*/ + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpExtensionName == lpdwPriority", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + lpTapiLineTestInfo->lpExtensionName = + (LPVARSTRING) lpTapiLineTestInfo->lpdwPriority; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); +// lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = 0; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = fixed -1", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING) -1; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; +*/ + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwPriority ", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwPriority = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + dwPrioritySav = *lpTapiLineTestInfo->lpdwPriority; + lpTapiLineTestInfo->dwPriority = !dwPrioritySav; + dwPriority = *lpTapiLineTestInfo->lpdwPriority; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx, dwPrioritySav = %lx", + *lpTapiLineTestInfo->lpdwPriority, + dwPriority); + + if(*lpTapiLineTestInfo->lpdwPriority == dwPriority) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Test initialized case <<<<<<<<" + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAppFilename = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + lpTapiLineTestInfo->dwPriority = 0; + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non excutable ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non excutable ", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"readme.txt"; +#else + lpTapiLineTestInfo->lpszAppFilename = "readme.txt"; +#endif + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non 8.3 format ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non 8.3 format ", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testsga"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testsga"; +#endif + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad MediaMode > 1 bit set ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM | + LINEMEDIAMODE_INTERACTIVEVOICE; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALMEDIAMODE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionID", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtID = + (LPLINEEXTENSIONID) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + lpTapiLineTestInfo->dwPriority = 0; + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwRequestMode, for dwMediaMode = 0 ", dwTestCase + 1 + ); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = 0; + + for (n = 3; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->dwRequestMode = + (DWORD) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALREQUESTMODE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionName", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtensionName = + (LPVARSTRING) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + FreeTestHeap(); + + +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = 0", dwTestCase + 1 + ); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = 0; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = fixed -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING) -1; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwPriority = 0; + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpdwPriority ", dwTestCase + 1 + ); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwPriority = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + + // 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(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + dwPrioritySav = *lpTapiLineTestInfo->lpdwPriority; + lpTapiLineTestInfo->dwPriority = !dwPrioritySav; + dwPriority = *lpTapiLineTestInfo->lpdwPriority; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPriority = 0; + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx, dwPrioritySav = %lx", + *lpTapiLineTestInfo->lpdwPriority, + dwPriority); + + if(*lpTapiLineTestInfo->lpdwPriority == dwPriority) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetAppPriority: 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 lineGetAppPriority <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlmod.c b/private/tapi/qa/trapper/itest/tsline/itlmod.c new file mode 100644 index 000000000..047376909 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlmod.c @@ -0,0 +1,678 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmod.c + +Abstract: + + This module contains the test functions for lineMonitorDigits + +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" + + +#define ALL_DIGITMODES (LINEDIGITMODE_PULSE | \ + LINEDIGITMODE_DTMF | \ + LINEDIGITMODE_DTMFEND) + + + +// lineMonitorDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineMonitorDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + LONG lExpected; + ESPDEVSPECIFICINFO info; + TAPIRESULT lastTapiResult; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineMonitorDigits <<<<<<<<" + ); + + /* + // 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(); + } */ + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineMonitorDigits(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwDigitModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALDIGITMODE; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineMonitorDigits, + (LPDWORD) &lpTapiLineTestInfo->dwDigitModes, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DIGITMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamTest for dwDigitModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineMonitorDigits, + (LPDWORD) &lpTapiLineTestInfo->dwDigitModes, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DIGITMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_MONITORDIGITS msg sent", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_MONITORDIGITS; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = LINEDIGITMODE_PULSE; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + if (! DoLineMonitorDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + AddMessage( + LINE_MONITORDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + LINEDIGITMODE_PULSE, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST +// | TAPIMSG_DWPARAM2 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINE_MONITORDIGIT msg not received"); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify digit detection msg is filtered", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + if (! DoLineMonitorDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_MONITORDIGITS; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = LINEDIGITMODE_DTMF; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + AddMessage( + LINE_MONITORDIGITS, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + LINEDIGITMODE_DTMF, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM2 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINEDIGITMODE_DTMF msg not received"); + } + else + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->dwDigitModes = LINEDIGITMODE_PULSE; + if ( ! DoLineMonitorDigits(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + if ( ! DoLineMonitorDigits(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineMonitorDigits: 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 lineMonitorDigits <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlmom.c b/private/tapi/qa/trapper/itest/tsline/itlmom.c new file mode 100644 index 000000000..44dceddab --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlmom.c @@ -0,0 +1,690 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmom.c + +Abstract: + + This module contains the test functions for lineMonitorMedia + +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" + + +#define ALL_MEDIAMODES (LINEMEDIAMODE_INTERACTIVEVOICE | \ + LINEMEDIAMODE_AUTOMATEDVOICE | \ + LINEMEDIAMODE_DATAMODEM | \ + LINEMEDIAMODE_G3FAX | \ + LINEMEDIAMODE_TDD | \ + LINEMEDIAMODE_G4FAX | \ + LINEMEDIAMODE_DIGITALDATA | \ + LINEMEDIAMODE_TELETEX | \ + LINEMEDIAMODE_VIDEOTEX | \ + LINEMEDIAMODE_TELEX | \ + LINEMEDIAMODE_MIXED | \ + LINEMEDIAMODE_ADSI | \ + LINEMEDIAMODE_VOICEVIEW | \ + LINEMEDIAMODE_UNKNOWN) + + + + +// lineMonitorMedia +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineMonitorMedia(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams; + DWORD dwErrorCode; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + TAPIRESULT lastTapiResult; + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineMonitorMedia <<<<<<<<" + ); + + + /* + // 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(); + } */ + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineMonitorMedia(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwMediaModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + dwErrorCode = LINEERR_INVALMEDIAMODE; + else + dwErrorCode = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineMonitorMedia, + (LPDWORD) &lpTapiLineTestInfo->dwMediaModes, +// LINEERR_INVALMEDIAMODE, + dwErrorCode, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_MEDIAMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamTest for dwMediaModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineMonitorMedia, + (LPDWORD) &lpTapiLineTestInfo->dwMediaModes, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_MEDIAMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_MONITORMEDIA msg sent", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoLineMonitorMedia(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_MONITORMEDIA; + info.u.EspMsg.dwParam1 = LINEMEDIAMODE_DATAMODEM; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + AddMessage( + LINE_MONITORMEDIA, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEMEDIAMODE_DATAMODEM, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST + | TAPIMSG_DWPARAM1 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINE_MONITORMEDIA msg not received"); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify msg changed for a disabled mode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoLineMonitorMedia(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_MONITORMEDIA; + info.u.EspMsg.dwParam1 = LINEMEDIAMODE_VIDEOTEX; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + AddMessage( + LINE_MONITORMEDIA, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEMEDIAMODE_VIDEOTEX, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST + | TAPIMSG_DWPARAM1 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINEMEDIAMODE_INTERACTIVE msg not received"); + } + else + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if ( ! DoLineMonitorMedia(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + if ( ! DoLineMonitorMedia(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineMonitorMedia: 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 lineMonitorMedia <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlmot.c b/private/tapi/qa/trapper/itest/tsline/itlmot.c new file mode 100644 index 000000000..bc6b57b66 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlmot.c @@ -0,0 +1,832 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlmot.c + +Abstract: + + This module contains the test functions for lineMonitorTones + +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" + +#define NUMENTRIES 4 +#define PAGESIZE 16984 + + + +// lineMonitorTones +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineMonitorTones(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPCALLBACKPARAMS lpCallbackParams; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + ESPDEVSPECIFICINFO info; + TAPIRESULT lastTapiResult; + + DWORD dwNumEntries[NUMENTRIES] = { + 1, +// 500, +// 1000, + 100000, + 0x7fffffff, + 0xffffffff + }; + DWORD dwNumBytes; + DWORD lExpected; + DWORD dwFixedSize = sizeof(LINEMONITORTONE); + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineMonitorTones <<<<<<<<" + ); + + + /* + // 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(); + } */ + + + lpTapiLineTestInfo->lpToneList = NULL; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineMonitorTones(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpToneList values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwNumEntries = 1; + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) gdwInvalidPointers[n]; + if (! DoLineMonitorTones(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwNumEntries, fixed alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwNumEntries = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwFixedSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwNumEntries = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + if(dwNumBytes < PAGESIZE) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + + if (! DoLineMonitorTones(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwNumEntries = 1; + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) NULL; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_MONITORTONE msg sent", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + lpTapiLineTestInfo->dwNumEntries = 1; + + if (! DoLineMonitorTones(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_MONITORTONE; + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + AddMessage( + LINE_MONITORTONE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWCALLBACKINST + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINE_MONITORTONE msg not received"); + } + } + + +/* + if (! DoLineMonitorTones(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(fTestPassed) + { + AddMessage( + LINE_MONITORTONE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, +// LINEMEDIAMODE_DATAMODEM, + 0x00000000, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + } +*/ + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify dwNumTones ignor if lpToneList = null msg sent", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpToneList = NULL; + lpTapiLineTestInfo->dwNumEntries = 0xffffffff; + + if (! DoLineMonitorTones(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_MONITORTONE msg filtered when call goes away", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (2) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (2) * sizeof(HCALL) + 8; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + lpTapiLineTestInfo->dwNumEntries = 1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorTones(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if( ! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_MONITORTONE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, +// LINEMEDIAMODE_DATAMODEM, + 0x00000000, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST + ); + + if ( WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineMonitorTones(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + lpTapiLineTestInfo->dwNumEntries = 1; + + if ( ! DoLineMonitorTones(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + 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_INVALTONE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + lpTapiLineTestInfo->dwNumEntries = 1; + + if ( ! DoLineMonitorTones(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineMonitorTones: 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 lineMonitorTones <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlpak.c b/private/tapi/qa/trapper/itest/tsline/itlpak.c new file mode 100644 index 000000000..81b33fb06 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlpak.c @@ -0,0 +1,1109 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpk.c + +Abstract: + + This module contains the test functions for linePark + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/8/96 added unicode support + +--*/ + + +#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" + + +#define ALL_PARKMODES (LINEPARKMODE_DIRECTED | \ + LINEPARKMODE_NONDIRECTED) +#define NUMTOTALSIZES 5 + + +// linePark +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePark(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + DWORD dwFixedSize = sizeof(VARSTRING); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing linePark <<<<<<<<" + ); + + + /* + // 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(); + } */ + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_DIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = L"444444"; +#else + lpTapiLineTestInfo->lpszDirAddress = "444444"; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwParkModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = L"444444"; + + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) * sizeof(WCHAR)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING) * sizeof(WCHAR); +#else + lpTapiLineTestInfo->lpszDirAddress = "444444"; + + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALPARKMODE; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLinePark, + (LPDWORD) &lpTapiLineTestInfo->dwParkMode, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_PARKMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamTest for dwParkMode", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLinePark, + (LPDWORD) &lpTapiLineTestInfo->dwParkMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_PARKMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDirAddress, when DIRECTED", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDirAddress, when DIRECTED", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_DIRECTED; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDirAddress = (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszNonDirAddress, when NONDIRECTED", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszNonDirAddress, when NONDIRECTED", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_NONDIRECTED; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) gdwInvalidPointers[n]; + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpNonDirAddress->dwTotalSize, when NONDIRECTED", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_NONDIRECTED; + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLinePark(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = dwFixedSize; + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, when NONDIRECTED", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_NONDIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) * sizeof(WCHAR)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING) * sizeof(WCHAR); + + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_UNICODE; + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize = 16 * sizeof(WCHAR); +#else + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); + + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize = 16; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if(lpTapiLineTestInfo->lpNonDirAddress->dwStringOffset > 0) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + } + else + { + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize, + lpTapiLineTestInfo->lpNonDirAddress->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize, + lpTapiLineTestInfo->lpNonDirAddress->dwStringOffset); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + "string1 (unicode) = %ws, string2 (unicode) = %ws", + (LPBYTE)lpTapiLineTestInfo->lpNonDirAddress, + (LPBYTE)lpTapiLineTestInfo->lpNonDirAddress + + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + "string1 = %s, string2 = %s", + (LPBYTE)lpTapiLineTestInfo->lpNonDirAddress, + (LPBYTE)lpTapiLineTestInfo->lpNonDirAddress + + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize); +#endif + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpNonDirAddress ignor when DIRECTED", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_DIRECTED; + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) NULL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = L"44444"; +#else + lpTapiLineTestInfo->lpszDirAddress = "44444"; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDirAddress ignor when NONDIRECTED", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDirAddress ignor when NONDIRECTED", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_NONDIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)*sizeof(WCHAR)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING)*sizeof(WCHAR); + lpTapiLineTestInfo->lpwszDirAddress = NULL; +#else + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpszDirAddress = NULL; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + 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->dwParkMode = LINEPARKMODE_NONDIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) * sizeof(WCHAR)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING) * sizeof(WCHAR); + + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_UNICODE; + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize = 16 * sizeof(WCHAR); +#else + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); + + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize = 16; +#endif + + if ( ! DoLinePark(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->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_INVALADDRESS; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_NONDIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) * sizeof(WCHAR)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING) * sizeof(WCHAR); + + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_UNICODE; + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize = 16 * sizeof(WCHAR); +#else + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); + + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; + lpTapiLineTestInfo->lpNonDirAddress->dwStringSize = 16; +#endif + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLinePark(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, + "@@ linePark: 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 linePark <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlpk.c b/private/tapi/qa/trapper/itest/tsline/itlpk.c new file mode 100644 index 000000000..83e778cf4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlpk.c @@ -0,0 +1,879 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpk.c + +Abstract: + + This module contains the test functions for linePickup + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/8/96 added unicode support + +--*/ + + +#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" + + + + +// linePickup +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePickup(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + LPCALLBACKPARAMS lpCallbackParams; + 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 linePickup <<<<<<<<" + ); + + /* + // 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(); + } */ + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwszGroupID = NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpszGroupID = NULL; +#endif + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLinePickup(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: Bad dwAddressID -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->dwAddressID = 0xffffffff; +// SP didn't check dwAddressID +// if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_INVALADDRESSID, TRUE)) + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwAddressID, dwNumAddressID ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) + AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = + lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses; + +// if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_INVALADDRESSID, TRUE)) + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphCall 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(); + } + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphCall = (LPHCALL) gdwInvalidHandles[n]; + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDestAddress values", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDestAddress values", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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(); + } + + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) gdwInvalidHandles[n]; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) gdwInvalidHandles[n]; +#endif + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszGroupID values", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszGroupID values", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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(); + } + + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszGroupID = (LPWSTR) gdwInvalidHandles[n]; +#else + lpTapiLineTestInfo->lpszGroupID = (LPSTR) gdwInvalidHandles[n]; +#endif + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: verify hCall can't be used", dwTestCase + 1 + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszGroupID = L"0"; +#else + lpTapiLineTestInfo->lpszGroupID = "0"; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_CALLSTATE|UNKNOWN msg sent", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if(fTestPassed) + { + AddMessage( + LINE_CALLSTATE, + (DWORD) lpTapiLineTestInfo->hLine1, + (DWORD) lpCallbackParams, + LINECALLSTATE_OFFERING, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | +// TAPIMSG_HDEVCALL | + TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + } + else + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszGroupID = null", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszGroupID = null", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwszGroupID = NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpszGroupID = NULL; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDestAddress = null", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDestAddress = null", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = NULL; + lpTapiLineTestInfo->lpwszGroupID = L"123"; +#else + lpTapiLineTestInfo->lpszDestAddress = NULL; + lpTapiLineTestInfo->lpszGroupID = "123"; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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(); + } + + if ( ! DoLinePickup(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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLinePickup(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, + "@@ linePickup: 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 linePickup <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlsap.c b/private/tapi/qa/trapper/itest/tsline/itlsap.c new file mode 100644 index 000000000..f713d79c3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlsap.c @@ -0,0 +1,966 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsap.c + +Abstract: + + This module contains the test functions for lineSetAppPriority + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/8/96 added unicode support + +--*/ + + +#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" + + + +// lineSetAppPriority +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAppPriority(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwPrioritySav, dwPriority; +#ifdef WUNICODE + WCHAR wszAppFilename[] = L"testapp.exe"; +#else + CHAR szAppFilename[] = "testapp.exe"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetAppPriority <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Test no initialized case <<<<<<<<" + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszMediaExtName = NULL; +#else + lpTapiLineTestInfo->lpszMediaExtName = NULL; +#endif + lpTapiLineTestInfo->dwPriority = 0; + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename pointers", dwTestCase + 1 + ); +#endif + +// lpszAppFilename = null is allowed + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAppFilename = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non executable ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszAppFilename = L"readme.txt"; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non executable ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszAppFilename = "readme.txt"; +#endif + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALAPPNAME)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non 8.3 format ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpwszAppFilename = L"testsga"; +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non 8.3 format ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpszAppFilename = "testsga"; +#endif + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALAPPNAME)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); +*/ + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad MediaMode > 1 bit set ", dwTestCase + 1 + ); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM | + LINEMEDIAMODE_INTERACTIVEVOICE; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALMEDIAMODE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionID", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtID = + (LPLINEEXTENSIONID) gdwInvalidPointers[n]; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwRequestMode, for dwMediaMode = 0 ", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = 0; + + for (n = 3; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->dwRequestMode = + (DWORD) gdwInvalidPointers[n]; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALREQUESTMODE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszMediaExtName", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszMediaExtName", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + +// lpszMediaExtName = null is allowed + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszMediaExtName = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszMediaExtName = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPriority ", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + for (n = 2; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->dwPriority = + (DWORD) gdwInvalidPointers[n]; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPriority = 0; + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + lpTapiLineTestInfo->dwPriority = 1; + dwPriority = lpTapiLineTestInfo->dwPriority; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwPriority = %lx, dwPrioritySav = %lx", + *lpTapiLineTestInfo->lpdwPriority, + dwPriority); + + if(*lpTapiLineTestInfo->lpdwPriority == dwPriority) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Test initialized case <<<<<<<<" + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszMediaExtName = NULL; +#else + lpTapiLineTestInfo->lpszMediaExtName = NULL; +#endif + lpTapiLineTestInfo->dwPriority = 0; + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAppFilename = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +/* +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non excutable ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non excutable ", dwTestCase + 1 + ); +#endif + + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"readme.txt"; +#else + lpTapiLineTestInfo->lpszAppFilename = "readme.txt"; +#endif + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALAPPNAME)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAppFilename, non 8.3 format ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAppFilename, non 8.3 format ", dwTestCase + 1 + ); +#endif + + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testsga"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testsga"; +#endif + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALAPPNAME)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +*/ + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = wszAppFilename; +#else + lpTapiLineTestInfo->lpszAppFilename = szAppFilename; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad MediaMode > 1 bit set ", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM | + LINEMEDIAMODE_INTERACTIVEVOICE; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALMEDIAMODE)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpExtensionID", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpExtID = + (LPLINEEXTENSIONID) gdwInvalidPointers[n]; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + FreeTestHeap(); + + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap( + sizeof(LINEEXTENSIONID)); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwRequestMode, for dwMediaMode = 0 ", dwTestCase + 1 + ); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = 0; + + for (n = 3; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->dwRequestMode = + (DWORD) gdwInvalidPointers[n]; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALREQUESTMODE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszMediaExtName", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszMediaExtName", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + lpTapiLineTestInfo->dwMediaMode = 0x01000000; + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszMediaExtName = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszMediaExtName = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPriority ", dwTestCase + 1 + ); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + for (n = 2; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->dwPriority = + (DWORD) gdwInvalidPointers[n]; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPriority = 0; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + lpTapiLineTestInfo->dwPriority = 1; + dwPriority = lpTapiLineTestInfo->dwPriority; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwPriority = %lx, dwPrioritySav = %lx", + *lpTapiLineTestInfo->lpdwPriority, + dwPriority); + + if(*lpTapiLineTestInfo->lpdwPriority == dwPriority) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetAppPriority: 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 lineSetAppPriority <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlscd.c b/private/tapi/qa/trapper/itest/tsline/itlscd.c new file mode 100644 index 000000000..cd1801189 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlscd.c @@ -0,0 +1,714 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscd.c + +Abstract: + + This module contains the test functions for lineSetCallData + +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" + +#define NUMTOTALSIZES 5 +#define PAGESIZE 4096 + + +// lineSetCallData +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallData(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPBYTE lpszCallData; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + DWORD dwCallDataSize; + DWORD dwFixedSize = PAGESIZE; + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetCallData <<<<<<<<" + ); + + + /* + // 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(); + } */ + + + lpTapiLineTestInfo->lpToneList = NULL; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallData values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwSize = 128; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpCallData = (LPVOID) gdwInvalidPointers[n]; + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpszCallData = "This is a testA."; + lpTapiLineTestInfo->lpCallData = (LPVOID)lpszCallData; + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineSetCallData(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpCallData = (LPVOID)NULL; + lpTapiLineTestInfo->dwSize = 0; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallData = (LPVOID)NULL; + lpTapiLineTestInfo->dwSize = 0; + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpszCallData = "This is a testA."; + lpTapiLineTestInfo->lpCallData = (LPVOID)lpszCallData; + lpTapiLineTestInfo->dwSize = strlen(lpszCallData); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallData(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "Before: lpCallInfo->dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallDataSize, + lpTapiLineTestInfo->lpCallInfo->dwCallDataOffset + ); + dwCallDataSize = lpTapiLineTestInfo->lpCallInfo->dwCallDataSize; + + lpszCallData = "This is a testA. The is a testB."; + lpTapiLineTestInfo->lpCallData = (LPVOID)lpszCallData; + lpTapiLineTestInfo->dwSize = strlen(lpszCallData); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallData(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: lpCallInfo->dwCallDataSize = %lx, dwCallDataOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallDataSize, + lpTapiLineTestInfo->lpCallInfo->dwCallDataOffset + ); + + if(lpTapiLineTestInfo->lpCallInfo->dwCallDataSize != + dwCallDataSize) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + else + { + if (! DoLineSetCallData(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(); + } + + lpszCallData = "This is a testA."; + lpTapiLineTestInfo->lpCallData = (LPVOID)lpszCallData; + lpTapiLineTestInfo->dwSize = strlen(lpszCallData); + + + if ( ! DoLineSetCallData(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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpszCallData = "This is a testA."; + lpTapiLineTestInfo->lpCallData = (LPVOID)lpszCallData; + lpTapiLineTestInfo->dwSize = strlen(lpszCallData); + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetCallData(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, + "@@ lineSetCallData: 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 lineSetCallData <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlscl.c b/private/tapi/qa/trapper/itest/tsline/itlscl.c new file mode 100644 index 000000000..82df5ebec --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlscl.c @@ -0,0 +1,422 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscl.c + +Abstract: + + This module contains the test functions for lineSetCurrentLocation + +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" + +#define BIGBIGSIZE 4096 + + +// lineSetCurrentLocation +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCurrentLocation(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPLINELOCATIONENTRY lpLineLocationEntry; + BOOL fUnimdm; + DWORD dwLocation; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetCurrentLocation <<<<<<<<" + ); + + + /* + // 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 hLineApp 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; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + BIGBIGSIZE); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = BIGBIGSIZE; + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwLocation = + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID; + lpTapiLineTestInfo->hLineApp_Orig = *(lpTapiLineTestInfo->lphLineApp); + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCurrentLocation, 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwLocation = 0; + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, LINEERR_INVALLOCATION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCurrentLocation, 10000, big number", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwLocation = 1000; + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, LINEERR_INVALLOCATION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpLineLocationEntry = (LPLINELOCATIONENTRY) + (((LPBYTE) lpTapiLineTestInfo->lpTranslateCaps) + + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListOffset); + lpTapiLineTestInfo->dwLocation = lpLineLocationEntry->dwPermanentLocationID; + + if(lpTapiLineTestInfo->dwLocation == 0) + { + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, LINEERR_INVALLOCATION)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCurrentLocationID = %lx, dwLocation = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->dwLocation); + if(lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID == + lpTapiLineTestInfo->dwLocation) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + FreeTestHeap(); + +/* +OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetCurrentLocation"); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetCurrentLocation for go/no-go"); + + // Call lineGetTranslateCaps to get LocationID + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumLocations = %lx, dwCurrentLocationID = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID); + + + if(lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations == 1) + { + lpTapiLineTestInfo->dwLocation = lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID; + } + else if(lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations > 1) + { + lpLineLocationEntry = (LPLINELOCATIONENTRY) + ((LPBYTE)lpTapiLineTestInfo->lpTranslateCaps + + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListOffset); + lpTapiLineTestInfo->dwLocation = lpLineLocationEntry->dwPermanentLocationID; + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwLocationID = %lx", + lpTapiLineTestInfo->dwLocation); + + + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Call lineGetTranslateCaps to verify LocationID + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumLocations = %lx, dwCurrentLocationID = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID); + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); +*/ + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetCurrentLocation: 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 lineSetCurrentLocation <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlscqs.c b/private/tapi/qa/trapper/itest/tsline/itlscqs.c new file mode 100644 index 000000000..3dc8d6e07 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlscqs.c @@ -0,0 +1,955 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscqs.c + +Abstract: + + This module contains the test functions for lineSetCallQualityOfService + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + +--*/ + + +#include "windows.h" +#include "winsock2.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" + +#define NUMTOTALSIZES 5 +#define FIXEDSIZE 1001 + + +// lineSetCallQualityOfService +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallQualityOfService(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LPFLOWSPEC lpSendingFlowspec, lpReceivingFlowspec; + LPQOS lpQos; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + DWORD dwFixedSize = FIXEDSIZE; + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetCallQualityOfService <<<<<<<<" + ); + + /* + // 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 hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpSendingFlowspec values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwSendingFlowspecSize = 128; + lpTapiLineTestInfo->dwReceivingFlowspecSize = 0; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpSendingFlowspec = (LPVOID) gdwInvalidPointers[n]; + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpReceivingFlowspec values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwSendingFlowspecSize = 0; + lpTapiLineTestInfo->dwReceivingFlowspecSize = 128; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpReceivingFlowspec = (LPVOID) gdwInvalidPointers[n]; + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSendingFlowspecSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpQos = (LPQOS) AllocFromTestHeap ( sizeof(QOS)); + lpSendingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpSendingFlowspec->LevelOfGuarantee = GuaranteedService; + lpTapiLineTestInfo->lpSendingFlowspec = (LPVOID) lpQos; + lpReceivingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpTapiLineTestInfo->lpReceivingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwReceivingFlowspecSize = sizeof(lpQos->ReceivingFlowspec); + + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->dwSendingFlowspecSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec); + + // 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 dwReceivingFlowspecSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->dwReceivingFlowspecSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwReceivingFlowspecSize = sizeof(lpQos->ReceivingFlowspec); + + // 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(?) dwSendingFlowspecSize, fixed-1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec) -1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecOffset + ); + if(lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize == + lpTapiLineTestInfo->dwSendingFlowspecSize) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + FreeTestHeap(); + } + else + { + if (! DoLineSetCallQualityOfService(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: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "Before: dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecOffset + ); + TapiLogDetail( + DBUG_SHOW_PASS, + "Before: dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecOffset + ); + + lpQos = (LPQOS) AllocFromTestHeap ( sizeof(QOS)); + lpSendingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); +// lpQos->SendingFlowspec.buf = (char FAR *) lpSendingFlowspec; + lpSendingFlowspec->LevelOfGuarantee = GuaranteedService; +// lpQos->SendingFlowspec.len = sizeof(lpQos->SendingFlowspec.buf); + lpTapiLineTestInfo->lpSendingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec); + + lpReceivingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); +// lpQos->ReceivingFlowspec.buf = (char FAR *) lpReceivingFlowspec; +// lpQos->ReceivingFlowspec.len = sizeof(lpQos->ReceivingFlowspec.buf); + lpTapiLineTestInfo->lpReceivingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwReceivingFlowspecSize = sizeof(lpQos->ReceivingFlowspec); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: dwSendingFlowspecSize = %lx, dwSendingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecOffset + ); + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: dwReceivingFlowspecSize = %lx, dwReceivingFlowspecOffset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecSize, + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecOffset + ); + + if(lpTapiLineTestInfo->lpCallInfo->dwSendingFlowspecSize == + lpTapiLineTestInfo->dwSendingFlowspecSize && + lpTapiLineTestInfo->lpCallInfo->dwReceivingFlowspecSize == + lpTapiLineTestInfo->dwReceivingFlowspecSize) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + else + { + if (! DoLineSetCallQualityOfService(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(); + } + + lpQos = (LPQOS) AllocFromTestHeap ( sizeof(QOS)); + lpSendingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpSendingFlowspec->LevelOfGuarantee = GuaranteedService; + lpTapiLineTestInfo->lpSendingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec); + + lpReceivingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpTapiLineTestInfo->lpReceivingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwReceivingFlowspecSize = sizeof(lpQos->ReceivingFlowspec); + + + if ( ! DoLineSetCallQualityOfService(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_INVALRATE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpQos = (LPQOS) AllocFromTestHeap ( sizeof(QOS)); + lpSendingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpSendingFlowspec->LevelOfGuarantee = GuaranteedService; + lpTapiLineTestInfo->lpSendingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwSendingFlowspecSize = sizeof(lpQos->SendingFlowspec); + + lpReceivingFlowspec = (LPFLOWSPEC) AllocFromTestHeap (sizeof(FLOWSPEC)); + lpTapiLineTestInfo->lpReceivingFlowspec = (LPVOID) lpQos; + lpTapiLineTestInfo->dwReceivingFlowspecSize = sizeof(lpQos->ReceivingFlowspec); + + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetCallQualityOfService(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, + "@@ lineSetCallQualityOfService: 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 lineSetCallQualityOfService <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlsct.c b/private/tapi/qa/trapper/itest/tsline/itlsct.c new file mode 100644 index 000000000..5234a5142 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlsct.c @@ -0,0 +1,873 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsct.c + +Abstract: + + This module contains the test functions for lineSetCallTreatment + +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" + + +#define ALL_CALLTREATMENT (LINECALLTREATMENT_SILENCE | \ + LINECALLTREATMENT_RINGBACK | \ + LINECALLTREATMENT_BUSY | \ + LINECALLTREATMENT_MUSIC) + + +// lineSetCallTreatment +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallTreatment(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwErrorCode; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + BOOL fUnimdm; + DWORD dwCallTreatment; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetCallTreatment <<<<<<<<" + ); + + + + /* + // 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(); + } */ + + + lpTapiLineTestInfo->lpToneList = NULL; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallData = (LPVOID)NULL; + lpTapiLineTestInfo->dwSize = 0; + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwCallTreatment", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + dwErrorCode = LINEERR_INVALPARAM; + else + dwErrorCode = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetCallTreatment, + (LPDWORD) &lpTapiLineTestInfo->dwTreatment, +// LINEERR_INVALPARAM, + dwErrorCode, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_CALLTREATMENT, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamTest for dwCallTreatment", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetCallTreatment, + (LPDWORD) &lpTapiLineTestInfo->dwTreatment, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_CALLTREATMENT, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCallTreatment = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTreatment = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(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: dwCallTreatment = 0XFFFFFFFF", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTreatment = 0xffffffff; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(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 dwCallTreatment > MUSIC", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTreatment = LINECALLTREATMENT_MUSIC + 1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_INVALPARAM, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(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: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "Before: lpCallInfo->dwTreatment = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallTreatment); + dwCallTreatment = lpTapiLineTestInfo->lpCallInfo->dwCallTreatment; + + lpTapiLineTestInfo->dwTreatment = LINECALLTREATMENT_SILENCE; + dwCallTreatment = lpTapiLineTestInfo->dwTreatment; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "After: lpCallInfo->dwTreatment = %lx", + lpTapiLineTestInfo->lpCallInfo->dwCallTreatment); + + if(dwCallTreatment == lpTapiLineTestInfo->lpCallInfo->dwCallTreatment) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallTreatment(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->dwTreatment = LINECALLTREATMENT_SILENCE; + dwCallTreatment = lpTapiLineTestInfo->dwTreatment; + + if ( ! DoLineSetCallTreatment(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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwTreatment = LINECALLTREATMENT_SILENCE; + dwCallTreatment = lpTapiLineTestInfo->dwTreatment; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetCallTreatment(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, + "@@ lineSetCallTreatment: 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 lineSetCallTreatment <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlslds.c b/private/tapi/qa/trapper/itest/tsline/itlslds.c new file mode 100644 index 000000000..84b898466 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlslds.c @@ -0,0 +1,725 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlslds.c + +Abstract: + + This module contains the test functions for lineSetLineDevStatus + +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" + + +#define ALL_STATUSTOCHANGE (LINEDEVSTATUSFLAGS_CONNECTED | \ + LINEDEVSTATUSFLAGS_MSGWAIT | \ + LINEDEVSTATUSFLAGS_INSERVICE | \ + LINEDEVSTATUSFLAGS_LOCKED) + + +// lineSetLineDevStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetLineDevStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + LPCALLBACKPARAMS lpCallbackParams; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fUnimdm; + DWORD dwDevStatusFlags; + DWORD dwErrorCode; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetLineDevStatus <<<<<<<<" + ); + + + /* + // 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(); + } */ + + lpTapiLineTestInfo->fStatus = TRUE; + + 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->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineSetLineDevStatus(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: BitVectorParamErrorTest for dwStatusToChange", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + dwErrorCode = LINEERR_INVALLINESTATE; + else + dwErrorCode = LINEERR_OPERATIONUNAVAIL; + + + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetLineDevStatus, + (LPDWORD) &lpTapiLineTestInfo->dwStatusToChange, +// LINEERR_INVALLINESTATE, + dwErrorCode, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_STATUSTOCHANGE, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, +// 0xffffffff, +// FALSE + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorValidParamTest for dwStatusToChange", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetLineDevStatus, + (LPDWORD) &lpTapiLineTestInfo->dwStatusToChange, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_STATUSTOCHANGE, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, fStatus = TRUE, verify from GetLineDevStatue", dwTestCase + 1 + ); + + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + 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(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(BIGBUFSIZE)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before: lpLineDevStatus->dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + + // Set the line device capabilities + lpTapiLineTestInfo->dwStatusToChange = LINEDEVSTATUSFLAGS_CONNECTED; + lpTapiLineTestInfo->fStatus = TRUE; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + dwDevStatusFlags = lpTapiLineTestInfo->dwStatusToChange; + + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After: lpLineDevStatus->dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + + if(dwDevStatusFlags & lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, fStatus = FALSE, verify from GetLineDevStatue", dwTestCase + 1 + ); + + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + 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(); + } + + // Get the line device capabilities + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before: lpLineDevStatus->dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + + // Set the line device capabilities + lpTapiLineTestInfo->dwStatusToChange = LINEDEVSTATUSFLAGS_CONNECTED; + lpTapiLineTestInfo->fStatus = FALSE; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + dwDevStatusFlags = lpTapiLineTestInfo->dwStatusToChange; + + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After: lpLineDevStatus->dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + + if(!(dwDevStatusFlags & lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags)) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + 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->dwStatusToChange = LINEDEVSTATUSFLAGS_CONNECTED; + lpTapiLineTestInfo->fStatus = TRUE; + + if ( ! DoLineSetLineDevStatus(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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwStatusToChange = LINEDEVSTATUSFLAGS_CONNECTED; + lpTapiLineTestInfo->fStatus = TRUE; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetLineDevStatus(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, + "@@ lineSetLineDevStatus: 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 lineSetLineDevStatus <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlucc.c b/private/tapi/qa/trapper/itest/tsline/itlucc.c new file mode 100644 index 000000000..19d63a3bf --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlucc.c @@ -0,0 +1,710 @@ +/*++ + +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; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/itlupak.c b/private/tapi/qa/trapper/itest/tsline/itlupak.c new file mode 100644 index 000000000..07cd3f99f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/itlupak.c @@ -0,0 +1,645 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlupak.c + +Abstract: + + This module contains the test functions for lineUnpark + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 4/8/96 added unicode support + +--*/ + + +#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" + + + + +// lineUnpark +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineUnpark(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 lineUnpark <<<<<<<<" + ); + + + /* + // 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(); + } */ + + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphCall = (LPHCALL) gdwInvalidHandles[n]; + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDestAddress values", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDestAddress values", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) gdwInvalidHandles[n]; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) gdwInvalidHandles[n]; +#endif + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify hCall can't be used when fail", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = NULL; +#endif + lpTapiLineTestInfo->hCall1 = 0; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_CALLSTATE msg", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineUnpark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_CALLSTATE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLSTATE_ONHOLD, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fTestPassed = FALSE; + } + else + fTestPassed = TRUE; + } + } + else + { + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + if ( ! DoLineUnpark(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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineUnpark(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, + "@@ lineUnpark: 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 lineUnpark <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tsline/sline.c b/private/tapi/qa/trapper/itest/tsline/sline.c new file mode 100644 index 000000000..0ef044afe --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/sline.c @@ -0,0 +1,347 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + sline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "sline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTSLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TSLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTSLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninitialize(TRUE, TRUE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineGatherDigits(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineMonitorDigits(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineMonitorMedia(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineMonitorTones(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLinePark(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineUnpark(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLinePickup(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineUncompleteCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAppPriority(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAppPriority(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCurrentLocation(TRUE, FALSE)); +} + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallData(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallQualityOfService(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallTreatment(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test16( + HINSTANCE hAppInst + ) +{ + return (TestLineSetLineDevStatus(TRUE, FALSE)); +} + + + + + + diff --git a/private/tapi/qa/trapper/itest/tsline/sline.h b/private/tapi/qa/trapper/itest/tsline/sline.h new file mode 100644 index 000000000..14058f2ac --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/sline.h @@ -0,0 +1,308 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + sline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + +--*/ + + +#ifndef SLINE_H +#define SLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + +BOOL +TestLineUninitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestLineGatherDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMonitorDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMonitorMedia( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineMonitorTones( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePark( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineUnpark( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePickup( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineUncompleteCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetAppPriority( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAppPriority( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCurrentLocation( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCallData( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCallQualityOfService( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetCallTreatment( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetLineDevStatus( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ); + +BOOL +WINAPI +Test16( + HINSTANCE hAppInst + ); + + +#endif // SLINE_H diff --git a/private/tapi/qa/trapper/itest/tsline/sline.rc b/private/tapi/qa/trapper/itest/tsline/sline.rc new file mode 100644 index 000000000..ccd2ca737 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/sline.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI TSLine API test Library" +#define VER_INTERNALNAME_STR "tsline.dll" +#define VER_ORIGINALFILENAME_STR "tsline.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/tsline/tsline.def b/private/tapi/qa/trapper/itest/tsline/tsline.def new file mode 100644 index 000000000..3e9deb9be --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/tsline.def @@ -0,0 +1,26 @@ +LIBRARY tsline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 + Test16 diff --git a/private/tapi/qa/trapper/itest/tsline/tsline.inc b/private/tapi/qa/trapper/itest/tsline/tsline.inc new file mode 100644 index 000000000..6e59ea859 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/tsline.inc @@ -0,0 +1,73 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tsline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLDEF=..\tsline.def +DLLBASE=0x67000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES= ..\sline.c \ + ..\itlgad.c \ + ..\itlmod.c \ + ..\itlmom.c \ + ..\itlmot.c \ + ..\itlpak.c \ + ..\itlupak.c \ + ..\itlucc.c \ + ..\itlpk.c \ + ..\itlgap.c \ + ..\itlsap.c \ + ..\itlscl.c \ + ..\itlscd.c \ + ..\itlscqs.c \ + ..\itlsct.c \ + ..\itlslds.c \ + ..\uline.c \ + ..\sline.rc + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=TSLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tsline/tslinea/makefile b/private/tapi/qa/trapper/itest/tsline/tslinea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/tslinea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tsline/tslinea/sources b/private/tapi/qa/trapper/itest/tsline/tslinea/sources new file mode 100644 index 000000000..2052364c7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/tslinea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tsline.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/tsline/tslinew/makefile b/private/tapi/qa/trapper/itest/tsline/tslinew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/tslinew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tsline/tslinew/sources b/private/tapi/qa/trapper/itest/tsline/tslinew/sources new file mode 100644 index 000000000..88960fede --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/tslinew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tsline.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tsline/uline.c b/private/tapi/qa/trapper/itest/tsline/uline.c new file mode 100644 index 000000000..9369d0f6a --- /dev/null +++ b/private/tapi/qa/trapper/itest/tsline/uline.c @@ -0,0 +1,277 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "sline.h" + + +char szApiName[15][48] = + { + "lineGetAppPriority", + "lineGatherDigits", + "lineMonitorDigits", + "lineMonitorMedia", + "lineMonitorTones", + "linePark", + "lineSetAppPriority", + "linePickup", + "lineUncompleteCall", + "lineSetCurrentLocation", + "lineSetCallData", + "lineSetCallQualityOfService", + "lineSetCallTreatment", + "lineSetLineDevStatus", + "lineUnpark" + }; + + +BOOL TestLineUninitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 15; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case 1: + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineMonitorDigits(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineMonitorMedia(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 4: + if (! DoLineMonitorTones(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 5: + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_DIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDirAddress = "55555"; +#endif + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_UNICODE; +#else + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; +#endif + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case 6: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case 7: + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 9: + lpTapiLineTestInfo->dwLocation = 1; + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 10: + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 11: + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 12: + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 13: + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 14: + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + +// FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/ttest.c b/private/tapi/qa/trapper/itest/ttest.c new file mode 100644 index 000000000..6426b8c28 --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttest.c @@ -0,0 +1,2583 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ttest.c + +Abstract: + + This module contains common extra functions that don't belong in the + core dll that are used by test dlls. + +Author: + + Oliver Wallace (OliverW) 24-Nov-1995 + + +Revision History: + Palamalai (Gopi) Gopalakrishnan (pgopi) 18-Mar-1995 + * Added new function TestPhoneValidBitFlags, TestPhoneinvalidBitFlags + Palamalai (Gopi) Gopalakrishnan (pgopi) 25-Mar-1995 + * Added new function TestPhoneValidBitFlagsAsy, + TestPhoneinvalidBitFlagsAsy + RamaKoneru (a-ramako) 03-Apr-1996 + * added unicode support for IsESPLineDevice, IsUNIMDMLineDevice, + FindESPLineDevice, FindUNIMDMLineDevice, FindUnusedESPLineDevice + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "doline.h" +#include "dophone.h" +#include "vars.h" +#include "ttest.h" + + +#define LPLINEDEVCAPS_SIZE 1024 + +#define LPLINEDEVCAPS_SIZE 1024 +#define LPLINEDEVSTATUS_SIZE 1024 + +#define TIMEOUT 2000 + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the tcore dll +// should be loaded/freed during a process attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for ttest dll +HANDLE ghTtestDll = NULL; +CHAR gszTcoreDll[] = "tcore"; + + +// Local function prototypes +DWORD +FindFirstBitInPattern( + DWORD BitPattern + ); + + +BOOL +WINAPI +TtestDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTtestDll = hDLL; + + // Load the tcore dll if this is the first process + // to attach and if the dll hasn't already been mapped + // into this process's address space. +// if (glModuleUsage == 1) +// { +// if (GetModuleHandle(gszTcoreDll) == NULL); +// { +// return (LoadLibrary(gszTcoreDll) == NULL); +// } +// } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + return (FreeLibrary(hTcoreDll)); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +FindESPLineDevice( + LPTAPILINETESTINFO lpTapiLineInfo + ) +{ + LPLINEDEVCAPS lpLineDevCaps; + LPLINEDEVCAPS lpLineDevCaps_Orig; + BOOL fFoundESP; + + lpLineDevCaps = (LPLINEDEVCAPS) ITAlloc(LPLINEDEVCAPS_SIZE); + + // Use local lpLineDevCaps to guarantee pointer is valid and + // large enough to support any API version to date + lpLineDevCaps_Orig = lpTapiLineInfo->lpLineDevCaps; + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps; + + for (lpTapiLineInfo->dwDeviceID = 0, fFoundESP = FALSE; + (lpTapiLineInfo->dwDeviceID < *lpTapiLineInfo->lpdwNumDevs) && + !fFoundESP; + (lpTapiLineInfo->dwDeviceID)++) + { +#ifdef WUNICODE + WCHAR *pwszProviderInfo; +#else + char *pszProviderInfo; +#endif + + lpLineDevCaps->dwTotalSize = LPLINEDEVCAPS_SIZE; + + if (! DoLineNegotiateAPIVersion(lpTapiLineInfo, TAPISUCCESS)) + { + break; + } + + if (! DoLineGetDevCaps(lpTapiLineInfo, TAPISUCCESS)) + { + break; + } + +#ifdef WUNICODE + pwszProviderInfo = (WCHAR *)(((LPBYTE) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %ws", + pwszProviderInfo); +#else + pszProviderInfo = ((char *) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %s", + pszProviderInfo); +#endif + + __try + { +#ifdef WUNICODE + if (wcsstr(pwszProviderInfo, L"ESP")) + { + fFoundESP = TRUE; + } +#else + if (strstr(pszProviderInfo, "ESP")) + { + fFoundESP = TRUE; + } +#endif + } + __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + } + } + + // Restore lpLineDevCaps and free local lpLineDevCaps + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps_Orig; + ITFree(lpLineDevCaps); + + if (fFoundESP == FALSE) + { + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + " Unable to locate ESP line"); + return FALSE; + } + return TRUE; +} + + +BOOL +WINAPI +FindUnimdmLineDevice( + LPTAPILINETESTINFO lpTapiLineInfo + ) +{ + LPLINEDEVCAPS lpLineDevCaps; + LPLINEDEVCAPS lpLineDevCaps_Orig; + BOOL fFoundUnimdm; + + lpLineDevCaps = (LPLINEDEVCAPS) ITAlloc(LPLINEDEVCAPS_SIZE); + + // Use local lpLineDevCaps to guarantee pointer is valid and + // large enough to support any API version to date + lpLineDevCaps_Orig = lpTapiLineInfo->lpLineDevCaps; + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps; + + for (lpTapiLineInfo->dwDeviceID = 0, fFoundUnimdm = FALSE; + (lpTapiLineInfo->dwDeviceID < *lpTapiLineInfo->lpdwNumDevs) && + !fFoundUnimdm; + (lpTapiLineInfo->dwDeviceID)++) + { +#ifdef WUNICODE + WCHAR *pwszProviderInfo; +#else + char *pszProviderInfo; +#endif + + lpLineDevCaps->dwTotalSize = LPLINEDEVCAPS_SIZE; + + if (! DoLineNegotiateAPIVersion(lpTapiLineInfo, TAPISUCCESS)) + { + break; + } + + if (! DoLineGetDevCaps(lpTapiLineInfo, TAPISUCCESS)) + { + break; + } + +#ifdef WUNICODE + pwszProviderInfo = (WCHAR *)(( (LPBYTE) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %ws", + pwszProviderInfo); +#else + pszProviderInfo = ((char *) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %s", + pszProviderInfo); +#endif + + __try + { +#ifdef WUNICODE + if (wcsstr(pwszProviderInfo, L"UNIMDM")) + { + fFoundUnimdm = TRUE; + } +#else + if (strstr(pszProviderInfo, "UNIMDM")) + { + fFoundUnimdm = TRUE; + } +#endif + } + __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + } + } + + // Restore lpLineDevCaps and free local lpLineDevCaps + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps_Orig; + ITFree(lpLineDevCaps); + + if (fFoundUnimdm == FALSE) + { + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + " Unable to locate Unimdm line"); + return FALSE; + } + return TRUE; +} + + + +BOOL +WINAPI +FindUnusedESPLineDevice( + LPTAPILINETESTINFO lpTapiLineInfo + ) +{ + LPLINEDEVCAPS lpLineDevCaps; + LPLINEDEVCAPS lpLineDevCaps_Orig; + LPLINEDEVSTATUS lpLineDevStatus; + LPLINEDEVSTATUS lpLineDevStatus_Orig; + LOGPROC lpfnLogProc; + BOOL fFoundESP; + + lpfnLogProc = GetLogProc(); + lpLineDevCaps = (LPLINEDEVCAPS) ITAlloc(LPLINEDEVCAPS_SIZE); + lpLineDevStatus = (LPLINEDEVSTATUS) ITAlloc(LPLINEDEVSTATUS_SIZE); + + // Use local lpLineDevCaps to guarantee pointer is valid and + // large enough to support any API version to date + lpLineDevCaps_Orig = lpTapiLineInfo->lpLineDevCaps; + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps; + lpLineDevStatus_Orig = lpTapiLineInfo->lpLineDevStatus; + lpTapiLineInfo->lpLineDevStatus = lpLineDevStatus; + + for (lpTapiLineInfo->dwDeviceID = 0, fFoundESP = FALSE; + (lpTapiLineInfo->dwDeviceID < *lpTapiLineInfo->lpdwNumDevs) && + !fFoundESP; + (lpTapiLineInfo->dwDeviceID)++) + { +#ifdef WUNICODE + WCHAR *pwszProviderInfo; +#else + char *pszProviderInfo; +#endif + + lpLineDevCaps->dwTotalSize = LPLINEDEVCAPS_SIZE; + + if (! DoLineNegotiateAPIVersion(lpTapiLineInfo, TAPISUCCESS)) + { + break; + } + + if (! DoLineGetDevCaps(lpTapiLineInfo, TAPISUCCESS)) + { + break; + } + +#ifdef WUNICODE + pwszProviderInfo = (WCHAR *) (((LPBYTE)lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset); +#else + pszProviderInfo = ((char *) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset; +#endif + + __try + { +#ifdef WUNICODE + if (wcsstr(pwszProviderInfo, L"ESP")) + { + if (DoLineGetLineDevStatus(lpTapiLineInfo, TAPISUCCESS)) + { + if (lpTapiLineInfo->lpLineDevStatus->dwNumOpens == 0) + { + fFoundESP = TRUE; + } + } + } +#else + if (strstr(pszProviderInfo, "ESP")) + { + if (DoLineGetLineDevStatus(lpTapiLineInfo, TAPISUCCESS)) + { + if (lpTapiLineInfo->lpLineDevStatus->dwNumOpens == 0) + { + fFoundESP = TRUE; + } + } + } +#endif + } + __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + } + } + + // Restore lpLineDevCaps and lpLineDevStatus + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps_Orig; + lpTapiLineInfo->lpLineDevStatus = lpLineDevStatus_Orig; + + // Free local lpLineDevCaps and lpLineDevStatus allocations + ITFree(lpLineDevCaps); + ITFree(lpLineDevStatus); + + if (fFoundESP == FALSE) + { + (* lpfnLogProc)( + DBUG_SHOW_FAILURE, + " Unable to locate ESP line"); + return FALSE; + } + return TRUE; +} + + +// FindLineDevWithExt searches for a line device that supports extensions. +// +// Assumes: line has already been initialized and info is stored in +// lpTapiLineTestInfo structure +// +// Note : This function does not look for a device supported by a +// particular service provider +// +// Results: dwDeviceID field will correspond to the first line device +// (search device IDs from 0 to NumDevs - 1) if a line device +// supporting extensions is found. Otherwise the field will not +// be modified. + +BOOL +WINAPI +FindLineDevWithExt(LPTAPILINETESTINFO lpTapiLineTestInfo) +{ + LOGPROC pfnLogFunc; + DWORD dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + DWORD dwNumDevs = *(lpTapiLineTestInfo->lpdwNumDevs); + BOOL fFoundExtDevice = FALSE; + + pfnLogFunc = GetLogProc(); + + for (lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwDeviceID < dwNumDevs && ! fFoundExtDevice; + lpTapiLineTestInfo->dwDeviceID++) + { + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + break; // Error, no need to search any longer + } + if (memcmp( + lpTapiLineTestInfo->lpExtID, + &(lpTapiLineTestInfo->ExtIDZero), + sizeof(LINEEXTENSIONID)) + != 0) + { + fFoundExtDevice = TRUE; + } + (*pfnLogFunc)( + DBUG_SHOW_PARAMS, + " ExtResult=x%0lx%0lx%0lx%0lx", + lpTapiLineTestInfo->lpExtID->dwExtensionID0, + lpTapiLineTestInfo->lpExtID->dwExtensionID1, + lpTapiLineTestInfo->lpExtID->dwExtensionID2, + lpTapiLineTestInfo->lpExtID->dwExtensionID3 + ); + } + + // Test to see if a device supporting extensions was found + if (! fFoundExtDevice) + { + (*pfnLogFunc)( + DBUG_SHOW_FAILURE, + " %s tests FAILED", + lpTapiLineTestInfo->szTestFunc + ); + (*pfnLogFunc)( + DBUG_SHOW_FAILURE, + " No devices supporting extensions were found" + ); + + // Restore dwDeviceID field if line device supporting extensions + // found. + lpTapiLineTestInfo->dwDeviceID = dwDeviceID_Orig; + } + + return fFoundExtDevice; +} + + +BOOL +WINAPI +ShouldTapiTestAbort( + LPCSTR lpszTestName, + BOOL fQuietMode + ) +{ + LONG lResult; + char szTitleBuf[80]; + + if (fQuietMode == FALSE) + { + wsprintf( szTitleBuf, "%s: Error", lpszTestName); + lResult = MessageBox( + ghTtestDll, + "Test step failed unexpectedly.\n\rContinue anyway?", + szTitleBuf, + MB_SETFOREGROUND | MB_TASKMODAL | MB_ICONQUESTION | MB_YESNO); + + // Only abort test if IDYES was returned + if (lResult == IDYES) + { + return TRUE; + } + } + return FALSE; +} + + +BOOL +WINAPI +TestInvalidBitFlags( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNC lpfnTestLineFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestInvalidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstValidReservedBit; + DWORD dwFirstValidExtBit; + DWORD dwFirstInvalidReservedBit; + DWORD dwFirstInvalidExtBit; + DWORD dwInvalidReservedBitsUnion; + DWORD dwInvalidExtBitsUnion; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + dwInvalidReservedBitsUnion = ~dwValidReservedBitsUnion & + ~dwExcludeBitFlags & + dwReservedVectorField; + dwInvalidExtBitsUnion = ~dwValidExtBitsUnion & + ~dwExcludeBitFlags & + dwExtVectorField; + dwValidReservedBitsUnion &= ~dwExcludeBitFlags; + dwValidExtBitsUnion &= ~dwExcludeBitFlags; + + // Determine the first valid and invalid bits in + // the reserved and ext sections + dwFirstValidReservedBit = FindFirstBitInPattern(dwValidReservedBitsUnion); + dwFirstValidExtBit = FindFirstBitInPattern(dwValidExtBitsUnion); + dwFirstInvalidReservedBit = FindFirstBitInPattern( + dwInvalidReservedBitsUnion + ); + dwFirstInvalidExtBit = FindFirstBitInPattern(dwInvalidExtBitsUnion); + + + // Test special bit pattern + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + + // Test null bit pattern + if(fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + // Test the union of the valid bit flags if more than one bit set + if ( MultipleBitsSetInDWORD(dwValidReservedBitsUnion) ) + { + *lpdwTestParam = dwValidReservedBitsUnion; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + // Test one bit set in both the reserved and extension fields + if (dwFirstValidExtBit) + { + *lpdwTestParam = dwFirstValidReservedBit | + dwFirstValidExtBit; + + fTestPassed = lpfnTestLineFunc( + lpTestLineInfo, + lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + // Test no bits set in reserved field and multiple bits + // set in the extension field + if ( MultipleBitsSetInDWORD(dwValidExtBitsUnion) ) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestLineFunc( + lpTestLineInfo, + lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + else + { + // Field type is union...Test no bits set in reserved field + // and one or more bits set in the extension field + if (dwValidExtBitsUnion) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestLineFunc( + lpTestLineInfo, + lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + if (dwTestVector = dwFirstInvalidReservedBit) + { + // Cycle through and test each invalid reserved bit set + while (dwTestVector & dwReservedVectorField) + { + if (dwTestVector & dwInvalidReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the reserved field + dwTestVector = dwFirstValidReservedBit | dwFirstInvalidReservedBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (dwTestVector = dwFirstInvalidExtBit) + { + // Cycle through and test each invalid extension bit set + while (dwTestVector & dwExtVectorField) + { + if (dwTestVector & dwInvalidExtBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the extension field + dwTestVector = dwFirstValidExtBit | dwFirstInvalidExtBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + return (TRUE); +} + + +BOOL +TestValidBitFlags( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNC lpfnTestLineFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestValidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstReservedBit; + DWORD dwFirstExtBit; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + + if (dwCommonBitFlags) + { + // OR common set of bits into union + if (dwCommonBitFlags & dwReservedVectorField) + { + dwReservedBitsUnion |= dwCommonBitFlags; + } + else + { + (* lpfnLogProc)( + DBUG_SHOW_FAILURE, + "%s: Invalid CommonBitFlags selected", + lpszTestFunc); + return FALSE; + } + } + + // Find the first bit to test + dwFirstReservedBit = FindFirstBitInPattern(dwReservedBitsUnion); + dwFirstExtBit = FindFirstBitInPattern(dwExtBitsUnion); + + + // Do the special bit test + if (dwSpecialBitTest) + { + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test the null param + if (fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test each single bit + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + + dwTestVector = dwFirstReservedBit; + while (dwTestVector & dwReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + dwTestVector <<= 1; + + } +// XYD, wrong place, infinity loop dwTestVector <<= 1; + + // Test unused bits (if applicable) + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwTestVector = dwFirstExtBit) + { + while (dwTestVector & dwExtBitsUnion) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + *lpdwTestParam = dwTestVector; + } + else + { + *lpdwTestParam = dwTestVector | dwFirstReservedBit; + } + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + dwTestVector <<= 1; + } + } + else if (eExtFieldType == FIELDTYPE_UNION) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwExtBitsUnion | dwFirstReservedBit; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + else if (eReservedFieldType == FIELDTYPE_UNION) + { + *lpdwTestParam = dwReservedBitsUnion; + + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwCommonBitFlags | dwExtBitsUnion; + + if (! lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS)) + { + *lpdwTestParam = dwParamValue; + return (FALSE); + } + + *lpdwTestParam |= dwReservedBitsUnion; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + return (TRUE); +} + + + +TestInvalidBitFlagsAsy( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNCASY lpfnTestLineFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestInvalidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstValidReservedBit; + DWORD dwFirstValidExtBit; + DWORD dwFirstInvalidReservedBit; + DWORD dwFirstInvalidExtBit; + DWORD dwInvalidReservedBitsUnion; + DWORD dwInvalidExtBitsUnion; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + dwInvalidReservedBitsUnion = ~dwValidReservedBitsUnion & + ~dwExcludeBitFlags & + dwReservedVectorField; + dwInvalidExtBitsUnion = ~dwValidExtBitsUnion & + ~dwExcludeBitFlags & + dwExtVectorField; + dwValidReservedBitsUnion &= ~dwExcludeBitFlags; + dwValidExtBitsUnion &= ~dwExcludeBitFlags; + + // Determine the first valid and invalid bits in + // the reserved and ext sections + dwFirstValidReservedBit = FindFirstBitInPattern(dwValidReservedBitsUnion); + dwFirstValidExtBit = FindFirstBitInPattern(dwValidExtBitsUnion); + dwFirstInvalidReservedBit = FindFirstBitInPattern( + dwInvalidReservedBitsUnion + ); + dwFirstInvalidExtBit = FindFirstBitInPattern(dwInvalidExtBitsUnion); + + + // Test special bit pattern + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + + // Test null bit pattern + if(fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + // Test the union of the valid bit flags if more than one bit set + if ( MultipleBitsSetInDWORD(dwValidReservedBitsUnion) ) + { + *lpdwTestParam = dwValidReservedBitsUnion; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + // Test one bit set in both the reserved and extension fields + if (dwFirstValidExtBit) + { + *lpdwTestParam = dwFirstValidReservedBit | + dwFirstValidExtBit; + + fTestPassed = lpfnTestLineFunc( + lpTestLineInfo, + lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + // Test no bits set in reserved field and multiple bits + // set in the extension field + if ( MultipleBitsSetInDWORD(dwValidExtBitsUnion) ) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestLineFunc( + lpTestLineInfo, + lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + else + { + // Field type is union...Test no bits set in reserved field + // and one or more bits set in the extension field + if (dwValidExtBitsUnion) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestLineFunc( + lpTestLineInfo, + lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + if (dwTestVector = dwFirstInvalidReservedBit) + { + // Cycle through and test each invalid reserved bit set + while (dwTestVector & dwReservedVectorField) + { + if (dwTestVector & dwInvalidReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the reserved field + dwTestVector = dwFirstValidReservedBit | dwFirstInvalidReservedBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (dwTestVector = dwFirstInvalidExtBit) + { + // Cycle through and test each invalid extension bit set + while (dwTestVector & dwExtVectorField) + { + if (dwTestVector & dwInvalidExtBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the extension field + dwTestVector = dwFirstValidExtBit | dwFirstInvalidExtBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + return (TRUE); +} + + +BOOL +TestValidBitFlagsAsy( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNCASY lpfnTestLineFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestValidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstReservedBit; + DWORD dwFirstExtBit; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + + if (dwCommonBitFlags) + { + // OR common set of bits into union + if (dwCommonBitFlags & dwReservedVectorField) + { + dwReservedBitsUnion |= dwCommonBitFlags; + } + else + { + (* lpfnLogProc)( + DBUG_SHOW_FAILURE, + "%s: Invalid CommonBitFlags selected", + lpszTestFunc); + return FALSE; + } + } + + // Find the first bit to test + dwFirstReservedBit = FindFirstBitInPattern(dwReservedBitsUnion); + dwFirstExtBit = FindFirstBitInPattern(dwExtBitsUnion); + + + // Do the special bit test + if (dwSpecialBitTest) + { + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test the null param + if (fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test each single bit + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + + dwTestVector = dwFirstReservedBit; + while (dwTestVector & dwReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + dwTestVector <<= 1; + + } +// XYD, wrong place, infinity loop dwTestVector <<= 1; + + // Test unused bits (if applicable) + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwTestVector = dwFirstExtBit) + { + while (dwTestVector & dwExtBitsUnion) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + *lpdwTestParam = dwTestVector; + } + else + { + *lpdwTestParam = dwTestVector | dwFirstReservedBit; + } + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + dwTestVector <<= 1; + } + } + else if (eExtFieldType == FIELDTYPE_UNION) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwExtBitsUnion | dwFirstReservedBit; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + else if (eReservedFieldType == FIELDTYPE_UNION) + { + *lpdwTestParam = dwReservedBitsUnion; + + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwCommonBitFlags | dwExtBitsUnion; + + if (! lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE)) + { + *lpdwTestParam = dwParamValue; + return (FALSE); + } + + *lpdwTestParam |= dwReservedBitsUnion; + fTestPassed = lpfnTestLineFunc(lpTestLineInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + return (TRUE); +} + +BOOL +WINAPI +TestPhoneInvalidBitFlags( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNC lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestPhoneInvalidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstValidReservedBit; + DWORD dwFirstValidExtBit; + DWORD dwFirstInvalidReservedBit; + DWORD dwFirstInvalidExtBit; + DWORD dwInvalidReservedBitsUnion; + DWORD dwInvalidExtBitsUnion; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + dwInvalidReservedBitsUnion = ~dwValidReservedBitsUnion & + ~dwExcludeBitFlags & + dwReservedVectorField; + dwInvalidExtBitsUnion = ~dwValidExtBitsUnion & + ~dwExcludeBitFlags & + dwExtVectorField; + dwValidReservedBitsUnion &= ~dwExcludeBitFlags; + dwValidExtBitsUnion &= ~dwExcludeBitFlags; + + // Determine the first valid and invalid bits in + // the reserved and ext sections + dwFirstValidReservedBit = FindFirstBitInPattern(dwValidReservedBitsUnion); + dwFirstValidExtBit = FindFirstBitInPattern(dwValidExtBitsUnion); + dwFirstInvalidReservedBit = FindFirstBitInPattern( + dwInvalidReservedBitsUnion + ); + dwFirstInvalidExtBit = FindFirstBitInPattern(dwInvalidExtBitsUnion); + + + // Test special bit pattern + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + + // Test null bit pattern + if(fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + // Test the union of the valid bit flags if more than one bit set + if ( MultipleBitsSetInDWORD(dwValidReservedBitsUnion) ) + { + *lpdwTestParam = dwValidReservedBitsUnion; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + // Test one bit set in both the reserved and extension fields + if (dwFirstValidExtBit) + { + *lpdwTestParam = dwFirstValidReservedBit | + dwFirstValidExtBit; + + fTestPassed = lpfnTestPhoneFunc( + lpTestPhoneInfo, + lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + // Test no bits set in reserved field and multiple bits + // set in the extension field + if ( MultipleBitsSetInDWORD(dwValidExtBitsUnion) ) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestPhoneFunc( + lpTestPhoneInfo, + lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + else + { + // Field type is union...Test no bits set in reserved field + // and one or more bits set in the extension field + if (dwValidExtBitsUnion) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestPhoneFunc( + lpTestPhoneInfo, + lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + if (dwTestVector = dwFirstInvalidReservedBit) + { + // Cycle through and test each invalid reserved bit set + while (dwTestVector & dwReservedVectorField) + { + if (dwTestVector & dwInvalidReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the reserved field + dwTestVector = dwFirstValidReservedBit | dwFirstInvalidReservedBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (dwTestVector = dwFirstInvalidExtBit) + { + // Cycle through and test each invalid extension bit set + while (dwTestVector & dwExtVectorField) + { + if (dwTestVector & dwInvalidExtBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the extension field + dwTestVector = dwFirstValidExtBit | dwFirstInvalidExtBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + return (TRUE); +} + + +BOOL +TestPhoneValidBitFlags( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNC lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestPhoneValidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstReservedBit; + DWORD dwFirstExtBit; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + + if (dwCommonBitFlags) + { + // OR common set of bits into union + if (dwCommonBitFlags & dwReservedVectorField) + { + dwReservedBitsUnion |= dwCommonBitFlags; + } + else + { + (* lpfnLogProc)( + DBUG_SHOW_FAILURE, + "%s: Invalid CommonBitFlags selected", + lpszTestFunc); + return FALSE; + } + } + + // Find the first bit to test + dwFirstReservedBit = FindFirstBitInPattern(dwReservedBitsUnion); + dwFirstExtBit = FindFirstBitInPattern(dwExtBitsUnion); + + + // Do the special bit test + if (dwSpecialBitTest) + { + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test the null param + if (fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test each single bit + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + + dwTestVector = dwFirstReservedBit; + while (dwTestVector & dwReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + dwTestVector <<= 1; + + } +// XYD, wrong place, infinity loop dwTestVector <<= 1; + + // Test unused bits (if applicable) + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwTestVector = dwFirstExtBit) + { + while (dwTestVector & dwExtBitsUnion) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + *lpdwTestParam = dwTestVector; + } + else + { + *lpdwTestParam = dwTestVector | dwFirstReservedBit; + } + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + dwTestVector <<= 1; + } + } + else if (eExtFieldType == FIELDTYPE_UNION) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwExtBitsUnion | dwFirstReservedBit; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + else if (eReservedFieldType == FIELDTYPE_UNION) + { + *lpdwTestParam = dwReservedBitsUnion; + + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwCommonBitFlags | dwExtBitsUnion; + + if (! lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS)) + { + *lpdwTestParam = dwParamValue; + return (FALSE); + } + + *lpdwTestParam |= dwReservedBitsUnion; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + return (TRUE); +} + +TestPhoneInvalidBitFlagsAsy( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNCASY lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestInvalidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstValidReservedBit; + DWORD dwFirstValidExtBit; + DWORD dwFirstInvalidReservedBit; + DWORD dwFirstInvalidExtBit; + DWORD dwInvalidReservedBitsUnion; + DWORD dwInvalidExtBitsUnion; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + dwInvalidReservedBitsUnion = ~dwValidReservedBitsUnion & + ~dwExcludeBitFlags & + dwReservedVectorField; + dwInvalidExtBitsUnion = ~dwValidExtBitsUnion & + ~dwExcludeBitFlags & + dwExtVectorField; + dwValidReservedBitsUnion &= ~dwExcludeBitFlags; + dwValidExtBitsUnion &= ~dwExcludeBitFlags; + + // Determine the first valid and invalid bits in + // the reserved and ext sections + dwFirstValidReservedBit = FindFirstBitInPattern(dwValidReservedBitsUnion); + dwFirstValidExtBit = FindFirstBitInPattern(dwValidExtBitsUnion); + dwFirstInvalidReservedBit = FindFirstBitInPattern( + dwInvalidReservedBitsUnion + ); + dwFirstInvalidExtBit = FindFirstBitInPattern(dwInvalidExtBitsUnion); + + + // Test special bit pattern + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + + // Test null bit pattern + if(fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + // Test the union of the valid bit flags if more than one bit set + if ( MultipleBitsSetInDWORD(dwValidReservedBitsUnion) ) + { + *lpdwTestParam = dwValidReservedBitsUnion; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + // Test one bit set in both the reserved and extension fields + if (dwFirstValidExtBit) + { + *lpdwTestParam = dwFirstValidReservedBit | + dwFirstValidExtBit; + + fTestPassed = lpfnTestPhoneFunc( + lpTestPhoneInfo, + lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + // Test no bits set in reserved field and multiple bits + // set in the extension field + if ( MultipleBitsSetInDWORD(dwValidExtBitsUnion) ) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestPhoneFunc( + lpTestPhoneInfo, + lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + else + { + // Field type is union...Test no bits set in reserved field + // and one or more bits set in the extension field + if (dwValidExtBitsUnion) + { + *lpdwTestParam = dwValidExtBitsUnion; + fTestPassed = lpfnTestPhoneFunc( + lpTestPhoneInfo, + lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + if (dwTestVector = dwFirstInvalidReservedBit) + { + // Cycle through and test each invalid reserved bit set + while (dwTestVector & dwReservedVectorField) + { + if (dwTestVector & dwInvalidReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the reserved field + dwTestVector = dwFirstValidReservedBit | dwFirstInvalidReservedBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + + if (dwTestVector = dwFirstInvalidExtBit) + { + // Cycle through and test each invalid extension bit set + while (dwTestVector & dwExtVectorField) + { + if (dwTestVector & dwInvalidExtBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + dwTestVector <<= 1; + } + + // Check a valid and invalid bit set in the extension field + dwTestVector = dwFirstValidExtBit | dwFirstInvalidExtBit; + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, lExpectedResult, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + return (TRUE); +} + + +BOOL +TestPhoneValidBitFlagsAsy( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNCASY lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ) +{ + BOOL fTestPassed; + LPCSTR lpszTestFunc = "TestValidBitFlags"; + + DWORD dwParamValue = *lpdwTestParam; + DWORD dwReservedVectorField = dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwExtVectorField = ~dwBitVectorMasks[(int)eReservedFieldSize]; + DWORD dwFirstReservedBit; + DWORD dwFirstExtBit; + DWORD dwTestVector; + + LOGPROC lpfnLogProc = GetLogProc(); + + + if (dwCommonBitFlags) + { + // OR common set of bits into union + if (dwCommonBitFlags & dwReservedVectorField) + { + dwReservedBitsUnion |= dwCommonBitFlags; + } + else + { + (* lpfnLogProc)( + DBUG_SHOW_FAILURE, + "%s: Invalid CommonBitFlags selected", + lpszTestFunc); + return FALSE; + } + } + + // Find the first bit to test + dwFirstReservedBit = FindFirstBitInPattern(dwReservedBitsUnion); + dwFirstExtBit = FindFirstBitInPattern(dwExtBitsUnion); + + + // Do the special bit test + if (dwSpecialBitTest) + { + *lpdwTestParam = dwSpecialBitTest; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test the null param + if (fTestNullParam) + { + *lpdwTestParam = 0x00000000; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + } + + // Test each single bit + if (eReservedFieldType == FIELDTYPE_MUTEX) + { + + dwTestVector = dwFirstReservedBit; + while (dwTestVector & dwReservedBitsUnion) + { + *lpdwTestParam = dwTestVector; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return FALSE; + } + dwTestVector <<= 1; + + } +// XYD, wrong place, infinity loop dwTestVector <<= 1; + + // Test unused bits (if applicable) + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwTestVector = dwFirstExtBit) + { + while (dwTestVector & dwExtBitsUnion) + { + if (eExtFieldType == FIELDTYPE_MUTEX) + { + *lpdwTestParam = dwTestVector; + } + else + { + *lpdwTestParam = dwTestVector | dwFirstReservedBit; + } + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + dwTestVector <<= 1; + } + } + else if (eExtFieldType == FIELDTYPE_UNION) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwExtBitsUnion | dwFirstReservedBit; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + } + + else if (eReservedFieldType == FIELDTYPE_UNION) + { + *lpdwTestParam = dwReservedBitsUnion; + + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + + if (eReservedFieldSize != FIELDSIZE_32) + { + if (dwExtBitsUnion) + { + *lpdwTestParam = dwCommonBitFlags | dwExtBitsUnion; + + if (! lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE)) + { + *lpdwTestParam = dwParamValue; + return (FALSE); + } + + *lpdwTestParam |= dwReservedBitsUnion; + fTestPassed = lpfnTestPhoneFunc(lpTestPhoneInfo, TAPISUCCESS, TRUE); + *lpdwTestParam = dwParamValue; + if (! fTestPassed) + { + return (FALSE); + } + } + } + } + return (TRUE); +} + + + +// FindFirstBitInPattern() returns a DWORD with the first (lowest) bit +// set in dwBitPattern. If no bits are set, this function returns 0. +DWORD +FindFirstBitInPattern( + DWORD dwBitPattern + ) +{ + DWORD dwFirstBit = 0x00000001; + if (dwBitPattern) + { + while (dwFirstBit && ! (dwFirstBit & dwBitPattern)) + { + dwFirstBit <<= 1; + } + return dwFirstBit; + } + else + { + return (0x00000000); + } +} + + +BOOL +WINAPI +FindESPPhoneDevice( + LPTAPIPHONETESTINFO lpTapiPhoneInfo + ) +{ + LPPHONECAPS lpPhoneCaps; + LPPHONECAPS lpPhoneCaps_Orig; + BOOL fFoundESP; + + lpPhoneCaps = (LPPHONECAPS) ITAlloc(sizeof(PHONECAPS)); + + // Use local lpPhoneCaps to guarantee pointer is valid and + // large enough to support any API version to date + lpPhoneCaps_Orig = lpTapiPhoneInfo->lpPhoneCaps; + lpTapiPhoneInfo->lpPhoneCaps = lpPhoneCaps; + + for (lpTapiPhoneInfo->dwDeviceID = 0, fFoundESP = FALSE; + (lpTapiPhoneInfo->dwDeviceID < *lpTapiPhoneInfo->lpdwNumDevs) && + !fFoundESP; + (lpTapiPhoneInfo->dwDeviceID)++) + { + char *pszProviderInfo; + + lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneInfo, TAPISUCCESS)) + { + break; + } + + if (! DoPhoneGetDevCaps(lpTapiPhoneInfo, TAPISUCCESS)) + { + break; + } + + pszProviderInfo = ((char *) lpTapiPhoneInfo->lpPhoneCaps) + + lpTapiPhoneInfo->lpPhoneCaps->dwProviderInfoOffset; + + __try + { + if (strstr(pszProviderInfo, "ESP")) + { + fFoundESP = TRUE; + } + } + __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + } + } + + // Restore lpPhoneCaps and free local lpPhoneCaps + lpTapiPhoneInfo->lpPhoneCaps = lpPhoneCaps_Orig; + ITFree(lpPhoneCaps); + + if (fFoundESP == FALSE) + { + OutputTAPIDebugInfo( + DBUG_SHOW_FAILURE, + " Unable to locate ESP line"); + return FALSE; + } + return TRUE; +} + + + +BOOL +WINAPI +IsESPLineDevice( + LPTAPILINETESTINFO lpTapiLineInfo + ) +{ + LPLINEDEVCAPS lpLineDevCaps; + LPLINEDEVCAPS lpLineDevCaps_Orig; + BOOL fFoundESP = FALSE; +#ifdef WUNICODE + WCHAR *pwszProviderInfo; +#else + char *pszProviderInfo; +#endif + + lpLineDevCaps = (LPLINEDEVCAPS) ITAlloc(LPLINEDEVCAPS_SIZE); + lpLineDevCaps_Orig = lpTapiLineInfo->lpLineDevCaps; + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps; + + lpLineDevCaps->dwTotalSize = LPLINEDEVCAPS_SIZE; + + if (! DoLineNegotiateAPIVersion(lpTapiLineInfo, TAPISUCCESS)) + { + return FALSE; + } + + if (! DoLineGetDevCaps(lpTapiLineInfo, TAPISUCCESS)) + { + return FALSE; + } + +#ifdef WUNICODE + pwszProviderInfo = (WCHAR *)(((LPBYTE) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %ws", + pwszProviderInfo); + +#else + pszProviderInfo = ((char *) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %s", + pszProviderInfo); + +#endif + + __try + { +#ifdef WUNICODE + if (wcsstr(pwszProviderInfo, L"ESP")) + { + fFoundESP = TRUE; + } +#else + if (strstr(pszProviderInfo, "ESP")) + { + fFoundESP = TRUE; + } +#endif + } + __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + } + + + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps_Orig; + ITFree(lpLineDevCaps); + + if (fFoundESP == FALSE) + { + TapiLogDetail( + DBUG_SHOW_FAILURE, + " Unable to locate ESP line for this %lx Device", + lpTapiLineInfo->dwDeviceID); + return FALSE; + } + return TRUE; +} + + +BOOL +WINAPI +IsUNIMDMLineDevice( + LPTAPILINETESTINFO lpTapiLineInfo + ) +{ + LPLINEDEVCAPS lpLineDevCaps; + LPLINEDEVCAPS lpLineDevCaps_Orig; + BOOL fFoundUNIMDM = FALSE; +#ifdef WUNICODE + WCHAR *pwszProviderInfo; +#else + char *pszProviderInfo; +#endif + + lpLineDevCaps = (LPLINEDEVCAPS) ITAlloc(LPLINEDEVCAPS_SIZE); + lpLineDevCaps_Orig = lpTapiLineInfo->lpLineDevCaps; + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps; + + lpLineDevCaps->dwTotalSize = LPLINEDEVCAPS_SIZE; + + if (! DoLineNegotiateAPIVersion(lpTapiLineInfo, TAPISUCCESS)) + { + return FALSE; + } + if (! DoLineGetDevCaps(lpTapiLineInfo, TAPISUCCESS)) + { + return FALSE; + } + +#ifdef WUNICODE + pwszProviderInfo = (WCHAR *)(((LPBYTE)lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %ws", + pwszProviderInfo); +#else + pszProviderInfo = ((char *) lpTapiLineInfo->lpLineDevCaps) + + lpTapiLineInfo->lpLineDevCaps->dwProviderInfoOffset; + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### ProviderInfo = %s", + pszProviderInfo); +#endif + + __try + { +#ifdef WUNICODE + if (wcsstr(pwszProviderInfo, L"Modem")) + { + fFoundUNIMDM = TRUE; + } +#else + if (strstr(pszProviderInfo, "Modem")) + { + fFoundUNIMDM = TRUE; + } +#endif + } + __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? + EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) + { + } + + + lpTapiLineInfo->lpLineDevCaps = lpLineDevCaps_Orig; + ITFree(lpLineDevCaps); + + if (fFoundUNIMDM == FALSE) + { + TapiLogDetail( + DBUG_SHOW_FAILURE, + " Unable to locate UNIMDM line for this %lx Device", + lpTapiLineInfo->dwDeviceID); + return FALSE; + } + return TRUE; +} + +BOOL ShowTestCase(BOOL fPassed) +{ + if(fPassed) + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Passed", dwTestCase+1); + dwTestCasePassed++; + dwglTestCasePassed++; + } + else + { + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Failed", dwTestCase+1); + dwTestCaseFailed++; + dwglTestCaseFailed++; + } + dwTestCase++; + dwglTestCase++; + return TRUE; +} + + +VOID +WINAPI +InitTestNumber(VOID) +{ + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; +} + + + + +#if TAPI_2_0 + +VOID +TapiShowProxyBuffer( LPLINEPROXYREQUEST lpProxyBuffer) +{ + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## lpProxyBuffer = %lx", + lpProxyBuffer); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwSize = %lx, dwRequestType = %lx", + lpProxyBuffer->dwSize, + lpProxyBuffer->dwRequestType); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwClientMachineNameSize = %lx, dwClientMachineNameOffset = %lx", + lpProxyBuffer->dwClientMachineNameSize, + lpProxyBuffer->dwClientMachineNameOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwClientUserNameSize = %lx, dwClientUserNameOffset = %lx", + lpProxyBuffer->dwClientUserNameSize, + lpProxyBuffer->dwClientUserNameOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## dwClientAppAPIVersion = %lx", + lpProxyBuffer->dwClientAppAPIVersion); + + /* + TapiLogDetail( + DBUG_SHOW_DETAIL, + "username= %ls", + ((LPBYTE)lpProxyBuffer)+lpProxyBuffer->dwClientUserNameOffset); + */ + + TapiShowAgent(lpProxyBuffer); +} + + +VOID +TapiShowAgent(LPLINEPROXYREQUEST lpProxyBuffer) +{ + switch(lpProxyBuffer->dwRequestType) + { + case LINEPROXYREQUEST_SETAGENTGROUP: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->SetAgentGroup.GroupList.dwTotalSize, + lpProxyBuffer->SetAgentGroup.GroupList.dwNeededSize); + break; + + case LINEPROXYREQUEST_SETAGENTSTATE: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwAgentState = %lx, dwNextAgentState = %lx", + lpProxyBuffer->SetAgentState.dwAgentState, + lpProxyBuffer->SetAgentState.dwNextAgentState); + break; + + case LINEPROXYREQUEST_SETAGENTACTIVITY: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwAddressID = %lx, dwActivityID = %lx", + lpProxyBuffer->SetAgentActivity.dwAddressID, + lpProxyBuffer->SetAgentActivity.dwActivityID); + break; + + + case LINEPROXYREQUEST_GETAGENTCAPS: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentCaps.AgentCaps.dwTotalSize, + lpProxyBuffer->GetAgentCaps.AgentCaps.dwNeededSize); + break; + + case LINEPROXYREQUEST_GETAGENTSTATUS: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentStatus.AgentStatus.dwTotalSize, + lpProxyBuffer->GetAgentStatus.AgentStatus.dwNeededSize); + break; + + case LINEPROXYREQUEST_AGENTSPECIFIC: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwAgentExtensionIDIndex = %lx", + lpProxyBuffer->AgentSpecific.dwAgentExtensionIDIndex); + break; + + case LINEPROXYREQUEST_GETAGENTACTIVITYLIST: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentActivityList.ActivityList.dwTotalSize, + lpProxyBuffer->GetAgentActivityList.ActivityList.dwNeededSize); + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwNumentries = %lx", + lpProxyBuffer->GetAgentActivityList.ActivityList.dwNumEntries); + + break; + + case LINEPROXYREQUEST_GETAGENTGROUPLIST: + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeedSize = %lx", + lpProxyBuffer->GetAgentGroupList.GroupList.dwTotalSize, + lpProxyBuffer->GetAgentGroupList.GroupList.dwNeededSize); + break; + + } + +} + +#endif + + +VOID +CALLBACK +AutoDismissDlgTimerProc( + HWND hwnd, + UINT msg, + UINT idTimer, + DWORD dwTime + ) +{ + HWND hwndChild; + char buf[32]; + + + hwndChild = GetWindow(GetDesktopWindow(), GW_CHILD); + + while(hwndChild) + { + GetWindowText(hwndChild, buf, 31); + + if(strcmp(buf, szTitle) == 0) + { + break; + } + hwndChild = GetWindow(hwndChild, GW_HWNDNEXT); + } + + if(hwndChild) + { + KillTimer( (HWND) NULL, idTimer); + PostMessage(hwndChild, WM_KEYDOWN, 0x0D, 0x00010028); //ENTRY key + dwTimer = 0; + } + +} + + +BOOL +PrepareToAutoDismissDlg( + BOOL bEnable + ) +{ + if(bEnable) + { + if( !(dwTimer = SetTimer( + (HWND) NULL, + 0, + TIMEOUT, + (TIMERPROC) AutoDismissDlgTimerProc + ))) + { + TapiLogDetail ( + DBUG_SHOW_FAILURE, + "SetTimer Failed"); + + return FALSE; + } + } + else if (dwTimer) + { + KillTimer ((HWND) NULL, dwTimer); + } + return TRUE; +} + + +VOID +CALLBACK +AutoDismissWinTimerProc( + HWND hwnd, + UINT msg, + UINT idTimer, + DWORD dwTime + ) +{ + HWND hwndChild; + char buf[32]; + + + hwndChild = GetWindow(GetDesktopWindow(), GW_CHILD); + + while(hwndChild) + { + GetWindowText(hwndChild, buf, 31); + + if(strcmp(buf, szTitle) == 0) + { + break; + } + hwndChild = GetWindow(hwndChild, GW_HWNDNEXT); + } + + if(hwndChild) + { + KillTimer( (HWND) NULL, idTimer); + PostMessage(hwndChild, WM_KEYDOWN, 0x0D, 0x00010028); // ENTER key +// PostMessage(hwndChild, WM_DESTROY, 0x0D, 0x00010028); // ENTER key + PostQuitMessage(WM_QUIT); + dwTimer = 0; + } + +} + + +BOOL +PrepareToAutoDismissWin( + BOOL bEnable + ) +{ + if(bEnable) + { + if( !(dwTimer = SetTimer( + (HWND) NULL, + 0, + TIMEOUT, + (TIMERPROC) AutoDismissWinTimerProc + ))) + { + TapiLogDetail ( + DBUG_SHOW_FAILURE, + "SetTimer Failed"); + + return FALSE; + } + } + else if (dwTimer) + { + KillTimer ((HWND) NULL, dwTimer); + } + return TRUE; +} + + + + + + + diff --git a/private/tapi/qa/trapper/itest/ttest.def b/private/tapi/qa/trapper/itest/ttest.def new file mode 100644 index 000000000..66bd8f9da --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttest.def @@ -0,0 +1,30 @@ +LIBRARY ttest + +DATA READ WRITE + +EXPORTS + FindESPLineDevice + FindUnimdmLineDevice + FindUnusedESPLineDevice + FindLineDevWithExt + TestInvalidBitFlags + TestValidBitFlags + TestPhoneInvalidBitFlags + TestPhoneValidBitFlags + TestInvalidBitFlagsAsy + TestValidBitFlagsAsy + TestPhoneInvalidBitFlagsAsy + TestPhoneValidBitFlagsAsy + ShouldTapiTestAbort + FindESPPhoneDevice + IsESPLineDevice + IsUNIMDMLineDevice + ShowTestCase + InitTestNumber + TapiShowProxyBuffer + TapiShowAgent + AutoDismissDlgTimerProc + PrepareToAutoDismissDlg + AutoDismissWinTimerProc + PrepareToAutoDismissWin + diff --git a/private/tapi/qa/trapper/itest/ttest.h b/private/tapi/qa/trapper/itest/ttest.h new file mode 100644 index 000000000..29baf8a23 --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttest.h @@ -0,0 +1,278 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ttest.h + +Abstract: + + This module contains prototypes and data type definitions + used by the interface test dll. + +Author: + + Oliver Wallace (OliverW) 13-July-1995 + +Revision History: + +--*/ + + +#ifndef TTEST_H +#define TTEST_H + + +#include "windows.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + +// Common function declarations + +BOOL +WINAPI +FindESPLineDevice( + LPTAPILINETESTINFO lpTapiLineTestInfo + ); + +BOOL +WINAPI +FindUnimdmLineDevice( + LPTAPILINETESTINFO lpTapiLineTestInfo + ); + + +BOOL +WINAPI +FindUnusedESPLineDevice( + LPTAPILINETESTINFO lpTapiLineTestInfo + ); + +BOOL +WINAPI +FindLineDevWithExt( + LPTAPILINETESTINFO lpTapiLineTestInfo + ); + +BOOL +WINAPI +TestInvalidBitFlags( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNC lpfnTestLineFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + +BOOL +WINAPI +TestValidBitFlags( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNC lpfnTestLineFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + + +BOOL +WINAPI +TestPhoneInvalidBitFlags( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNC lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + +BOOL +WINAPI +TestPhoneValidBitFlags( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNC lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + +BOOL +WINAPI +TestInvalidBitFlagsAsy( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNCASY lpfnTestLineFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + + +BOOL +WINAPI +TestValidBitFlagsAsy( + LPTAPILINETESTINFO lpTestLineInfo, + LPFN_TAPILINETESTFUNCASY lpfnTestLineFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + + +BOOL +WINAPI +TestPhoneInvalidBitFlagsAsy( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNCASY lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + LONG lExpectedResult, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwValidReservedBitsUnion, + DWORD dwValidExtBitsUnion, + DWORD dwExcludeBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + + +BOOL +WINAPI +TestPhoneValidBitFlagsAsy( + LPTAPIPHONETESTINFO lpTestPhoneInfo, + LPFN_TAPIPHONETESTFUNCASY lpfnTestPhoneFunc, + LPDWORD lpdwTestParam, + BITFIELDTYPE eReservedFieldType, + BITFIELDTYPE eExtFieldType, + BITFIELDSIZE eReservedFieldSize, + DWORD dwReservedBitsUnion, + DWORD dwExtBitsUnion, + DWORD dwCommonBitFlags, + DWORD dwSpecialBitTest, + BOOL fTestNullParam + ); + + +BOOL +WINAPI +ShouldTapiTestAbort( + LPCSTR lpszTestName, + BOOL fQuietMode + ); + + +BOOL +WINAPI +FindESPPhoneDevice( + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo + ); + + +BOOL +WINAPI +IsESPLineDevice( + LPTAPILINETESTINFO lpTapiLineTestInfo + ); + +BOOL +WINAPI +IsUNIMDMLineDevice( + LPTAPILINETESTINFO lpTapiLineTestInfo + ); + + +BOOL +WINAPI +ShowTestCase( + BOOL fTestPassed + ); + + +VOID +WINAPI +InitTestNumber( + VOID + ); + + +VOID +CALLBACK +AutoDismissDlgTimerProc( + HWND hwnd, + UINT msg, + UINT idTimer, + DWORD dwTime + ); + +BOOL PrepareToAutoDismissDlg( + BOOL bEnable + ); + +VOID +CALLBACK +AutoDismissWinTimerProc( + HWND hwnd, + UINT msg, + UINT idTimer, + DWORD dwTime + ); + +BOOL PrepareToAutoDismissWin( + BOOL bEnable + ); + + +#if TAPI_2_0 + +VOID +TapiShowProxyBuffer( LPLINEPROXYREQUEST); + +VOID +TapiShowAgent(LPLINEPROXYREQUEST ); + +#endif // TAPI_2_0 + +#endif // TTEST_H + + diff --git a/private/tapi/qa/trapper/itest/ttest.inc b/private/tapi/qa/trapper/itest/ttest.inc new file mode 100644 index 000000000..3b186372b --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttest.inc @@ -0,0 +1,54 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=ttest +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLBASE=0x62000000 + +INCLUDES=..\..;..;..\..\..\tcore + +USE_CRTDLL=1 + +SOURCES=..\ttest.c \ + ..\version.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_0=1 -DTAPI_1_1=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=TtestDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/ttesta/makefile b/private/tapi/qa/trapper/itest/ttesta/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttesta/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/ttesta/sources b/private/tapi/qa/trapper/itest/ttesta/sources new file mode 100644 index 000000000..91dfa936a --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttesta/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\ttest.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +DLLDEF= ..\ttest.def + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/ttestw/makefile b/private/tapi/qa/trapper/itest/ttestw/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttestw/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/ttestw/sources b/private/tapi/qa/trapper/itest/ttestw/sources new file mode 100644 index 000000000..ff2834df5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/ttestw/sources @@ -0,0 +1,37 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\ttest.inc + +DLLDEF= ..\ttest.def + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/txline/dirs b/private/tapi/qa/trapper/itest/txline/dirs new file mode 100644 index 000000000..94c7d7753 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/dirs @@ -0,0 +1,2 @@ +DIRS = txlinea\ + txlinew diff --git a/private/tapi/qa/trapper/itest/txline/itlcd.c b/private/tapi/qa/trapper/itest/txline/itlcd.c new file mode 100644 index 000000000..6cda1e438 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlcd.c @@ -0,0 +1,541 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcd.c + +Abstract: + + This module contains the test functions for lineConfigDialog + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 Added UNICODE support + +--*/ + + +#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 "xline.h" + + +#define DLG_TITLE_ESP "TUISPI_lineConfigDialog" +#define DLG_TITLE_UNIMDM "Zoom VFX 28.8 Properties" + +// lineConfigDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// * 1. Bad dwDeviceID = dwNumDevs +// * 2. Bad dwDeviceID = -1 +// * 3. Bad hwndOwner (34), with no NULL +// * 4. Bad lpszDeviceClass (34), with no NULL +// * 5. Success, valid lpszDeviceClass +// * 6. Success, lpszDeviceClass = 0 +// * 7. Success, lpszDeviceClass = NULL +// +// + +BOOL TestLineConfigDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + HWND hwndOwner; +#ifdef WUNICODE + WCHAR wszValidDeviceClass[] = L"tapi/line"; + LPWSTR lpwszTile; +#else + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineConfigDialog <<<<<<<<" + ); + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1); + + // do lineInitializeEx + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // save dwDeviceID + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + + // call lineConfigDialog with bad dwDeviceID = dwNumDevs; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineConfigDialog(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Store the dwDeviceID + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + // Do lineInitializeEx + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + // dwDeviceID = -1 + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineConfigDialog(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid hwndOwner handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + // Do lineInitializeEx + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + hwndOwner = lpTapiLineTestInfo->hwndOwner; + // Test bad hwndOwner + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineConfigDialog(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + // Do lineInitializeEx + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Test bad lpszDeviceClass + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + + if (! DoLineConfigDialog(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Set valid szDeviceClass value back +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDeviceClass = 0", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDeviceClass = 0", dwTestCase + 1 + ); +#endif + + // lineInitializeEx + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Prepare dialog dismiss, get title for esp and unimdm + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + + // Set szDeviceClass empty +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L""; +#else + lpTapiLineTestInfo->lpszDeviceClass = ""; +#endif + + // Dismiss dialog + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + PrepareToAutoDismissDlg(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDeviceClass = null", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDeviceClass = null", dwTestCase + 1 + ); +#endif + + // Test lpszDeviceClass = NULL +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = NULL; +#else + lpTapiLineTestInfo->lpszDeviceClass = NULL; +#endif + + // Dismiss dialog + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDeviceClass = valid", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDeviceClass = valid", dwTestCase + 1 + ); +#endif + + // Test lpszDeviceClass in valid value +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = (LPWSTR)wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = (LPSTR)szValidDeviceClass; +#endif + + // Dismiss dialog + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lineShutdown when lineConfigDialog is going", dwTestCase + 1 + ); + + // Do lineInitializeEx + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Get dialog title for esp and unimdm + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L""; +#else + lpTapiLineTestInfo->lpszDeviceClass = ""; +#endif + + // prepare dismiss dialog + PrepareToAutoDismissDlg(TRUE); + + // hwndOwner must set to NULL + lpTapiLineTestInfo->hwndOwner = (HWND) NULL; + + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Dismiss dialog after lineShutdown + PrepareToAutoDismissDlg(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lineShutdown when multiple lineConfigDialog are going", dwTestCase + 1 + ); + + // lineInitializeEx + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Get dialog title for esp and unimdm + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L""; +#else + lpTapiLineTestInfo->lpszDeviceClass = ""; +#endif + + // prepare dismiss dialog + PrepareToAutoDismissDlg(TRUE); + // hwndOwner must set to NULL + lpTapiLineTestInfo->hwndOwner = (HWND) NULL; + + // first lineConfigDialog + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // prepare dismiss second dialog + PrepareToAutoDismissDlg(TRUE); + // second lineConfigDialog + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // prepare dismiss third dialog + PrepareToAutoDismissDlg(TRUE); + // third lineConfigDialog + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // call lineShutdown before all dialog dismiss + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Dismiss all dialog + PrepareToAutoDismissDlg(FALSE); + PrepareToAutoDismissDlg(FALSE); + PrepareToAutoDismissDlg(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // Display test results + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineConfigDialog: 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 lineConfigDialog <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlcde.c b/private/tapi/qa/trapper/itest/txline/itlcde.c new file mode 100644 index 000000000..0aecfc79e --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlcde.c @@ -0,0 +1,617 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcde.c + +Abstract: + + This module contains the test functions for lineConfigDialogEdit + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "xline.h" + +#define DLG_TITLE_ESP "TUISPI_lineConfigDialogEdit" +#define DLG_TITLE_UNIMDM "Zoom VFX 28.8 Properties" + + +// lineConfigDialogEdit +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// * 1. Bad dwDeviceID, dwNumDevs +// * 2. Bad dwDeviceID = -1 +// * 3. Bad hwndOwner (34), with no NULL +// * 4. Bad lpszDeviceClass (34), with no NULL +// * 5. Bad lpDeviceConfigIn, make sure dwSize != 0 +// * 6. Bad lpDeviceConfigOut +// * 7. Bad lpDeviceConfigOut->dwTotalSize = fixed -1 +// * 8. Bad lpDeviceConfigOut->dwTotalSize = 0 +// * 9. Success +// +// + +BOOL TestLineConfigDialogEdit(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwSize; + HWND hwndOwner; +#ifdef WUNICODE + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + + // Initialize test + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineConfigDialogEdit <<<<<<<<" + ); + // set parameters for lineInitialzeEx + 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; + + // Alloc space for some structures, and set dwTotalSize + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) lpTapiLineTestInfo->lpDeviceConfig; + + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1); + + // do lineInitialzeEx and Negotiate + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + // Set bad dwDeviceID = dwNumDevs + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + // lineIntializeEx and Negotiate api version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + // set bad dwDeviceID = -1 + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid hwndOwner handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + // lineIntializeEx and Negotiate api version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + hwndOwner = lpTapiLineTestInfo->hwndOwner; + // Test bad hwndOwner + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + // lineIntializeEx and Negotiate api version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Test invalid lpszDeviceClass pointer + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpDeviceConfigIn pointers", dwTestCase + 1 + ); + + // lineIntializeEx and Negotiate api version + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // test invalid lpDeviceConfigIn pointer, should set dwSize is nonzero + lpTapiLineTestInfo->dwSize = 128; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) gdwInvalidPointers[n]; + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpDeviceConfigOut->dwTotalSize = fixed -1", dwTestCase + 1 + ); + + // lineIntializeEx and Negotiate api version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // set lpDeviceConfigOut->dwTotalSize = fixed (sizeof structure) - 1 + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize -= 1; + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpDeviceConfigOut->dwTotalSize = 0", dwTestCase + 1 + ); + + // lineIntializeEx and Negotiate api version + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // set lpDeviceConfigOut->dwTotalSize = 0 + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = 0; + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpDeviceConfigOut pointer", dwTestCase + 1 + ); + + // lineIntializeEx and Negotiate api version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // reset lpDeviceConfigOut->dwTotalSize = sizeof structure + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + // set lpDeviceConfigOut to be invalid pointer value + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpDeviceConfigOut = + (LPVARSTRING) gdwInvalidPointers[n]; + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + // Free all alloc, and reset all parameters + FreeTestHeap(); + + 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; + + // lineIntializeEx and Negotiate api version + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Alloc space for some parameters and set dwTotalSize + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + // Get dialog title for esp and unimdm + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + + // Test lineConfigDialogEdit should call lineGetDevConfig to get lpDeviceConfig + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +/* + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwNeededSize = %lx, dwStringSize = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize + ); + */ + + // If lpDeviceConfig->dwTotalSize is not larger enough, should realloc again + // with dwNeededSize + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\t: lpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + // from loDeviceConfig get lpDeviceConfigIn + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + // Alloc space for lpDeviceConfigOut and set dwTotalSize + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + // Display some log info + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfigIn->dwSize = %lx", + lpTapiLineTestInfo->dwSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfigOut->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize + ); + + // prepare dismiss dialog + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Dismiss dialog + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tDeviceConfigOut->dwTotalSize = %lx, neededsize = %lx", + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize); + + // If dwTotalSize is not large enough, realloc with dwNeededSize + if(lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize ) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = dwSize; + + // prepare dismiss dialog + PrepareToAutoDismissDlg(TRUE); + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Dismiss dialog + PrepareToAutoDismissDlg(FALSE); + + } + + fTestPassed = ShowTestCase(fTestPassed); + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + // Display test results info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineConfigDialogEdit: 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 lineConfigDialogEdit <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlds.c b/private/tapi/qa/trapper/itest/txline/itlds.c new file mode 100644 index 000000000..334516366 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlds.c @@ -0,0 +1,885 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlds.c + +Abstract: + + This module contains the test functions for lineDevSpecific + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + +#define NUMTOTALSIZES 5 + + +// lineDevSpecific +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineDevSpecific(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + BOOL fUnimdm; + TAPILINETESTDEVSPEC TapiLineTestDevSpec; + LPVARSTRING lpDeviceID; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + LPCALLBACKPARAMS lpCallbackParams; + DWORD dwFixedSize = sizeof(TAPILINETESTDEVSPEC); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineDevSpecific <<<<<<<<" + ); + + 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; + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fUnimdm = TRUE; + } + else + fUnimdm = FALSE; + + // Because test this api need call lineNegotiateExtVersion, unimdm doesn't + // support it, so all test cases for lineDevSpecific can't tested + 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(); + } + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpDeviceID = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING)); + lpDeviceID->dwTotalSize = sizeof(VARSTRING); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineIntializeEx and Negotiate api version + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + // Test invalid line handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + // Call lineNegotiateExtVersion + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + // set bad hLine + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + " n = %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineIntializeEx and Negotiate api version, get devcaps + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + // call lineNegotiateExtVersion + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // open line and make call to get hCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + // set bad hCall + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + " n = %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpParams pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpParams pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineIntializeEx, Negotiate api version, get devcaps, open, makecall + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // set bad lpParams and nonzero dwSize + lpTapiLineTestInfo->dwSize = 128; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpParams = (LPVOID) gdwInvalidPointers[n]; + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + // Test invalid bad dwSize + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineIntializeEx, Negotiate api version, get devcaps, open, makecall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + // Test different bad dwSize: 0, dwFixed-1, 7000000, 7fffffff, ffffffff + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->dwSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwSize = %lx", dwTotalSizes[n]); + if (! DoLineDevSpecific(lpTapiLineTestInfo, lExpected, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // do lineInitializeEx, get dwNumDevs + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(*lpTapiLineTestInfo->lpdwNumDevs > 1) + { + // If dwNumDevs > 1, can do this test + // Test valid hCall another hLise, same device id + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hCall another hLine, same device id", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + // Open second line (hLine2) and make call (hCall2) + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + + // Same line, different hCall + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(*lpTapiLineTestInfo->lpdwNumDevs > 1) + { + // Test valid hCall another hLise, different device id + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: hCall another hLine, different device id", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwDeviceID = 0; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // different dwDiviceID (1) + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwDeviceID = 1; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LOPEN | LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + } + else + { + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwDeviceID = 0; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineIntializeEx, Negotiate api version, get devcaps, open, makecall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if (! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // use DevSpecific test dirrent request return with Success case + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // It is only ESP supported + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // set esp devspecificinfo structure + 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); + + // Call lineDevSpecific to set it + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + lpTapiLineTestInfo->dwAddressID = 0; + if ( ! DoLineDevSpecific(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(); + } + + // use DevSpecific test dirrent request return with Error case + 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; + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Only esp supported + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // Set esp devspecificinfo structure with error + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + lpTapiLineTestInfo->dwAddressID = 0; + // Set fCompletionModeSet to TRUE, that in tcore will deal with this special + // case: return positiveID but with a error index at dwParam2 + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineDevSpecific(lpTapiLineTestInfo, info.u.EspResult.lResult, FALSE)) + { + TLINE_FAIL(); + } + // Check message here + AddMessage( + LINE_REPLY, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // restore fComepletionModeSet + 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(); + } + + + // Display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineDevSpecific: 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 lineDevSpecific <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itldsf.c b/private/tapi/qa/trapper/itest/txline/itldsf.c new file mode 100644 index 000000000..03d55d3a8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itldsf.c @@ -0,0 +1,618 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpds.c + +Abstract: + + This module contains the test functions for lineDevSpecificFeature + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineDevSpecificFeature +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineDevSpecificFeature(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + TAPILINETESTDEVSPEC TapiLineTestDevSpec; + BOOL fUnimdm; + LPCALLBACKPARAMS lpCallbackParams; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineDevSpecificFeature <<<<<<<<" + ); + + 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; + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Test lineDevSpecifcFeature should call lineNegotiateExtVersion, this api + // is not unimdm supported + 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(); + } + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + // Test invalid line handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + lpTapiLineTestInfo->dwFeature = PHONEBUTTONFUNCTION_NONE; + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + // set bad hLine + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + " n = %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpParams pointers + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpParams pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // call lineInitialzeEx, NegotiateApiVersion, GetDevCaps, Open line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // set bad lpParams and nonzero dwSize + lpTapiLineTestInfo->dwSize = 128; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpParams = (LPVOID) gdwInvalidPointers[n]; + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + // Test invalid bad dwSize + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize = -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // call lineInitialzeEx, NegotiateApiVersion, GetDevCaps, Open line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // set dwSise = -1 + lpTapiLineTestInfo->dwSize = 0xffffffff; + + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_INVALPOINTER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + // restore dwSize + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + // Test bad dwDeature + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwFeature = 0X7FFFFFFF", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // call lineInitialzeEx, NegotiateApiVersion, GetDevCaps, Open line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // set dwFeature to bad value + lpTapiLineTestInfo->dwFeature = 0X7FFFFFFF; + + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_INVALFEATURE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test bad dwDeature + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwFeature = NONE+1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // call lineInitialzeEx, NegotiateApiVersion, GetDevCaps, Open line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // set dwFeature to lastone + 1 + lpTapiLineTestInfo->dwFeature = (DWORD) (PHONEBUTTONFUNCTION_NONE + 1); + + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_INVALFEATURE, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test bad dwDeature + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // call lineInitialzeEx, NegotiateApiVersion, GetDevCaps, Open line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // set dwFeature to be any valid value + lpTapiLineTestInfo->dwFeature = (DWORD) (PHONEBUTTONFUNCTION_NONE); + + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // For ESP use devSpecific test different request return mode for Success + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + // ESP support only + 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); + + // Call lineDevSpecific with design parameters + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // call partical api to get EspResult back + lpTapiLineTestInfo->dwFeature = (DWORD) (PHONEBUTTONFUNCTION_NONE); + if ( ! DoLineDevSpecificFeature(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(); + } + + + // use DevSpecifc to test different request return for Error + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // ESP support only + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_INVALLINEHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // set fCompletionModeSet to TRUE, tcore will take care with this test case: + // return positiveID but error index with dwParam2 + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + lpTapiLineTestInfo->dwFeature = (DWORD) (PHONEBUTTONFUNCTION_NONE); + if ( ! DoLineDevSpecificFeature(lpTapiLineTestInfo, info.u.EspResult.lResult, FALSE)) + { + TLINE_FAIL(); + } + + // Wait message here + AddMessage( + LINE_REPLY, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + 0x00000000, + info.u.EspResult.lResult, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + if( !WaitForAllMessages()) + { + TLINE_FAIL(); + } + + // restore fCompletionModeSet value + 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(); + } + + // Display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineDevSpecificFeature: 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 lineDevSpecificFeature <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlgdcf.c b/private/tapi/qa/trapper/itest/txline/itlgdcf.c new file mode 100644 index 000000000..857b641fe --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlgdcf.c @@ -0,0 +1,631 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdcf.c + +Abstract: + + This module contains the test functions for lineGetDevConfig + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "xline.h" + + + +// lineGetDevConfig +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetDevConfig(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwSize; +#ifdef WUNICODE + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetDevConfig <<<<<<<<" + ); + + 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->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + // set bad dwDeviceID = dwNumDevs + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + // Set bad dwDeviceID = -1 + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + // Set bad lpszDeviceClass + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpDeviceConfig->dwTotalSize = fixed -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + // set dwTotalSize = dwFixed -1 + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize -= 1; + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpDeviceConfig->dwTotalSize = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + // set dwTotalSize = 0 + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = 0; + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpDeviceConfig->dwTotalSize = -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + // set dwTotalSize = -1 + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = 0xffffffff; + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpDeviceConfig pointer", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + // call lineInitialzeEx, NegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + // Set invalid lpDeviceConfig and nonzero dwTotalSize + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpDeviceConfig = + (LPVARSTRING) gdwInvalidPointers[n]; + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + 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; + // lineInitializeEx, lineNegotiateAoiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // Alloc space and dwTotalSize + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + if (! DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Display log info + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwNeededSize = %lx, dwStringSize = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize); + + // If not enough size, realloc again + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // For sync apis, only one return mode + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Esp support only + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // set esp devspecificinfo parameters and call lineDevSpecific + 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(); + } + + // Set valid parameters call lineGetDevConfig, it should return lResult +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + if ( ! DoLineGetDevConfig(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Esp support only + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + // set DevSpecificInfo value with expected error + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_NODEVICE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + // lineGetDevConfig should return lResult + if ( ! DoLineGetDevConfig(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + // Display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetDevConfig 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 lineGetDevConfig <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlgr.c b/private/tapi/qa/trapper/itest/txline/itlgr.c new file mode 100644 index 000000000..b42f39af5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlgr.c @@ -0,0 +1,868 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgr.c + +Abstract: + + This module contains the test functions for lineGetRequest + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "xline.h" + +#define ALL_REQUESMODES (LINEREQUESTMODE_MAKECALL | \ + LINEREQUESTMODE_MEDIACALL) + +// lineGetRequest +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetRequest(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + +#ifdef WUNICODE + LINEREQMAKECALLW *lpLineReqMakeCallW; + LINEREQMEDIACALLW *lpLineReqMediaCallW; + LPWSTR lpwszDestAddress; + LPWSTR lpwsztapiAppName; + LPWSTR lpwszCallParty; + LPWSTR lpwszComment; +#else + LINEREQMAKECALL *lpLineReqMakeCall; + LINEREQMEDIACALL *lpLineReqMediaCall; + LPSTR lpszDestAddress; + LPSTR lpsztapiAppName; + LPSTR lpszCallParty; + LPSTR lpszComment; +#endif + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetRequest <<<<<<<<" + ); + + 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->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + + // Set invalid hLineApp + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check invalid lpRequestBuffer + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpRequestBuffer pointers", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + // Set invalid lpRequestBuffer + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpRequestBuffer = + (LPVOID) gdwInvalidPointers[n]; + if (! DoLineGetRequest( + lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + 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->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid bit flag combinations for dwRequestMode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGetRequest, + (LPDWORD) &lpTapiLineTestInfo->dwRequestMode, + LINEERR_INVALREQUESTMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_REQUESMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Get MAKECALL no registered", dwTestCase + 1); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"dialer.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "dialer.exe"; +#endif + + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + + // Set "dialer.exe" priority = 0 + lpTapiLineTestInfo->dwPriority = 0; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = FALSE; + + // call lineRegisterRequestRecipient with bEnable = FALSE + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = L"tline test"; + lpTapiLineTestInfo->lpwszCalledParty = L""; + lpTapiLineTestInfo->lpwszComment = L""; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = ""; + lpTapiLineTestInfo->lpszComment = ""; +#endif + + // tapiRequestMakeCall will return NOREQUESTRECIPIENT + if(! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPIERR_NOREQUESTRECIPIENT)) + { + TLINE_FAIL(); + } + + // lineGetRequest should return NOTREGISTERED + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOTREGISTERED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // close line and shutdown to isolate test + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: Get MAKECALL, registered, Success", dwTestCase + 1); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateAPiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // call lineRegisterRequestRecipient with bEnable = TRUE, should Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = L"tline test"; + lpTapiLineTestInfo->lpwszCalledParty = L"This is Called Party"; + lpTapiLineTestInfo->lpwszComment = L"This is Comment"; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = "This is Called Party"; + lpTapiLineTestInfo->lpszComment = "This is Comment"; +#endif + + // tapiRequestMakeCall will Success + if(! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + // lineGetRequest should Success + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case: Success: verify LINEREQMAKECALL lpRequestBuffer"); + + // with this Success, verify lpRequestBuffer + // Unicode use wcscmp compare for all fields in buffer with passing parmeters +#ifdef WUNICODE + lpLineReqMakeCallW = (LPLINEREQMAKECALLW) lpTapiLineTestInfo->lpRequestBuffer; + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszDestAddress", dwTestCase + 1); + + if(wcscmp(lpLineReqMakeCallW->szDestAddress, + lpTapiLineTestInfo->lpwszDestAddress) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwsztapiAppName", dwTestCase + 1); + + if(wcscmp(lpLineReqMakeCallW->szAppName, + lpTapiLineTestInfo->lpwsztapiAppName) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszCalledParty", dwTestCase + 1); + + if(wcscmp(lpLineReqMakeCallW->szCalledParty, + lpTapiLineTestInfo->lpwszCalledParty) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszComment", dwTestCase + 1); + + if(wcscmp(lpLineReqMakeCallW->szComment, + lpTapiLineTestInfo->lpwszComment) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); +#else + // verify ASCII + lpLineReqMakeCall = (LPLINEREQMAKECALL) lpTapiLineTestInfo->lpRequestBuffer; +TapiLogDetail( + DBUG_SHOW_PASS, + "lpBuffer->szDestAddress = %s, szAppName = %s", + lpLineReqMakeCall->szDestAddress, + lpLineReqMakeCall->szAppName); +TapiLogDetail( + DBUG_SHOW_PASS, + "lpBuffer->szCalledParty = %s, szComment = %s", + lpLineReqMakeCall->szCalledParty, + lpLineReqMakeCall->szComment); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszDestAddress", dwTestCase + 1); + + if(strcmp(lpLineReqMakeCall->szDestAddress, + lpTapiLineTestInfo->lpszDestAddress) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpsztapiAppName", dwTestCase + 1); + + if(strcmp(lpLineReqMakeCall->szAppName, + lpTapiLineTestInfo->lpsztapiAppName) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszCalledParty", dwTestCase + 1); + + if(strcmp(lpLineReqMakeCall->szCalledParty, + lpTapiLineTestInfo->lpszCalledParty) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszComment", dwTestCase + 1); + + if(strcmp(lpLineReqMakeCall->szComment, + lpTapiLineTestInfo->lpszComment) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); +#endif + + // close and shutdown to isolate test + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Get MAKECALL, registered, not avil request", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // Test dwRequestMode = MAKECALL + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Didn't call tapiRequestMakeCall, then call lineGetRequest should return NOREQUEST + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOREQUEST)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + //close and shutdown to isolate test + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Get MEDIACALL no registered", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test MEDIACALL + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MEDIACALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = FALSE; + + // make bEnable FALSE, lineRegisterRequestRecipient fail + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->dwSecure = 0; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"line/tapi"; + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = L"tline test"; + lpTapiLineTestInfo->lpwszCalledParty = L"This is Called Party"; + lpTapiLineTestInfo->lpwszComment = L"This is Comment"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "line/tapi"; + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = "This is Called Party"; + lpTapiLineTestInfo->lpszComment = "This is Comment"; +#endif + + // tapiRequestMediaCall with valid parameters Success + if(! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // because lineRegisterRequestRecipient fail, so it should return NOREGISTERED + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOTREGISTERED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // close and shutdown to isolate test + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: Get MEDIACALL, registered, Success", dwTestCase + 1); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test MEDIACALL + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MEDIACALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, to make lineRegisterRequestRecipient Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = L"tline test"; + lpTapiLineTestInfo->lpwszCalledParty = L"This is a Called Party"; + lpTapiLineTestInfo->lpwszComment = L"This is Comment"; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = "This is a Called Party"; + lpTapiLineTestInfo->lpszComment = "This is Comment"; +#endif + + // with valid parameters, tapiRequestMediaCall return Success + if(! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMEDIACALL) + ); + + // lineGetRequest should return Success + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case: Success: verify LINEREQMEDIACALL lpRequestBuffer"); + + + // verify unicode +#ifdef WUNICODE + lpLineReqMediaCallW = (LPLINEREQMEDIACALLW) lpTapiLineTestInfo->lpRequestBuffer; + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszDestAddress", dwTestCase + 1); + if(wcscmp(lpLineReqMediaCallW->szDestAddress, + lpTapiLineTestInfo->lpwszDestAddress) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszAppName", dwTestCase + 1); + if(wcscmp(lpLineReqMediaCallW->szAppName, + lpTapiLineTestInfo->lpwsztapiAppName) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszCalledParty", dwTestCase + 1); + if(wcscmp(lpLineReqMediaCallW->szCalledParty, + lpTapiLineTestInfo->lpwszCalledParty) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpwszComment", dwTestCase + 1); + if(wcscmp(lpLineReqMediaCallW->szComment, + lpTapiLineTestInfo->lpwszComment) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); +#else + // verify ASCII + lpLineReqMediaCall = (LPLINEREQMEDIACALL) lpTapiLineTestInfo->lpRequestBuffer; + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszDestAddress", dwTestCase + 1); + if(strcmp(lpLineReqMediaCall->szDestAddress, + lpTapiLineTestInfo->lpszDestAddress) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszAppName", dwTestCase + 1); + if(strcmp(lpLineReqMediaCall->szAppName, + lpTapiLineTestInfo->lpsztapiAppName) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszCalledParty", dwTestCase + 1); + if(strcmp(lpLineReqMediaCall->szCalledParty, + lpTapiLineTestInfo->lpszCalledParty) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: verify lpszComment", dwTestCase + 1); + if(strcmp(lpLineReqMediaCall->szComment, + lpTapiLineTestInfo->lpszComment) == 0 ) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + fTestPassed = ShowTestCase(fTestPassed); +#endif + + // close and shutdown to isolate test + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Get MEDIACALL, registered, not avil request", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MEDIACALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable lineRegisterRequestRecipient + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // with no tapiRequestMediaCall, lineGetRequest fail return NOREQUEST + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOREQUEST)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // close and shutdown to isolate test + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetRequest: 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 lineGetRequest <<<<<<<<" + ); + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlrrr.c b/private/tapi/qa/trapper/itest/txline/itlrrr.c new file mode 100644 index 000000000..b6a3ff540 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlrrr.c @@ -0,0 +1,633 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrrr.c + +Abstract: + + This module contains the test functions for lineRegisterRequestRecipient + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + +#define ALL_REQUESMODES (LINEREQUESTMODE_MAKECALL | \ + LINEREQUESTMODE_MEDIACALL) + + + +// lineRegisterRequestRecipient +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRegisterRequestRecipient(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + LINEREQMAKECALL LineReqMakeCall; +#ifdef WUNICODE + LPWSTR lpwszDestAddress; + LPWSTR lpwsztapiAppName; + LPWSTR lpwszCallParty; + LPWSTR lpwszComment; +#else + LPSTR lpszDestAddress; + LPSTR lpsztapiAppName; + LPSTR lpszCallParty; + LPSTR lpszComment; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineRegisterRequestRecipient <<<<<<<<" + ); + 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->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + + // set bad hLineApp + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test invalid bit flag combinations for dwRequestMode + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid bit flag combinations for dwRequestMode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test dwRequestMode all invalid bit set + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineRegisterRequestRecipient, + (LPDWORD) &lpTapiLineTestInfo->dwRequestMode, + LINEERR_INVALREQUESTMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_REQUESMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld Success: MAKECALL", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test MAKECALL + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE call lineRegisterRequestRecipient will Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = L"tline test"; + lpTapiLineTestInfo->lpwszCalledParty = L""; + lpTapiLineTestInfo->lpwszComment = L""; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = ""; + lpTapiLineTestInfo->lpszComment = ""; +#endif + + // call tapiRequestMakeCall with valid parameters, will Success + if(! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // lineGetRequest should Success + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: re-register fail: same request mode", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test MAKECALL RequestMode + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, lineRegisterRequestRecipient will Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + //re-register with same parameters, should fail + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: re-register fail: both request mode", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test both MAKECALL, MEDIACALL mode + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL | + LINEREQUESTMODE_MEDIACALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, lineRegisterRequestRecipient will Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // re-register with same mode and parameters should fail + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: re-register fail: same request mode, diff inst", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test MAKECALL mode + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, lineRegisterRequestRecipient will Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // chanage dwRegistrationInstance and re-register should fail + lpTapiLineTestInfo->dwRegistrationInstance = 1234; + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: re-register fail: both request mode, diff inst", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // test both mode + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL | + LINEREQUESTMODE_MEDIACALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // with bEnable TURE will success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // change Instance but keep same mode, re-register should fail + lpTapiLineTestInfo->dwRegistrationInstance = 1234; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: verify dwRegistrationInstance ignor for de-regi", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitialzeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + // call lineRegisterRequestRecipient with dwRegistrationInstance 1 + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 1; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, register Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // change dwRegistrationInstance to 2 + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 2; + lpTapiLineTestInfo->bEnable = FALSE; + + // de-register (Enable FLASE), lineRegisterRequestRecipient Should Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // And lineGetRequest should fail + if(! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOTREGISTERED)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: verify unregister fails when no registered", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, make register Success + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // bEnabel FALSE, make un-register (no-register) Success + lpTapiLineTestInfo->bEnable = FALSE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // unregister with a no-register should fail + lpTapiLineTestInfo->bEnable = FALSE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_OPERATIONFAILED)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: verify loop register/de-regester clear up ok", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, lineOpen + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + + // loop register, and de-register + for(n = 1; n < 10; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n = %ld", n); + lpTapiLineTestInfo->bEnable = TRUE; + + // bEnable TRUE, make register + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // bEnable FALSE make de-register + lpTapiLineTestInfo->bEnable = FALSE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineRegisterRequestRecipient: 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 lineRegisterRequestRecipient <<<<<<<<" + ); + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlscp.c b/private/tapi/qa/trapper/itest/txline/itlscp.c new file mode 100644 index 000000000..b7995f9db --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlscp.c @@ -0,0 +1,727 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscp.c + +Abstract: + + This module contains the test functions for lineSetCallParams + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + +#define MIN_RATE 10 +#define MAX_RATE 1000 + +#define ALL_BEARERMODES (LINEBEARERMODE_VOICE | \ + LINEBEARERMODE_SPEECH | \ + LINEBEARERMODE_MULTIUSE | \ + LINEBEARERMODE_DATA | \ + LINEBEARERMODE_ALTSPEECHDATA | \ + LINEBEARERMODE_NONCALLSIGNALING | \ + LINEBEARERMODE_PASSTHROUGH) + + +// lineSetCallParams +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallParams(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwSize; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + DWORD dwAllBeareMode; + LPCALLBACKPARAMS lpCallbackParams; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetCallParams <<<<<<<<" + ); + + 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->lpDialParams = (LPLINEDIALPARAMS) NULL; + lpTapiLineTestInfo->dwMinRate = MIN_RATE; + lpTapiLineTestInfo->dwMaxRate = MAX_RATE; + lpTapiLineTestInfo->dwBearerMode = LINEBEARERMODE_DATA; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + // Test invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, linenegotiateApiVersion, lineGetDevCaps, lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + + // set bad hCall + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetCallParams(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // open line with MONITOR + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // call lineDrop to disconnect call + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + // change call priviledge to MONITOR + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // lineSetCallParams should return NOTOWNER + if (! DoLineSetCallParams(lpTapiLineTestInfo, LINEERR_NOTOWNER, TRUE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest fow dwBearerMode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // set dwAllBeareMode with apiversion + if(lpTapiLineTestInfo->dwAPIVersion >= 0x00020000) + { + dwAllBeareMode = ALL_BEARERMODES | LINEBEARERMODE_RESTRICTEDDATA; + } + else + { + dwAllBeareMode = ALL_BEARERMODES; + } + + // test dwBearerMode all invalid bit set + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetCallParams, + (LPDWORD) &lpTapiLineTestInfo->dwBearerMode, + LINEERR_INVALBEARERMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_16, + dwAllBeareMode, + ~dwBitVectorMasks[(int) FIELDSIZE_16], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest fow dwBearerMode & ext", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitialzieEx, lineNegotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + if(lpTapiLineTestInfo->dwAPIVersion >= 0x00020000) + { + dwAllBeareMode = ALL_BEARERMODES | LINEBEARERMODE_RESTRICTEDDATA; + } + else + { + dwAllBeareMode = ALL_BEARERMODES; + } + + // Esp supported only + // test dwBearerMode all valid bit set + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetCallParams, + (LPDWORD) &lpTapiLineTestInfo->dwBearerMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_16, + dwAllBeareMode, + ~dwBitVectorMasks[(int) FIELDSIZE_16], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + // call lineGetCallInfo before call lineSetCallParams + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwBearerMode = %lx, dwRate = %lx", + lpTapiLineTestInfo->lpCallInfo->dwBearerMode, + lpTapiLineTestInfo->lpCallInfo->dwRate); + + + // call lineSetCallParams for some values + lpTapiLineTestInfo->dwBearerMode = LINEBEARERMODE_DATA; + lpTapiLineTestInfo->dwMinRate = MIN_RATE; + lpTapiLineTestInfo->dwMaxRate = MAX_RATE; + lpTapiLineTestInfo->lpDialParams = (LPLINEDIALPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetCallParams(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpCallInfo->dwTotalSize < + lpTapiLineTestInfo->lpCallInfo->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallInfo->dwNeededSize; + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = dwSize; + } + + // after call lineGetCallInfo again + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Display some log info + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwBearerMode = %lx, dwCallInfo->dwBearerMode = %lx", + lpTapiLineTestInfo->dwBearerMode, + lpTapiLineTestInfo->lpCallInfo->dwBearerMode); + + // verify dwBearerMode get set + if(lpTapiLineTestInfo->lpCallInfo->dwBearerMode == lpTapiLineTestInfo->dwBearerMode) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // use DevSpecific test different request return mode for Success and Error + 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; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#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->dwBearerMode = LINEBEARERMODE_DATA; + lpTapiLineTestInfo->dwMinRate = MIN_RATE; + lpTapiLineTestInfo->dwMaxRate = MAX_RATE; + lpTapiLineTestInfo->lpDialParams = (LPLINEDIALPARAMS) NULL; + if ( ! DoLineSetCallParams(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; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#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_INVALRATE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwBearerMode = LINEBEARERMODE_DATA; + lpTapiLineTestInfo->dwMinRate = MIN_RATE; + lpTapiLineTestInfo->dwMaxRate = MAX_RATE; + lpTapiLineTestInfo->lpDialParams = (LPLINEDIALPARAMS) NULL; + + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetCallParams(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(); + } + + // Display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetCallParams: 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 lineSetCallParams <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlsdcf.c b/private/tapi/qa/trapper/itest/txline/itlsdcf.c new file mode 100644 index 000000000..9bc1a1dea --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlsdcf.c @@ -0,0 +1,649 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsdcf.c + +Abstract: + + This module contains the test functions for lineSetDevConfig + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "xline.h" + + + +// lineSetDevConfig +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetDevConfig(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwSize; +#ifdef WUNICODE + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetDevConfig <<<<<<<<" + ); + + + 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; + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + + // test bad dwDeviceID = dwNumDevs + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + // lineInitializeEx, lineNegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + + // set bad dwDeviceID = -1 + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // set bad lpDeviceClass + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpDeviceConfig pointer", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // set bad lpDeviceConfig pointer with nozero dwSize + lpTapiLineTestInfo->dwSize = 128; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpDeviceConfig = + (LPVOID) gdwInvalidPointers[n]; + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: dwSize = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // test dwSize = 0 + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->dwSize = 0; + + // Esp return Success, Unimdm return Invalpointer + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwSize = -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // bad dwSize = -1 + lpTapiLineTestInfo->dwSize = 0xffffffff; + + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNegotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + // call lineGetDevConfig first + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // if dwTotalSize is not big enough, realloc again with dwNeededSize + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfig = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx", + lpTapiLineTestInfo->dwSize); + + // with all returned value, call lineSetDevConfig, should Success + if (! DoLineSetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + // use DevSpecific test RETURNRESULTS completion mode for a synch api + // and ESP only + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + 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->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfig = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + + if ( ! DoLineSetDevConfig(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_NODRIVER; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfig = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + + if ( ! DoLineSetDevConfig(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + // Display test result log info + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetDevConfig: 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 lineSetDevConfig <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlsmc.c b/private/tapi/qa/trapper/itest/txline/itlsmc.c new file mode 100644 index 000000000..937f1832a --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlsmc.c @@ -0,0 +1,1543 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsmc.c + +Abstract: + + This module contains the test functions for lineSetMediaControl + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + +#define ALL_DWSELECTS (LINECALLSELECT_LINE | \ + LINECALLSELECT_ADDRESS | \ + LINECALLSELECT_CALL) + +#define NUMENTRIES 3 +#define PAGESIZE 16384 + +// lineSetMediaControl +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetMediaControl(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + DWORD dwNumEntries[NUMENTRIES] = { + 1, +// 10000, +// 100000, + 0x06ffffff, + 0x0effffff + }; + DWORD dwNumBytes; + DWORD lExpected; + DWORD dwDigitSize = sizeof(LINEMEDIACONTROLDIGIT); + DWORD dwMediaSize = sizeof(LINEMEDIACONTROLMEDIA); + DWORD dwToneSize = sizeof(LINEMEDIACONTROLTONE); + DWORD dwCallStateSize = sizeof(LINEMEDIACONTROLCALLSTATE); + LONG lRet; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetMediaControl <<<<<<<<" + ); + + 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->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_BUTTONS; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + + // set bad hLine + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + " n = %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + + // set bad hCall + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid bit flag combinations for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // Esp and unimdm will return different error + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALCALLSELECT; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + + // test dwSelect all invalid bit set + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineSetMediaControl, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test valid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid bit flag combinations for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwSelect all valid bit set + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineSetMediaControl, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + FIELDTYPE_MUTEX, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid lpDigitList + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpDigitList", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNegotiateApiVersion, lineGetDevCaps + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + // set bad lpMCDigitList with nonzero dwDigitNumEntries + lpTapiLineTestInfo->dwDigitNumEntries = 1; + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) gdwInvalidPointers[n]; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwDigitNumEntries, fixed alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + lpTapiLineTestInfo->dwDigitNumEntries = 1; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwDigitNumEntries = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwDigitSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDigitNumEntries = %lx, dwDigitSize = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwDigitSize, dwNumBytes); + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) ITAlloc( + dwDigitSize); + if(dwNumBytes < PAGESIZE) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + + if (! DoLineSetMediaControl(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCDigitList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDigitNumEntries = 0; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwDigitNumEntries", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwDigitNumEntries = dwNumEntries[n]; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwDigitNumEntries = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) ITAlloc( + lpTapiLineTestInfo->dwDigitNumEntries * sizeof(LINEMEDIACONTROLDIGIT)); + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(lpTapiLineTestInfo->lpMCDigitList) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + } + else + lExpected = LINEERR_OPERATIONUNAVAIL; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpMCDigitList) + ITFree(lpTapiLineTestInfo->lpMCDigitList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDigitNumEntries = 0; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + // Test invalid lpMediaList + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpMediaList", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaNumEntries = 1; + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) gdwInvalidPointers[n]; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwMediaNumEntries, fixed alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwMediaNumEntries = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwMediaSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwMediaNumEntries = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) ITAlloc( + dwMediaSize); + if(dwNumBytes < PAGESIZE) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCMediaList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwMediaNumEntries = 0; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwMediaNumEntries", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwMediaNumEntries = dwNumEntries[n]; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwMediaNumEntries = %lx", dwNumEntries[n]); + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) ITAlloc( + lpTapiLineTestInfo->dwMediaNumEntries * sizeof(LINEMEDIACONTROLMEDIA)); + + if (! DoLineSetMediaControl(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCMediaList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwMediaNumEntries = 0; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +*/ + // Test invalid lpToneList + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpToneList", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwToneNumEntries = 1; + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) gdwInvalidPointers[n]; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwToneNumEntries, fixed alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwToneNumEntries = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwToneSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwToneNumEntries = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) ITAlloc( + dwToneSize); + if(dwNumBytes < PAGESIZE) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + + if (! DoLineSetMediaControl(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCToneList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwToneNumEntries = 0; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwToneNumEntries", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwToneNumEntries = dwNumEntries[n]; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwToneNumEntries = %lx", dwNumEntries[n]); + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) ITAlloc( + lpTapiLineTestInfo->dwToneNumEntries * sizeof(LINEMEDIACONTROLTONE)); + + if (! DoLineSetMediaControl(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCToneList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwToneNumEntries = 0; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +*/ + + // Test invalid lpCallStateList + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCallStateList", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCallStateNumEntries = 1; + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) gdwInvalidPointers[n]; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCallStateNumEntries, fixed alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwCallStateNumEntries = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwCallStateSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallStateNumEntries = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) ITAlloc( + dwCallStateSize); + if(dwNumBytes < PAGESIZE) + { + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + } + else + lExpected = LINEERR_INVALPOINTER; + + if (! DoLineSetMediaControl(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCCallStateList); + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->dwCallStateNumEntries = 0; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCallStateNumEntries", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwCallStateNumEntries = dwNumEntries[n]; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwCallStateNumEntries = %lx", dwNumEntries[n]); + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) ITAlloc( + lpTapiLineTestInfo->dwCallStateNumEntries * sizeof(LINEMEDIACONTROLCALLSTATE)); + + if (! DoLineSetMediaControl(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpMCCallStateList); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwCallStateNumEntries = 0; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +*/ + + // Test Success + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success with all valid lpXXXXList", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + if (! DoLineGetDevCaps(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->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) AllocFromTestHeap( + sizeof (LINEMEDIACONTROLDIGIT)); + lpTapiLineTestInfo->lpMCDigitList->dwDigit = 0; + lpTapiLineTestInfo->lpMCDigitList->dwDigitModes = LINEDIGITMODE_PULSE; + lpTapiLineTestInfo->lpMCDigitList->dwMediaControl = LINEMEDIACONTROL_RATEUP; + lpTapiLineTestInfo->dwDigitNumEntries = 1; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLMEDIA)); + lpTapiLineTestInfo->lpMCMediaList->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->lpMCMediaList->dwDuration = 10; + lpTapiLineTestInfo->lpMCMediaList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->dwMediaNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLTONE)); + lpTapiLineTestInfo->dwToneNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList->dwAppSpecific = 0; + lpTapiLineTestInfo->lpMCToneList->dwDuration = 10; + lpTapiLineTestInfo->lpMCToneList->dwFrequency1 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency2 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency3 = 0; + lpTapiLineTestInfo->lpMCToneList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLCALLSTATE)); + lpTapiLineTestInfo->dwCallStateNumEntries = 1; + lpTapiLineTestInfo->lpMCCallStateList->dwCallStates = LINECALLSTATE_IDLE; + lpTapiLineTestInfo->lpMCCallStateList->dwMediaControl = LINEMEDIACONTROL_NONE; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetMediaControl(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + 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(); + } + + + + // Test Success + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success with all NULL lpXXXXList", dwTestCase + 1 + ); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + if (! DoLineGetDevCaps(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->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) NULL; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) NULL; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) NULL; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetMediaControl(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) AllocFromTestHeap( + sizeof (LINEMEDIACONTROLDIGIT)); + lpTapiLineTestInfo->lpMCDigitList->dwDigit = 0; + lpTapiLineTestInfo->lpMCDigitList->dwDigitModes = LINEDIGITMODE_PULSE; + lpTapiLineTestInfo->lpMCDigitList->dwMediaControl = LINEMEDIACONTROL_RATEUP; + lpTapiLineTestInfo->dwDigitNumEntries = 1; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLMEDIA)); + lpTapiLineTestInfo->lpMCMediaList->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->lpMCMediaList->dwDuration = 10; + lpTapiLineTestInfo->lpMCMediaList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->dwMediaNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLTONE)); + lpTapiLineTestInfo->dwToneNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList->dwAppSpecific = 0; + lpTapiLineTestInfo->lpMCToneList->dwDuration = 10; + lpTapiLineTestInfo->lpMCToneList->dwFrequency1 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency2 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency3 = 0; + lpTapiLineTestInfo->lpMCToneList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLCALLSTATE)); + lpTapiLineTestInfo->dwCallStateNumEntries = 1; + lpTapiLineTestInfo->lpMCCallStateList->dwCallStates = LINECALLSTATE_IDLE; + lpTapiLineTestInfo->lpMCCallStateList->dwMediaControl = LINEMEDIACONTROL_NONE; + + if ( ! DoLineSetMediaControl(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALADDRESSID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) AllocFromTestHeap( + sizeof (LINEMEDIACONTROLDIGIT)); + lpTapiLineTestInfo->lpMCDigitList->dwDigit = 0; + lpTapiLineTestInfo->lpMCDigitList->dwDigitModes = LINEDIGITMODE_PULSE; + lpTapiLineTestInfo->lpMCDigitList->dwMediaControl = LINEMEDIACONTROL_RATEUP; + lpTapiLineTestInfo->dwDigitNumEntries = 1; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLMEDIA)); + lpTapiLineTestInfo->lpMCMediaList->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->lpMCMediaList->dwDuration = 10; + lpTapiLineTestInfo->lpMCMediaList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->dwMediaNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLTONE)); + lpTapiLineTestInfo->dwToneNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList->dwAppSpecific = 0; + lpTapiLineTestInfo->lpMCToneList->dwDuration = 10; + lpTapiLineTestInfo->lpMCToneList->dwFrequency1 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency2 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency3 = 0; + lpTapiLineTestInfo->lpMCToneList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLCALLSTATE)); + lpTapiLineTestInfo->dwCallStateNumEntries = 1; + lpTapiLineTestInfo->lpMCCallStateList->dwCallStates = LINECALLSTATE_IDLE; + lpTapiLineTestInfo->lpMCCallStateList->dwMediaControl = LINEMEDIACONTROL_NONE; + + if ( ! DoLineSetMediaControl(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetMediaControl: 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 lineSetMediaControl <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlsmm.c b/private/tapi/qa/trapper/itest/txline/itlsmm.c new file mode 100644 index 000000000..d67630c74 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlsmm.c @@ -0,0 +1,766 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsmm.c + +Abstract: + + This module contains the test functions for lineSetMediaMode + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + +#define ALL_MEDIAMODE (LINEMEDIAMODE_INTERACTIVEVOICE | \ + LINEMEDIAMODE_AUTOMATEDVOICE | \ + LINEMEDIAMODE_DATAMODEM | \ + LINEMEDIAMODE_G3FAX | \ + LINEMEDIAMODE_TDD | \ + LINEMEDIAMODE_G4FAX | \ + LINEMEDIAMODE_DIGITALDATA | \ + LINEMEDIAMODE_TELETEX | \ + LINEMEDIAMODE_VIDEOTEX | \ + LINEMEDIAMODE_TELEX | \ + LINEMEDIAMODE_MIXED | \ + LINEMEDIAMODE_ADSI | \ + LINEMEDIAMODE_VOICEVIEW) + +// lineSetMediaMode +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetMediaMode(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + DWORD dwAllMediaModes; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetMediaMode <<<<<<<<" + ); + + 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->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + // Test invalid call handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + + // set bad hCall + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetMediaMode(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest fow dwMediaMode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + dwAllMediaModes = ALL_MEDIAMODE | LINEMEDIAMODE_UNKNOWN; + + // test dwMediaMode all invalid bit set + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineSetMediaMode, + (LPDWORD) &lpTapiLineTestInfo->dwMediaMode, + LINEERR_INVALMEDIAMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_24, + dwAllMediaModes, + ~dwBitVectorMasks[(int) FIELDSIZE_24], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwMediaMode, no known", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwMediaMode all valid bit set no KNOWN + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + dwAllMediaModes = ALL_MEDIAMODE; + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineSetMediaMode, + (LPDWORD) &lpTapiLineTestInfo->dwMediaMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + dwAllMediaModes, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + else + { + dwAllMediaModes = LINEMEDIAMODE_INTERACTIVEVOICE ; + if (! DoLineSetMediaMode(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwAllMediaModes = LINEMEDIAMODE_DATAMODEM; + if (! DoLineSetMediaMode(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwMediaMode, with known", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwMediaMode valid bit set with UNKNOWN + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + dwAllMediaModes = ALL_MEDIAMODE | LINEMEDIAMODE_UNKNOWN; + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineSetMediaMode, + (LPDWORD) &lpTapiLineTestInfo->dwMediaMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + dwAllMediaModes, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: With a 1.3 app & VOICEVIEW media", dwTestCase + 1 + ); + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + 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->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = LOW_APIVERSION; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + // lineNogotiateApiVersion with a 1.3 version + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + // dwMediaMode = VOICEVIEW + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_VOICEVIEW; + + // lineSetMediaMode should fail + if (! DoLineSetMediaMode(lpTapiLineTestInfo, LINEERR_INVALMEDIAMODE)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + 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->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + // call lineGetCallInfo before call lineSetMediaMode + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpCallInfo->dwMedialMode = %lx", + lpTapiLineTestInfo->lpCallInfo->dwMediaMode); + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + // call lineSetMediaMode with some value + if (! DoLineSetMediaMode(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + // call lineGetCallInfo again after + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tAfter: lpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwMedialMode = %lx", + lpTapiLineTestInfo->lpCallInfo->dwMediaMode); + + // verify dwMediaMode did get set + if(lpTapiLineTestInfo->dwMediaModes = + lpTapiLineTestInfo->lpCallInfo->dwMediaMode) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + // Use DevSpecific espinfo test RETURNRESULT completion mode for a Synch api + // for Success and force a error + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#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->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + if ( ! DoLineSetMediaMode(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->lpwszDeviceClass = wszValidDeviceClass; + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#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_INVALCALLHANDLE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + if ( ! DoLineSetMediaMode(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetMediaMode: 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 lineSetMediaMode <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlst.c b/private/tapi/qa/trapper/itest/txline/itlst.c new file mode 100644 index 000000000..1a6fe9a72 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlst.c @@ -0,0 +1,870 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlst.c + +Abstract: + + This module contains the test functions for lineSetTerminal + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + +#define ALL_DWSELECTS (LINECALLSELECT_LINE | \ + LINECALLSELECT_ADDRESS | \ + LINECALLSELECT_CALL) + +#define ALL_DWTERMMODES (LINETERMMODE_BUTTONS | \ + LINETERMMODE_LAMPS | \ + LINETERMMODE_DISPLAY | \ + LINETERMMODE_RINGER | \ + LINETERMMODE_HOOKSWITCH | \ + LINETERMMODE_MEDIATOLINE | \ + LINETERMMODE_MEDIAFROMLINE | \ + LINETERMMODE_MEDIABIDIRECT) + + + +// lineSetTerminal +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetTerminal(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; + DWORD dwSize; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + DWORD dwTerminalMode; + LPCALLBACKPARAMS lpCallbackParams; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetTerminal <<<<<<<<" + ); + + 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->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hLine values", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_BUTTONS; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLine_Orig = *(lpTapiLineTestInfo->lphLine); + + // set bad hLine + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + " n = %ld", n); + *(lpTapiLineTestInfo->lphLine) = (HLINE) gdwInvalidHandles[n]; + if (! DoLineSetTerminal(lpTapiLineTestInfo, LINEERR_INVALLINEHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLine) = lpTapiLineTestInfo->hLine_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + + // set bad hCall + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineSetTerminal(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE, TRUE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid bit flag combinations for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; +// lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwSelect all invalid bit set + // Esp and unimdm return differet error + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetTerminal, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + LINEERR_INVALCALLSELECT, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + } + else + { + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetTerminal, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, + LINEERR_OPERATIONUNAVAIL, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test valid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid bit flag combinations for dwSelect", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; +// lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwSelect all valid bit set + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetTerminal, + (LPDWORD) &lpTapiLineTestInfo->dwSelect, +/* XYD, NA and MUTEX should exchange the position + FIELDTYPE_NA, + FIELDTYPE_MUTEX, +*/ + FIELDTYPE_MUTEX, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test invalid bit flag combinations for dwTerminalMode + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid bit flag combinations for dwTerminalMode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; +// lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwTerminalModes all invalid bit set + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestInvalidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetTerminal, + (LPDWORD) &lpTapiLineTestInfo->dwTerminalModes, + LINEERR_INVALTERMINALMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DWTERMMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + // Test valid bit flag combinations for dwSelect + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: valid bit flag combinations for dwTerminalModes", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; +// lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + // test dwTerminalModes all valid bit set + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if(! TestValidBitFlagsAsy( + lpTapiLineTestInfo, + DoLineSetTerminal, + (LPDWORD) &lpTapiLineTestInfo->dwTerminalModes, +/* XYD, NA and MUTEX should exchange the position + FIELDTYPE_NA, + FIELDTYPE_MUTEX, +*/ + FIELDTYPE_MUTEX, + FIELDTYPE_NA, + FIELDSIZE_32, + ALL_DWSELECTS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + // Test Success + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; +// lpTapiLineTestInfo->lpDeviceID = lpDeviceID; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_ADDRESS; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + // lineOpen, lineMakeCall + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_DISPLAY; + lpTapiLineTestInfo->dwTerminalID = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + + // test Succes with some valid parameters + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetTerminal(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetTerminal(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + // call lineGetCallInfo to get value + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + if(lpTapiLineTestInfo->lpCallInfo->dwTotalSize < + lpTapiLineTestInfo->lpCallInfo->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallInfo->dwNeededSize; + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = dwSize; + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + // Display info + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTerminalModesSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTerminalModesSize, + lpTapiLineTestInfo->lpCallInfo->dwTerminalModesOffset); + + dwTerminalMode = *((LPBYTE)lpTapiLineTestInfo->lpCallInfo+ + lpTapiLineTestInfo->lpCallInfo->dwTerminalModesOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwTerminalModes = %lx", + dwTerminalMode); + + 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; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#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->dwTerminalModes = LINETERMMODE_DISPLAY; + lpTapiLineTestInfo->dwTerminalID = 0; + lpTapiLineTestInfo->bEnable = TRUE; + if ( ! DoLineSetTerminal(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; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#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_INVALTERMINALID; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_DISPLAY; + lpTapiLineTestInfo->dwTerminalID = 0; + lpTapiLineTestInfo->bEnable = TRUE; + lpTapiLineTestInfo->fCompletionModeSet = TRUE; + if ( ! DoLineSetTerminal(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, + "@@ lineSetTerminal: 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 lineSetTerminal <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/itlstl.c b/private/tapi/qa/trapper/itest/txline/itlstl.c new file mode 100644 index 000000000..52366982f --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/itlstl.c @@ -0,0 +1,627 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlstl.c + +Abstract: + + This module contains the test functions for lineSetTollList + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + + +--*/ + + +#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 "xline.h" + + +#define ALL_TOLLLISTOPTION (LINETOLLLISTOPTION_ADD | \ + LINETOLLLISTOPTION_REMOVE) + + +// lineSetTollList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetTollList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + ESPDEVSPECIFICINFO info; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddressIn[] = L"+1 (206) 123-4738"; + WCHAR wszValidAddressIn1[] = L"+1 (206) 111-1234"; + WCHAR wszAddressIn1[] = L"+1 (206) 444 4738"; + WCHAR wszAddressIn2[] = L"66666"; + WCHAR wszPrefix1[] = L"111"; + WCHAR *pwszPrefix; +#else + CHAR szValidAddressIn[] = "+1 (206) 123-4738"; + CHAR szValidAddressIn1[] = "+1 (206) 111-1234"; + CHAR szPrefix1[] = "111"; + CHAR *pszPrefix; + CHAR szAddressIn1[] = "+1 (206) 101 4738"; + CHAR szAddressIn2[] = "66666"; +#endif + DWORD dwLocationListSize = 0; + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineSetTollList <<<<<<<<" + ); + + 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->lpLineDevCaps = + (LPLINEDEVCAPS) AllocFromTestHeap(sizeof(LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn; +#endif + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_ADD; + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + // hLineApp = 0 is valid + // set bad hLineApp + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineSetTollList(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + + // set bad dwDeviceID = dwNumDevs + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineSetTollList(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + + // set bad dwDeviceID (-1) + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineSetTollList(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Test invalid lpszAddressIn pointers +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAddressIn pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAddressIn pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAddressIn = (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineSetTollList(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Test valid lpszAddressIn non-canonical +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpwszAddressIn non-canonical", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: lpszAddressIn non-canonical", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszAddressIn1; +#else + lpTapiLineTestInfo->lpszAddressIn = szAddressIn1; +#endif + + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszAddressIn2; +#else + lpTapiLineTestInfo->lpszAddressIn = szAddressIn2; +#endif + + if (! DoLineSetTollList(lpTapiLineTestInfo, LINEERR_INVALADDRESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn; +#endif + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwTollListOption", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn; +#endif + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineSetTollList, + (LPDWORD) &lpTapiLineTestInfo->dwTollListOption, + LINEERR_INVALPARAM, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_TOLLLISTOPTION, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, LINETOLLLISTOPTION_ADD", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // lineInitializeEx, lineNogotiateApiVersion, lineGetDevCaps, + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap ( + 10*BIGBUFSIZE); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = BIGBUFSIZE*10; + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "Befor Add: dwLocationListSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize); + dwLocationListSize = lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn1; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn1; +TapiLogDetail( +DBUG_SHOW_PASS, +"addressin = %s", +lpTapiLineTestInfo->lpszAddressIn); +#endif + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_ADD; + +/* + if (DoLineSetTollList(lpTapiLineTestInfo, LINEERR_INIFILECORRUPT)) + { + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else*/ + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + { + LPLINELOCATIONENTRY lpLocationEntry; + INT i; + + lpLocationEntry = (LPLINELOCATIONENTRY) (((LPBYTE) lpTapiLineTestInfo->lpTranslateCaps) + + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListOffset); + for( i = 0; i < (INT)lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations; i++) + { + if(lpLocationEntry->dwPermanentLocationID == + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID) + break; + lpLocationEntry++; + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "dwCurLoc = %lx, dwPerID = %lx, dwName = %lx, ListSize = %lx, ListOffset = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpLocationEntry->dwPermanentLocationID, + lpLocationEntry->dwLocationNameSize, + lpLocationEntry->dwTollPrefixListSize, + lpLocationEntry->dwTollPrefixListOffset); + + TapiLogDetail( + DBUG_SHOW_PASS, + "After Add: dwLocationListSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize); + +#ifdef WUNICODE + pwszPrefix = (WCHAR *) (((LPBYTE) lpTapiLineTestInfo->lpTranslateCaps) + + lpLocationEntry->dwTollPrefixListOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "pwzPrefix = %ws", pwszPrefix); + if(wcsstr( pwszPrefix, wszPrefix1)) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#else + pszPrefix = (CHAR *) (((LPBYTE) lpTapiLineTestInfo->lpTranslateCaps) + + lpLocationEntry->dwTollPrefixListOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "pszPrefix = %s", pszPrefix); + if(strstr( pszPrefix, szPrefix1)) + fTestPassed = TRUE; + else + fTestPassed = FALSE; +#endif + + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, LINETOLLLISTOPTION_REMOVE", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS + )) + { + TLINE_FAIL(); + } + + /* + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap ( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +// lpLocationEntry = (LPLINELOCATIONENTRY) ((LPBYTE)lpTapiLineTestInfo->lpTranslateCaps + +// lpTapiLineTestInfo->lpTranslateCaps->dwLocationListOffset; + TapiLogDetail( + DBUG_SHOW_PASS, + "Befor Remove: dwLocationListSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize); + dwLocationListSize = lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize; + */ + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn1; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn1; +#endif + + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_REMOVE; + + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + /* + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_PASS, + "After Remove: dwLocationListSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize); + + if(lpTapiLineTestInfo->lpTranslateCaps->dwLocationListSize < + dwLocationListSize) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + */ + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineSetTollList: 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 lineSetTollList <<<<<<<<" + ); + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/txline/msgline.c b/private/tapi/qa/trapper/itest/txline/msgline.c new file mode 100644 index 000000000..250d7c903 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/msgline.c @@ -0,0 +1,1422 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + msgline.c + +Abstract: + + This module contains the test functions for all message sent test + +Author: + + Xiao Ying Ding (XiaoD) 5-9-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "xline.h" + +#define NUMMSGS 20 +#define NUMMSG 20 + +#define PULSESIZE 16 +#define DTMFSIZE 16 + +#define ITL_ADDRESSSTATE 0 +#define ITL_CALLINFO 1 +#define ITL_CALLSTATE 2 +#define ITL_CLOSE 3 +#define ITL_CREATE 4 +#define ITL_DEVSPECIFIC 5 +#define ITL_DEVSPECIFICFEATURE 6 +#define ITL_GATHERDIGITS 7 +#define ITL_GENERATEDIGIT 8 +#define ITL_GENERATETONE 9 +#define ITL_LINEDEVSTATE 10 +#define ITL_MONITORDIGITS 11 +#define ITL_MONITORMEDIA 12 +#define ITL_MONITORTONE 13 +#define ITL_AGENTSPECIFIC 14 +#define ITL_AGENTSTATUS 15 +#define ITL_APPNEWCALL 16 +#define ITL_PROXYREQUEST 17 +#define ITL_REMOVE 18 +#define ITL_REPLY 19 + + +typedef struct _MSGLIST +{ + char szMsg[32]; + DWORD dwMsg; +} MSGLIST, *PMSGLIST; + +ESPDEVSPECIFICINFO info; +DWORD dwHandle; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + + +DWORD MsgLineCommFunc(LPTAPILINETESTINFO lpTapiLineTestInfo, BOOL fQuietMode); + + +BOOL TestLineMessages(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + LONG lResult; + DWORD dwParam; + DWORD dwMsg; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + MSGLIST MsgList[] = + { + { "LINE_ADDRESSSTATE", LINE_ADDRESSSTATE }, + { "LINE_CALLINFO", LINE_CALLINFO }, + { "LINE_CALLSTATE", LINE_CALLSTATE }, + { "LINE_CLOSE", LINE_CLOSE }, + { "LINE_CREATE", LINE_CREATE }, + { "LINE_DEVSPECIFIC", LINE_DEVSPECIFIC }, + { "LINE_DEVSPECIFICFEATURE", LINE_DEVSPECIFICFEATURE }, + { "LINE_GATHERDIGITS", LINE_GATHERDIGITS }, + { "LINE_GENERATEDIGIT", LINE_GENERATE }, + { "LINE_GENERATETONE", LINE_GENERATE }, + { "LINE_LINEDEVSTATE", LINE_LINEDEVSTATE }, + { "LINE_MONITORDIGITS", LINE_MONITORDIGITS }, + { "LINE_MONITORMEDIA", LINE_MONITORMEDIA }, + { "LINE_MONITORTONE", LINE_MONITORTONE }, + { "LINE_AGENTSPECIFIC", LINE_AGENTSPECIFIC }, + { "LINE_AGENTSTATUS", LINE_AGENTSTATUS }, + { "LINE_APPNEWCALL", LINE_APPNEWCALL }, + { "LINE_PROXYREQUEST", LINE_PROXYREQUEST }, + { "LINE_REMOVE", LINE_REMOVE }, + { "LINE_REPLY", LINE_REPLY } + }; + + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + + 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; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "MSGs did not work for Unimodem. Return here."); + // + // Shutdown and end the tests + // + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + return fTestPassed; + } + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line messages <<<<<<<<" + ); + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + for(n = 0; n< NUMMSG; n++) + { + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test %s message", + dwTestCase + 1, MsgList[n].szMsg); + + info.u.EspMsg.dwMsg = MsgList[n].dwMsg; + + switch (n) + { + case ITL_ADDRESSSTATE: + for(dwParam = LINEADDRESSSTATE_OTHER; dwParam <= LINEADDRESSSTATE_CAPSCHANGE; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = dwParam; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = dwParam; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + case ITL_CALLINFO: + for(dwParam = LINECALLINFOSTATE_OTHER; dwParam <= LINECALLINFOSTATE_CALLDATA; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + case ITL_CALLSTATE: + for(dwParam = LINECALLSTATE_IDLE; dwParam <= LINECALLSTATE_UNKNOWN; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + case ITL_CLOSE: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + dwHandle = 0; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + +/* + case ITL_CREATE: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; +*/ + + case ITL_DEVSPECIFIC: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case ITL_DEVSPECIFICFEATURE: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case ITL_GATHERDIGITS: + for(dwParam = LINEGATHERTERM_BUFFERFULL; dwParam <= LINEGATHERTERM_CANCEL; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDigitModes = LINEDIGITMODE_PULSE; + lpTapiLineTestInfo->dwNumDigits = 2; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE * sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszTerminationDigits = "3"; + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); +#endif + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + + case ITL_GENERATEDIGIT: + for(dwParam = LINEGENERATETERM_DONE; dwParam <= LINEGENERATETERM_CANCEL; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDuration = 0; + + if (! DoLineGenerateDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + + case ITL_GENERATETONE: + for(dwParam = LINEGENERATETERM_DONE; dwParam <= LINEGENERATETERM_CANCEL; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 1; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_BEEP; + lpTapiLineTestInfo->dwDuration = 0; + + if (! DoLineGenerateTone(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + + case ITL_LINEDEVSTATE: + for(dwParam = LINEDEVSTATE_OTHER; dwParam <= LINEDEVSTATE_REMOVED; ) + { + if(dwParam != LINEDEVSTATE_REINIT) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->dwLineStates = dwParam; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + (INT) dwParam <<= 1; + } + break; + + case ITL_MONITORDIGITS: + for(dwParam = LINEDIGITMODE_PULSE; dwParam <= LINEDIGITMODE_DTMFEND; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = dwParam; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDigitModes = info.u.EspMsg.dwParam2; + if (! DoLineMonitorDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + case ITL_MONITORMEDIA: + for(dwParam = LINEMEDIAMODE_UNKNOWN; dwParam <= LINEMEDIAMODE_VOICEVIEW; ) + { + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = dwParam; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } +// lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwMediaModes = dwParam; + if (! DoLineMonitorMedia(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM2 + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + (INT) dwParam <<= 1; + } + break; + + case ITL_MONITORTONE: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + if (! DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpToneList = (LPLINEMONITORTONE) AllocFromTestHeap( + sizeof(LINEMONITORTONE)); + lpTapiLineTestInfo->dwNumEntries = 1; + + if (! DoLineMonitorTones(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + dwHandle = (DWORD) lpTapiLineTestInfo->hCall1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + +/* + case ITL_AGENTSPECIFIC: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + 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; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case ITL_AGENTSTATUS: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + 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; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTSTATUS; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + if(lret == 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; +*/ + + case ITL_APPNEWCALL: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + 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; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = TAPI_LINEMEDIAMODE_ALL; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) AllocFromTestHeap (16*2); + _itow(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDestAddress, + 10*2); +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) AllocFromTestHeap (16); + _itoa(lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDestAddress, + 10); +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage (LINE_APPNEWCALL, 0, 0, 0, 0, 0, TAPIMSG_DWMSG); + + if(!WaitForAllMessages()) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case ITL_PROXYREQUEST: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + 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; + if (! DoLineInitializeEx(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_AGENTSPECIFIC; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAgentExtensionIDIndex = 1; + lpTapiLineTestInfo->lpParams = (LPVOID) NULL; + lpTapiLineTestInfo->dwSize = 0; + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + if(lret == 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + +/* + case ITL_REMOVE: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; +*/ + + case ITL_REPLY: + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + info.u.EspMsg.dwParam1 = 0; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + fTestPassed = MsgLineCommFunc(lpTapiLineTestInfo, TRUE); + dwHandle = (DWORD) lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_DISPLAY; + lpTapiLineTestInfo->dwTerminalID = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + if (! DoLineSetTerminal(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + /* + AddMessage( + info.u.EspMsg.dwMsg, + (DWORD) dwHandle, + (DWORD) lpCallbackParams, + info.u.EspMsg.dwParam1, + info.u.EspMsg.dwParam2, + info.u.EspMsg.dwParam3, + TAPIMSG_DWMSG + ); + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + */ + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + } + + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Messages test: 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 line messages <<<<<<<<" + ); + + return fTestPassed; +} + + + +DWORD MsgLineCommFunc(LPTAPILINETESTINFO lpTapiLineTestInfo, BOOL fQuietMode) +{ + BOOL fTestPassed = TRUE; + 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->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LOPEN +// | LMAKECALL + )) + { + TLINE_FAIL(); + } + + return fTestPassed; +} + + + + + diff --git a/private/tapi/qa/trapper/itest/txline/txline.def b/private/tapi/qa/trapper/itest/txline/txline.def new file mode 100644 index 000000000..f21b7a894 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/txline.def @@ -0,0 +1,25 @@ +LIBRARY txline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 diff --git a/private/tapi/qa/trapper/itest/txline/txline.inc b/private/tapi/qa/trapper/itest/txline/txline.inc new file mode 100644 index 000000000..84cc4ab8a --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/txline.inc @@ -0,0 +1,73 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=txline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + + +DLLDEF=..\txline.def +DLLBASE=0x64000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES= ..\xline.c \ + ..\itlcd.c \ + ..\itlcde.c \ + ..\itlds.c \ + ..\itldsf.c \ + ..\itlgdcf.c \ + ..\itlgr.c \ + ..\itlrrr.c \ + ..\itlscp.c \ + ..\itlsdcf.c \ + ..\itlsmm.c \ + ..\itlst.c \ + ..\itlstl.c \ + ..\itlsmc.c \ + ..\uline.c \ + ..\msgline.c \ + ..\xline.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + + +UMTYPE=windows + +DLLENTRY=TXLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/txline/txlinea/makefile b/private/tapi/qa/trapper/itest/txline/txlinea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/txlinea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/txline/txlinea/sources b/private/tapi/qa/trapper/itest/txline/txlinea/sources new file mode 100644 index 000000000..7e527092d --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/txlinea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\txline.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/txline/txlinew/makefile b/private/tapi/qa/trapper/itest/txline/txlinew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/txlinew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/txline/txlinew/sources b/private/tapi/qa/trapper/itest/txline/txlinew/sources new file mode 100644 index 000000000..3baf670fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/txlinew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\txline.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/txline/uline.c b/private/tapi/qa/trapper/itest/txline/uline.c new file mode 100644 index 000000000..3402dbdeb --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/uline.c @@ -0,0 +1,242 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "xline.h" + + +char szApiName[13][48] = + { + "lineConfigDialog", + "lineConfigDialogEdit", + "lineDevSpecific", + "lineDevSpecificFeature", + "lineGetDevConfig", + "lineGetRequest", + "lineRegisterRequestRecipient", + "lineSetCallParams", + "lineSetDevConfig", + "lineSetMediaControl", + "lineSetMediaMode", + "lineSetTerminal", + "lineSetTollList" + }; + + +BOOL TestLineUninitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + lpTapiLineTestInfo->hwndOwner = (HWND)NULL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 13; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineConfigDialog(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 1: + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 4: + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 5: + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 6: + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 7: + if (! DoLineSetCallParams(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 9: + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 10: + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_INTERACTIVEVOICE; + if (! DoLineSetMediaMode(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 11: + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_DISPLAY; + if (! DoLineSetTerminal(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 12: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"+1 (206) 936-4738"; +#else + lpTapiLineTestInfo->lpszAddressIn = "+1 (206) 936-4738"; +#endif + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_ADD; + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/txline/xline.c b/private/tapi/qa/trapper/itest/txline/xline.c new file mode 100644 index 000000000..9c964f22e --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/xline.c @@ -0,0 +1,335 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + xline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 26-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "xline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTXLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TXLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTXLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninitialize(TRUE, TRUE)); +} + + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigDialog(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigDialogEdit(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineDevSpecific(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineDevSpecificFeature(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineGetDevConfig(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineGetRequest(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineRegisterRequestRecipient(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallParams(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSetDevConfig(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineSetMediaControl(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineSetMediaMode(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineSetTerminal(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineSetTollList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineMessages(TRUE, FALSE)); +} + + + diff --git a/private/tapi/qa/trapper/itest/txline/xline.def b/private/tapi/qa/trapper/itest/txline/xline.def new file mode 100644 index 000000000..f21b7a894 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/xline.def @@ -0,0 +1,25 @@ +LIBRARY txline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 diff --git a/private/tapi/qa/trapper/itest/txline/xline.h b/private/tapi/qa/trapper/itest/txline/xline.h new file mode 100644 index 000000000..a950a6f85 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/xline.h @@ -0,0 +1,193 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + xline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef XLINE_H +#define XLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + + +BOOL +TestLineUninitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineConfigDialog( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineConfigDialogEdit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDevSpecific( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDevSpecificFeature( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetDevConfig( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetRequest( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRegisterRequestRecipient( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineSetCallParams( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetDevConfig( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetMediaControl( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetMediaMode( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetTerminal( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetTollList( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineMessages( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +#endif // XLINE_H diff --git a/private/tapi/qa/trapper/itest/txline/xline.rc b/private/tapi/qa/trapper/itest/txline/xline.rc new file mode 100644 index 000000000..c101af485 --- /dev/null +++ b/private/tapi/qa/trapper/itest/txline/xline.rc @@ -0,0 +1,12 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI TXLine API test Library" +#define VER_INTERNALNAME_STR "txline.dll" +#define VER_ORIGINALFILENAME_STR "txline.dll" + +#include "common.ver" + + diff --git a/private/tapi/qa/trapper/itest/tyline/dirs b/private/tapi/qa/trapper/itest/tyline/dirs new file mode 100644 index 000000000..edbbca874 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/dirs @@ -0,0 +1,2 @@ +DIRS=tylinea\ + tylinew diff --git a/private/tapi/qa/trapper/itest/tyline/itlap.c b/private/tapi/qa/trapper/itest/tyline/itlap.c new file mode 100644 index 000000000..56d79304d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlap.c @@ -0,0 +1,694 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlap.c + +Abstract: + + This module contains the test functions for lineAddProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "yline.h" + + +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" +#define DLG_TITLE_ESP "TUISPI_providerConfig" +#define DLG_TITLE_UNIMDM "Modems Properties" +#define DLG_TITLE "ESP32.TSP" + + + +// lineAddProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAddProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp; + BOOL fUnimdm; + HWND hwndOwner; +#ifdef WUNICODE + WCHAR wszProviderFilename[] = L"some.tsp"; + WCHAR wszEspProviderFilename[] = L"esp32.tsp"; + WCHAR wszUnimdmProviderFilename[] = L"unimdm.tsp"; +#else + CHAR szProviderFilename[] = "some.tsp"; + CHAR szEspProviderFilename[] = "esp32.tsp"; + CHAR szUnimdmProviderFilename[] = "unimdm.tsp"; +#endif + DWORD dwNumProviders; + BOOL fAddProvider; + DWORD dwPermanentProviderID; + LINEPROVIDERENTRY *lpProviderEntry; + LPSTR lpszProviderName; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineAddProvider <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineAddProvider with initialize"); + + 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->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = L"some.tsp"; +#else + lpTapiLineTestInfo->lpszProviderFilename = "some.tsp"; +#endif + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszProviderFilename pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszProviderFilename pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszProviderFilename = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check invalid hwndOwner handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = L"some.tsp"; +#else + lpTapiLineTestInfo->lpszProviderFilename = "some.tsp"; +#endif + + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwPermanentProviderID pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = L"some.tsp"; +#else + lpTapiLineTestInfo->lpszProviderFilename = "some.tsp"; +#endif + lpTapiLineTestInfo->hwndOwner = hwndOwner; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwPermanentProviderID = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + + if(FindESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(FindUnimdmLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + else + { + fEsp = FALSE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + fAddProvider = TRUE; + dwPermanentProviderID = lpTapiLineTestInfo->dwPermanentProviderID; + + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, list all providers", dwTestCase + 1 + ); + + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + lpProviderEntry = (LPLINEPROVIDERENTRY) (((LPBYTE)lpTapiLineTestInfo->lpProviderList) + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset); + + for(n=0; n < (INT)lpTapiLineTestInfo->lpProviderList->dwNumProviders; n++) + { + lpszProviderName = (LPSTR) (((LPBYTE)lpTapiLineTestInfo->lpProviderList) + + lpProviderEntry->dwProviderFilenameOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "dwPermanetID = %lx, Provider = %s", + lpProviderEntry->dwPermanentProviderID, + lpszProviderName); + lpProviderEntry++; + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(fAddProvider == TRUE) + { + if(lpTapiLineTestInfo->lpProviderList->dwNumProviders == + dwNumProviders + 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, provider should not be add twice", dwTestCase + 1 + ); + + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_NOMULTIPLEINSTANCE)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->dwPermanentProviderID = dwPermanentProviderID; + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineAddProvider with NO initialize"); + + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = L"some.tsp"; +#else + lpTapiLineTestInfo->lpszProviderFilename = "some.tsp"; +#endif + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + fAddProvider = FALSE; + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszProviderFilename pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszProviderFilename pointers", dwTestCase + 1 + ); +#endif + + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszProviderFilename = + (LPSTR) gdwInvalidPointers[n]; +#endif + + if (! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szProviderFilename; +#endif + + // Check invalid hwndOwner handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szProviderFilename; +#endif + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpdwPermanentProviderID pointers", dwTestCase + 1 + ); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szProviderFilename; +#endif + lpTapiLineTestInfo->hwndOwner = hwndOwner; + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpdwPermanentProviderID = + (LPDWORD) gdwInvalidPointers[n]; + if (! DoLineAddProvider(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szProviderFilename; +#endif + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + if(fEsp) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(fUnimdm) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + else + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + fAddProvider = TRUE; + + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + if(fAddProvider == TRUE) + { + if(lpTapiLineTestInfo->lpProviderList->dwNumProviders == + dwNumProviders + 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineAddProvider: 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 lineAddProvider <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tyline/itlcp.c b/private/tapi/qa/trapper/itest/tyline/itlcp.c new file mode 100644 index 000000000..e00cecd51 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlcp.c @@ -0,0 +1,549 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcp.c + +Abstract: + + This module contains the test functions for lineConfigProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + +#define DLG_TITLE_ESP "TUISPI_providerConfig" +#define DLG_TITLE_UNIMDM "Modems Properties" +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" + + + +// lineConfigProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineConfigProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n=1; + BOOL fTestPassed = TRUE; + HWND hwndOwner; + DWORD dwNumProviders; + BOOL fUnimdm; + MSG msg; + LPLINEPROVIDERENTRY lpProviderEntry; + LPSTR lpszProviderName; +#ifdef WUNICODE + WCHAR wszEspProviderFilename[] = L"esp32.tsp"; + WCHAR wszUnimdmProviderFilename[] = L"unimdm.tsp"; +#else + CHAR szEspProviderFilename[] = "esp32.tsp"; + CHAR szUnimdmProviderFilename[] = "unimdm.tsp"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineConfigProvider <<<<<<<<" + ); + + 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->dwAPIVersion = HIGH_APIVERSION; + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineConfigProvider with initialize"); + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BIGBUFSIZE); +// sizeof(LINEPROVIDERLIST)); +// lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + lpProviderEntry = (LPLINEPROVIDERENTRY) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "ProviderID = %lx, NameSize= %lx", + (LPBYTE)lpTapiLineTestInfo->lpProviderList + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset, + (LPBYTE)lpTapiLineTestInfo->lpProviderList + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset + sizeof(DWORD)); + + // Check invalid hwndOwner handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; + + // hwndOwner can be NULL, so from n=1 + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineConfigProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0; + if (! DoLineConfigProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0xffffffff; + if (! DoLineConfigProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +/* + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fUnimdm = TRUE; + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + */ + + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + for(n = 1; n <= (INT)lpTapiLineTestInfo->lpProviderList->dwNumProviders; n++) + { + lpTapiLineTestInfo->dwPermanentProviderID = lpProviderEntry->dwPermanentProviderID; + lpszProviderName = (LPSTR) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpProviderEntry->dwProviderFilenameOffset); + if(strstr(lpszProviderName, "unimdm")) + { + fUnimdm = TRUE; + strcpy(szTitle, DLG_TITLE_UNIMDM); + PrepareToAutoDismissWin(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + PrepareToAutoDismissWin(FALSE); + } + else if(strstr(lpszProviderName, "esp")) + { + fUnimdm = FALSE; + strcpy(szTitle, DLG_TITLE_ESP); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + } + lpProviderEntry++; + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Remove a provider is configing", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BIGBUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpProviderEntry = (LPLINEPROVIDERENTRY) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset); + + lpTapiLineTestInfo->hwndOwner = (HWND) NULL; + + for(n = 1; n <= (INT)lpTapiLineTestInfo->lpProviderList->dwNumProviders; n++) + { + lpTapiLineTestInfo->dwPermanentProviderID = lpProviderEntry->dwPermanentProviderID; + lpszProviderName = (LPSTR) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpProviderEntry->dwProviderFilenameOffset); + if(strstr(lpszProviderName, "unimdm")) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + PrepareToAutoDismissWin(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + PrepareToAutoDismissWin(FALSE); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(strstr(lpszProviderName, "esp")) + { + strcpy(szTitle, DLG_TITLE_ESP); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + PrepareToAutoDismissDlg(FALSE); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + } + lpProviderEntry++; + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineConfigProvider with NO initialize"); + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BIGBUFSIZE); +// sizeof(LINEPROVIDERLIST)); +// lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + + lpProviderEntry = (LPLINEPROVIDERENTRY) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset); + + + // Check invalid hwndOwner handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; + + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineConfigProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0; + if (! DoLineConfigProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0xffffffff; + if (! DoLineConfigProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + for(n = 1; n <= (INT)lpTapiLineTestInfo->lpProviderList->dwNumProviders; n++) + { + lpTapiLineTestInfo->dwPermanentProviderID = lpProviderEntry->dwPermanentProviderID; + lpszProviderName = (LPSTR) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpProviderEntry->dwProviderFilenameOffset); + if(strstr(lpszProviderName, "unimdm")) + { + fUnimdm = TRUE; + strcpy(szTitle, DLG_TITLE_UNIMDM); + PrepareToAutoDismissWin(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + PrepareToAutoDismissWin(FALSE); + } + else if(strstr(lpszProviderName, "esp")) + { + fUnimdm = FALSE; + strcpy(szTitle, DLG_TITLE_ESP); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + } + lpProviderEntry++; + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineConfigProvider: 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 lineConfigProvider <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tyline/itlgc.c b/private/tapi/qa/trapper/itest/tyline/itlgc.c new file mode 100644 index 000000000..552e55f47 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlgc.c @@ -0,0 +1,703 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgc.c + +Abstract: + + This module contains the test functions for lineGetCountry + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + +#define NUMTOTALSIZES 5 + + + +// lineGetCountry +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetCountry(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + LPLINECOUNTRYENTRY lpLineCountryEntry; +#ifdef WUNICODE + LPWSTR lpwszCountryName; +#else + LPSTR lpszCountryName; +#endif + + DWORD dwFixedSize = sizeof(LINECOUNTRYLIST); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetCountry <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineGetCountry with initialize"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCountry pointers", dwTestCase + 1 + ); + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpLineCountryList = + (LPLINECOUNTRYLIST) gdwInvalidPointers[n]; + if (! DoLineGetCountry(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap ( + sizeof(LINECOUNTRYLIST)); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetCountry(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = dwFixedSize; + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCountryID (-1)", dwTestCase + 1 + ); + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCountryID = 0xffffffff; + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + sizeof(LINECOUNTRYLIST)); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = sizeof(LINECOUNTRYLIST); + + + if (! DoLineGetCountry(lpTapiLineTestInfo, LINEERR_INVALCOUNTRYCODE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCountryID (2)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCountryID = 2; + + if (! DoLineGetCountry(lpTapiLineTestInfo, LINEERR_INVALCOUNTRYCODE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwCountryID = 1; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineGetCountry( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineGetCountry( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = sizeof(LINECOUNTRYLIST); + + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineCountryList->dwNumCounties = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwNumCountries); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Get entire country list", dwTestCase + 1 + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineCountryList->dwNumCounties = %lx, dwTotal = %lx, dwNeeded = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwNumCountries, + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize, + lpTapiLineTestInfo->lpLineCountryList->dwNeededSize); + + lpLineCountryEntry = (LPLINECOUNTRYENTRY) (((LPBYTE) lpTapiLineTestInfo->lpLineCountryList) + + lpTapiLineTestInfo->lpLineCountryList->dwCountryListOffset); + + for(n = 0; n < (INT)lpTapiLineTestInfo->lpLineCountryList->dwNumCountries; n++) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "dwCountryID = %lx, dwCountryCode = %lx, NameSize = %lx", + lpLineCountryEntry->dwCountryID, + lpLineCountryEntry->dwCountryCode, + lpLineCountryEntry->dwCountryNameSize); + +#ifdef WUNICODE + lpwszCountryName = (LPWSTR) (((LPBYTE) lpTapiLineTestInfo->lpLineCountryList) + + lpLineCountryEntry->dwCountryNameOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "CountryName = %ws", + lpwszCountryName); +#else + lpszCountryName = (LPSTR) (((LPBYTE) lpTapiLineTestInfo->lpLineCountryList) + + lpLineCountryEntry->dwCountryNameOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "CountryName = %s", + lpszCountryName); +#endif + lpLineCountryEntry++; + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineGetCountry with NO initialize"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpCountry pointers", dwTestCase + 1 + ); + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpLineCountryList = + (LPLINECOUNTRYLIST) gdwInvalidPointers[n]; + if (! DoLineGetCountry(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap ( + sizeof(LINECOUNTRYLIST)); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetCountry(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = dwFixedSize; + + FreeTestHeap(); + +/* + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCountryID (-1)", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->dwCountryID = 0xffffffff; + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + sizeof(LINECOUNTRYLIST)); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = sizeof(LINECOUNTRYLIST); + + + if (! DoLineGetCountry(lpTapiLineTestInfo, LINEERR_INVALCOUNTRYCODE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCountryID (2)", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwCountryID = 2; + + if (! DoLineGetCountry(lpTapiLineTestInfo, LINEERR_INVALCOUNTRYCODE)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwCountryID = 1; + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineGetCountry( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineGetCountry( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = sizeof(LINECOUNTRYLIST); + + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineCountryList->dwNumCounties = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwNumCountries); + + fTestPassed = ShowTestCase(fTestPassed); + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Get entire country list", dwTestCase + 1 + ); + +/* + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); +*/ + + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineCountryList->dwNumCounties = %lx, dwTotal = %lx, dwNeeded = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwNumCountries, + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize, + lpTapiLineTestInfo->lpLineCountryList->dwNeededSize); + + lpLineCountryEntry = (LPLINECOUNTRYENTRY) (((LPBYTE) lpTapiLineTestInfo->lpLineCountryList) + + lpTapiLineTestInfo->lpLineCountryList->dwCountryListOffset); + + for(n = 0; n < (INT)lpTapiLineTestInfo->lpLineCountryList->dwNumCountries; n++) + { + TapiLogDetail( + DBUG_SHOW_PASS, + "dwCountryID = %lx, dwCountryCode = %lx, NameSize = %lx", + lpLineCountryEntry->dwCountryID, + lpLineCountryEntry->dwCountryCode, + lpLineCountryEntry->dwCountryNameSize); + +#ifdef WUNICODE + lpwszCountryName = (LPWSTR) (((LPBYTE) lpTapiLineTestInfo->lpLineCountryList) + + lpLineCountryEntry->dwCountryNameOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "CountryName = %ws", + lpwszCountryName); +#else + lpszCountryName = (LPSTR) (((LPBYTE) lpTapiLineTestInfo->lpLineCountryList) + + lpLineCountryEntry->dwCountryNameOffset); + TapiLogDetail( + DBUG_SHOW_PASS, + "CountryName = %s", + lpszCountryName); +#endif + lpLineCountryEntry++; + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetCountry: 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 lineGetCountry <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itlgdt.c b/private/tapi/qa/trapper/itest/tyline/itlgdt.c new file mode 100644 index 000000000..590602a80 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlgdt.c @@ -0,0 +1,903 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdt.c + +Abstract: + + This module contains the test functions for lineGenerateDigits + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "yline.h" + + +#define ALL_DIGITMODES (LINEDIGITMODE_PULSE | \ + LINEDIGITMODE_DTMF) + + +// lineGenerateDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGenerateDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + DWORD dwDigitModes; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fMsgSend = FALSE; + LONG lExpected; + ESPDEVSPECIFICINFO info; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGenerateDigits <<<<<<<<" + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDuration = 0; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_NOTOWNER)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDigits pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDigits pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDigits = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwDigitModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALDIGITMODE; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGenerateDigits, + (LPDWORD) &lpTapiLineTestInfo->dwDigitMode, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DIGITMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwDigitModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineGenerateDigits, + (LPDWORD) &lpTapiLineTestInfo->dwDigitMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_DIGITMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_GENERATE msg sent", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDuration = 0; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_GENERATE; + info.u.EspMsg.dwParam1 = LINEGENERATETERM_DONE; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + if(fTestPassed) + { + AddMessage( + LINE_GENERATE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGENERATETERM_DONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_DWPARAM1 +// | TAPIMSG_DWPARAM3 +// HDEVCALL | TAPIMSG_DWCALLBACKINST +// TAPIMSG_DWPARAM1 | TAPIMSG_DWPARAM3 + ); + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TLINE_FAIL(); + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINE_GENERATE msg not received"); + } + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_GENERATE msg filtered when call goes away", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (2) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (2) * sizeof(HCALL) + 8; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; +// lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDuration = 0; + +// lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if( ! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_MSG; + + info.u.EspMsg.dwMsg = LINE_GENERATE; + info.u.EspMsg.dwParam1 = LINEGENERATETERM_DONE; + info.u.EspMsg.dwParam2 = 0; + info.u.EspMsg.dwParam3 = 0; + + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + lpTapiLineTestInfo->dwLineStates = LINEDEVSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->dwAddressStates = LINEADDRESSSTATE_DEVSPECIFIC; + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_GENERATE, + (DWORD) lpTapiLineTestInfo->hCall2, + (DWORD) lpCallbackParams, + LINEGENERATETERM_DONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | +//| TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + + if(! DoLineDevSpecific (lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + if(lpCallbackParams->lpExpTapiMsgs != NULL) + { + TapiLogDetail(DBUG_SHOW_FAILURE, + "LINE_GENERATE msg not received"); + } + else + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +/* + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + */ + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + 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->dwDigitMode = LINEDIGITMODE_PULSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDuration = 0; + + if ( ! DoLineGenerateDigits(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALCALLSTATE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDuration = 0; + + if ( ! DoLineGenerateDigits(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGenerateDigits: 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 lineGenerateDigits <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itlgi.c b/private/tapi/qa/trapper/itest/tyline/itlgi.c new file mode 100644 index 000000000..a046c1edb --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlgi.c @@ -0,0 +1,596 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgi.c + +Abstract: + + This module contains the test functions for lineGetIcon + +Author: + + Xiao Ying Ding (XiaoD) 11-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "yline.h" + + + + + +// lineGetIcon +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetIcon(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidDeviceClass[] = L"tapi/line"; + WCHAR wszInvalidDeviceClass[] = L"tapi/InvalidDeviceClass"; +#else + CHAR szValidDeviceClass[] = "tapi/line"; + CHAR szInvalidDeviceClass[] = "tapi/InvalidDeviceClass"; +#endif + ESPDEVSPECIFICINFO info; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetIcon <<<<<<<<" + ); + + + // Try bad device id (dwNumDevs) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad Device ID (dwNumDevs)", dwTestCase + 1); + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszDeviceClass pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszDeviceClass pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszDeviceClass = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpszDeviceClass", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszInvalidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szInvalidDeviceClass; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_INVALDEVICECLASS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGetIcon(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lphIcon pointers", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lphIcon = + (LPHICON) gdwInvalidPointers[n]; + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->lphIcon = &lpTapiLineTestInfo->hIcon; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDeviceClass = 0", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDeviceClass = 0", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L""; +#else + lpTapiLineTestInfo->lpszDeviceClass = ""; +#endif + + if (! DoLineGetIcon(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +// AutoDismissDlg(); + + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDeviceClass = null", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDeviceClass = null", dwTestCase + 1 + ); +#endif + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = NULL; +#else + lpTapiLineTestInfo->lpszDeviceClass = NULL; +#endif + + if (! DoLineGetIcon(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpwszDeviceClass = valid", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, lpszDeviceClass = valid", dwTestCase + 1 + ); +#endif + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = (LPWSTR) wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDeviceClass = (LPSTR) szValidDeviceClass; +#endif + + if (! DoLineGetIcon(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + 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(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L""; +#else + lpTapiLineTestInfo->lpszDeviceClass = ""; +#endif + + if ( ! DoLineGetIcon(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + 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; + + // Init a line + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + info.dwKey = ESPDEVSPECIFIC_KEY; + info.dwType = ESP_DEVSPEC_RESULT; + info.u.EspResult.lResult = LINEERR_NODEVICE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L""; +#else + lpTapiLineTestInfo->lpszDeviceClass = ""; +#endif + + if ( ! DoLineGetIcon(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetIcon: 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 lineGetIcon <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itlgpl.c b/private/tapi/qa/trapper/itest/tyline/itlgpl.c new file mode 100644 index 000000000..43cd86c46 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlgpl.c @@ -0,0 +1,438 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgpl.c + +Abstract: + + This module contains the test functions for lineGetProviderList + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineGetProviderList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetProviderList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetProviderList <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineGetProviderList with initialize"); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpProviderList pointers", dwTestCase + 1 + ); + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpProviderList = + (LPLINEPROVIDERLIST) gdwInvalidPointers[n]; + if (! DoLineGetProviderList(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BUFSIZE); +// sizeof(LINEPROVIDERLIST)); +// lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = Fixed-1", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList->dwTotalSize = + sizeof(LINEPROVIDERLIST) - 1; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = 0", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList->dwTotalSize = 0; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineGetProviderList with NO initialize"); + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpProviderList pointers", dwTestCase + 1 + ); + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpProviderList = + (LPLINEPROVIDERLIST) gdwInvalidPointers[n]; + if (! DoLineGetProviderList(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BUFSIZE); +// sizeof(LINEPROVIDERLIST)); +// lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->dwAPIVersion_Orig = + lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAPIVersion = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + + lpTapiLineTestInfo->dwAPIVersion_Orig = + lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TOOLOW_APIVERSION; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwAPIVersion = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = Fixed-1", dwTestCase + 1); + + lpTapiLineTestInfo->lpProviderList->dwTotalSize = + sizeof(LINEPROVIDERLIST) - 1; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize = 0", dwTestCase + 1); + + lpTapiLineTestInfo->lpProviderList->dwTotalSize = 0; + if (! DoLineGetProviderList( + lpTapiLineTestInfo, + LINEERR_STRUCTURETOOSMALL)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetProviderList: 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 lineGetProviderList <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tyline/itlgtc.c b/private/tapi/qa/trapper/itest/tyline/itlgtc.c new file mode 100644 index 000000000..419f4608a --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlgtc.c @@ -0,0 +1,357 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgtc.c + +Abstract: + + This module contains the test functions for lineGetTranslateCaps + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + +#define NUMTOTALSIZES 5 + + + +// lineGetTranslateCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetTranslateCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + DWORD dwFixedSize = sizeof(LINETRANSLATECAPS); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGetTranslateCaps <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpTranslateCaps pointers", dwTestCase + 1 + ); + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpTranslateCaps = + (LPLINETRANSLATECAPS) gdwInvalidPointers[n]; + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Check invalid line app handles + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = + sizeof(LINETRANSLATECAPS) ; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + // hLineApp = 0 is valid + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineGetTranslateCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineGetTranslateCaps( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = dwFixedSize; + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = + sizeof(LINETRANSLATECAPS); + if (! DoLineGetTranslateCaps( + lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize, + lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGetTranslateCaps: 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 lineGetTranslateCaps <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itlgtn.c b/private/tapi/qa/trapper/itest/tyline/itlgtn.c new file mode 100644 index 000000000..34a964175 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlgtn.c @@ -0,0 +1,1030 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgtn.c + +Abstract: + + This module contains the test functions for lineGenerateTone + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + +#define ALL_TONEMODES (LINETONEMODE_CUSTOM | \ + LINETONEMODE_RINGBACK | \ + LINETONEMODE_BUSY | \ + LINETONEMODE_BEEP | \ + LINETONEMODE_BILLING ) + +#define NUMENTRIES 6 +#define PAGESIZE 4000 + +// lineGenerateTone +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGenerateTone(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; + WCHAR wszValidDeviceClass[] = L"tapi/line"; +#else + CHAR szValidAddress[] = "55555"; + CHAR szValidDeviceClass[] = "tapi/line"; +#endif + DWORD dwToneModes; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fMsgSend = FALSE; + ESPDEVSPECIFICINFO info; + + DWORD dwNumEntries[NUMENTRIES] = { + 1, +// 500, + // 1000, +// 100000, + 0x7fffffff, + 0xffffffff + }; + DWORD dwNumBytes; + DWORD lExpected; + DWORD dwFixedSize = sizeof(LINEGENERATETONE); + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineGenerateTone <<<<<<<<" + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_RINGBACK; + lpTapiLineTestInfo->dwDuration = 0; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_NOTOWNER)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwToneModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + lExpected = LINEERR_INVALTONEMODE; + else + lExpected = LINEERR_OPERATIONUNAVAIL; + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineGenerateTone, + (LPDWORD) &lpTapiLineTestInfo->dwToneMode, + lExpected, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_TONEMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwDigitNumEntries, fixed alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_CUSTOM; + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwNumTones = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwFixedSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwNumTones = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + lpTapiLineTestInfo->lpTones = (LPLINEGENERATETONE) ITAlloc( + dwFixedSize); + if(dwNumBytes < PAGESIZE) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + + if (! DoLineGenerateTone(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + ITFree(lpTapiLineTestInfo->lpTones); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwNumTones = 1; + lpTapiLineTestInfo->lpTones = (LPLINEGENERATETONE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwDigitNumEntries, var alloc size", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_CUSTOM; + for(n=0; n< NUMENTRIES; n++) + { + lpTapiLineTestInfo->dwNumTones = dwNumEntries[n]; + dwNumBytes = dwNumEntries[n] * dwFixedSize; + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwNumTones = %lx, dwNumBytes = %lx", + dwNumEntries[n], dwNumBytes); + lpTapiLineTestInfo->lpTones = (LPLINEGENERATETONE) ITAlloc( + dwNumBytes); + if(lpTapiLineTestInfo->lpTones) + lExpected = TAPISUCCESS; + else + lExpected = LINEERR_INVALPOINTER; + + if (! DoLineGenerateTone(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + if(lpTapiLineTestInfo->lpTones) + ITFree(lpTapiLineTestInfo->lpTones); + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwNumTones = 1; + lpTapiLineTestInfo->lpTones = (LPLINEGENERATETONE) NULL; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LDROP | LDEALLOCATECALL | LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad lpTones when LINETONEMODE_CUSTOM", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_CUSTOM; + lpTapiLineTestInfo->dwNumTones = 1; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpTones = + (LPLINEGENERATETONE) gdwInvalidPointers[n]; + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Verify lpTones ignor when not LINETONEMODE_CUSTOM", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_RINGBACK; + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpTones = + (LPLINEGENERATETONE) gdwInvalidPointers[n]; + if (! DoLineGenerateTone(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwToneModes", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwNumTones = 0; + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineGenerateTone, + (LPDWORD) &lpTapiLineTestInfo->dwToneMode, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_TONEMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +// All msgs tests in txline, msgline.c +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_GENERATE msg sent", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_RINGBACK; + lpTapiLineTestInfo->dwDuration = 0; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateTone(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(fTestPassed) + { + AddMessage( + LINE_GENERATE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGENERATETERM_DONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + fMsgSend = FALSE; + } + else + fMsgSend = TRUE; + } + + if(fMsgSend) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify LINE_GENERATE msg filtered when call goes away", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; + lpTapiLineTestInfo->lpwszDeviceClass = wszValidDeviceClass; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; + lpTapiLineTestInfo->lpszDeviceClass = szValidDeviceClass; +#endif + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (2) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (2) * sizeof(HCALL) + 8; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall2; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Let the monitor get the active call handle + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Store the acquired call handle (as hCall1) + GetVarField( + (LPVOID) lpTapiLineTestInfo->lpCallList, + (LPVOID) &lpTapiLineTestInfo->hCall2, + 4, + lpTapiLineTestInfo->lpCallList->dwCallsOffset + ); + + + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_RINGBACK; + lpTapiLineTestInfo->dwDuration = 0; + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateTone(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if( ! DoLineDeallocateCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_GENERATE, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINEGENERATETERM_DONE, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if(WaitForAllMessages()) + fTestPassed = FALSE; + else + fTestPassed = TRUE; + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine2; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + n = ESP_RESULT_RETURNRESULT; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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->dwToneMode = LINETONEMODE_RINGBACK; + lpTapiLineTestInfo->dwDuration = 0; + + if ( ! DoLineGenerateTone(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Error, completionID = %d", dwTestCase + 1, n + ); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + 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_INVALTONE; + info.u.EspResult.dwCompletionType = n; + lpTapiLineTestInfo->lpParams = (LPVOID)&info; + lpTapiLineTestInfo->dwSize = sizeof(info); + + if(! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_RINGBACK; + lpTapiLineTestInfo->dwDuration = 0; + + if ( ! DoLineGenerateTone(lpTapiLineTestInfo, info.u.EspResult.lResult)) + { + 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(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineGenerateTone: 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 lineGenerateTone <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itlho.c b/private/tapi/qa/trapper/itest/tyline/itlho.c new file mode 100644 index 000000000..197b017f3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlho.c @@ -0,0 +1,594 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlho.c + +Abstract: + + This module contains the test functions for lineHandoff + +Author: + + Xiao Ying Ding (XiaoD) 7-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "yline.h" + + +#define DLG_TITLE "Tapi App" + +#define ALL_MEDIAMODES (LINEMEDIAMODE_INTERACTIVEVOICE | \ + LINEMEDIAMODE_AUTOMATEDVOICE | \ + LINEMEDIAMODE_DATAMODEM | \ + LINEMEDIAMODE_G3FAX | \ + LINEMEDIAMODE_TDD | \ + LINEMEDIAMODE_G4FAX | \ + LINEMEDIAMODE_DIGITALDATA | \ + LINEMEDIAMODE_TELETEX | \ + LINEMEDIAMODE_VIDEOTEX | \ + LINEMEDIAMODE_TELEX | \ + LINEMEDIAMODE_MIXED | \ + LINEMEDIAMODE_ADSI | \ + LINEMEDIAMODE_VOICEVIEW | \ + LINEMEDIAMODE_UNKNOWN) + + +// lineHandoff +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineHandoff(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + MSG msg; +#ifdef WUNICODE + WCHAR wszValidAddress[] = L"55555"; +#else + CHAR szValidAddress[] = "55555"; +#endif + LPCALLBACKPARAMS lpCallbackParams; + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineHandoff <<<<<<<<" + ); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hCall values", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hCall_Orig = *(lpTapiLineTestInfo->lphCall); + for (n = 0; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + *(lpTapiLineTestInfo->lphCall) = (HCALL) gdwInvalidHandles[n]; + if (! DoLineHandoff(lpTapiLineTestInfo, LINEERR_INVALCALLHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphCall) = lpTapiLineTestInfo->hCall_Orig; + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszFileName pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszFileName pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_NONE; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + + // lpszFileName = NULL, it not returns INVAILPOINT + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszFileName = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineHandoff(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: FileName not exist", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = (LPWSTR) L"TESTAPP.EXE"; +#else + lpTapiLineTestInfo->lpszFileName = (LPSTR) "TESTAPP.EXE"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + if (! DoLineHandoff(lpTapiLineTestInfo, LINEERR_TARGETNOTFOUND)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: no OWNER privilege for hCall", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + if (! DoLineDrop(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_MONITOR; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + WinExec("testapp.exe", SW_SHOWDEFAULT); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = (LPWSTR) L"TESTAPP.EXE"; +#else + lpTapiLineTestInfo->lpszFileName = (LPSTR) "TESTAPP.EXE"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + + strcpy(szTitle, DLG_TITLE); + + PrepareToAutoDismissWin(TRUE); + + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + if (! DoLineHandoff(lpTapiLineTestInfo, LINEERR_NOTOWNER)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissWin(FALSE); + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest fow dwMediaMode", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszFileName = (LPSTR)NULL; +#endif +// dwAllMediaModes = ALL_MEDIAMODE | LINEMEDIAMODE_UNKNOWN; + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineHandoff, + (LPDWORD) &lpTapiLineTestInfo->dwMediaMode, + LINEERR_INVALMEDIAMODE, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_24, + ALL_MEDIAMODES, + ~dwBitVectorMasks[(int) FIELDSIZE_24], + 0x00000000, + 0x00000000, + TRUE + )) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify dir handoff mediamode ignor", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + WinExec("testapp.exe", SW_SHOWDEFAULT); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = (LPWSTR) L"TESTAPP.EXE"; +#else + lpTapiLineTestInfo->lpszFileName = (LPSTR) "TESTAPP.EXE"; +#endif + lpTapiLineTestInfo->dwMediaMode = 0; + + strcpy(szTitle, DLG_TITLE); + + PrepareToAutoDismissWin(TRUE); + + if (! DoLineHandoff(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + + PrepareToAutoDismissWin(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success, verify 2nd dir handoff mediamode ignor", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = wszValidAddress; +#else + lpTapiLineTestInfo->lpszDestAddress = szValidAddress; +#endif + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = (LPWSTR) L"TESTAPP.EXE"; +#else + lpTapiLineTestInfo->lpszFileName = (LPSTR) "TESTAPP.EXE"; +#endif + lpTapiLineTestInfo->dwMediaMode = 0; + + PrepareToAutoDismissWin(TRUE); + + if (! DoLineHandoff(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + PrepareToAutoDismissWin(FALSE); + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown to isolate the test case + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LCLOSE | LSHUTDOWN + )) + { + TLINE_FAIL(); + } +*/ + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineHandoff: 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 lineHandoff <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itlrp.c b/private/tapi/qa/trapper/itest/tyline/itlrp.c new file mode 100644 index 000000000..fbbf0872f --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlrp.c @@ -0,0 +1,552 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrp.c + +Abstract: + + This module contains the test functions for lineRemoveProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" + + +// lineRemoveProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRemoveProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp; + BOOL fUnimdm; + HWND hwndOwner; + BOOL fRemovedProvider; + BOOL fAddProvider; + DWORD dwNumProviders; +#ifdef WUNICODE + WCHAR wszEspProviderFilename[] = L"esp32.tsp"; + WCHAR wszUnimdmProviderFilename[] = L"unimdm.tsp"; +#else + CHAR szEspProviderFilename[] = "esp32.tsp"; + CHAR szUnimdmProviderFilename[] = "unimdm.tsp"; +#endif + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineRemoveProvider <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineRemoveProvider with initialize"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + + 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; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; + + // hwndOwner can be NULL, so from n=1 + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineRemoveProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = 0", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0; + if (! DoLineRemoveProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = -1", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0xffffffff; + if (! DoLineRemoveProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + if(FindESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(FindUnimdmLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else + { + fEsp = FALSE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + fAddProvider = TRUE; + + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fRemovedProvider = FALSE; + } + else + fRemovedProvider = TRUE; + PrepareToAutoDismissDlg(FALSE); + + } + else + fRemovedProvider = FALSE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + if(fRemovedProvider) + { + if(lpTapiLineTestInfo->lpProviderList->dwNumProviders == + dwNumProviders - 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + " Test lineRemoveProvider with NO initialize"); + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + hwndOwner = lpTapiLineTestInfo->hwndOwner; + + // hwndOwner can be NULL, so from n=1 + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineRemoveProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = 0", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0; + if (! DoLineRemoveProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwPermanentProviderID = -1", dwTestCase + 1 + ); + + + lpTapiLineTestInfo->hwndOwner = hwndOwner; + lpTapiLineTestInfo->dwPermanentProviderID = 0xffffffff; + if (! DoLineRemoveProvider(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1 + ); + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap(BUFSIZE); +// sizeof(LINEPROVIDERLIST)); +// lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + + if(fEsp) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(fUnimdm) + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else + { +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + fAddProvider = TRUE; + + PrepareToAutoDismissDlg(FALSE); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + dwNumProviders = lpTapiLineTestInfo->lpProviderList->dwNumProviders; + + fRemovedProvider = FALSE; + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fRemovedProvider = FALSE; + } + else + fRemovedProvider = TRUE; + PrepareToAutoDismissDlg(FALSE); + + } + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + if(fRemovedProvider) + { + if(lpTapiLineTestInfo->lpProviderList->dwNumProviders == + dwNumProviders - 1) + fTestPassed = TRUE; + else + fTestPassed = FALSE; + } + fTestPassed = ShowTestCase(fTestPassed); + + + FreeTestHeap(); + + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineRemoveProvider: 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 lineRemoveProvider <<<<<<<<" + ); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/tyline/itlta.c b/private/tapi/qa/trapper/itest/tyline/itlta.c new file mode 100644 index 000000000..09406acdb --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itlta.c @@ -0,0 +1,743 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlta.c + +Abstract: + + This module contains the test functions for lineTranslateAddress + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "yline.h" + + +#define ALL_LINETRANSLATEOPTIONS (LINETRANSLATEOPTION_CARDOVERRIDE | \ + LINETRANSLATEOPTION_CANCELCALLWAITING | \ + LINETRANSLATEOPTION_FORCELOCAL | \ + LINETRANSLATEOPTION_FORCELD ) + +#define NUMTOTALSIZES 5 + + +// lineTranslateAddress +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTranslateAddress(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwFixedSize = sizeof(LINETRANSLATEOUTPUT); + DWORD lExpected; + DWORD dwTotalSizes[NUMTOTALSIZES] = { + 0, + (DWORD) dwFixedSize - 1, + 0x70000000, + 0x7FFFFFFF, + 0xFFFFFFFF + }; + + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineTranslateAddress <<<<<<<<" + ); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpTranslateOutput pointers", dwTestCase + 1 + ); + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + sizeof(LPLINETRANSLATEOUTPUT) + ); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = sizeof(LPLINETRANSLATEOUTPUT); + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->lpTranslateOutput = + (LPLINETRANSLATEOUTPUT) gdwInvalidPointers[n]; + if (! DoLineTranslateAddress(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + sizeof(LINETRANSLATEOUTPUT)); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = sizeof(LINETRANSLATEOUTPUT); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case: bad Device ID (dwNumDevs & -1) not tested here for bug postpone"); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad Device ID (dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineTranslateAddress(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + if (! DoLineTranslateAddress(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = + sizeof(LINETRANSLATECAPS) ; + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + // hLineApp = 0 is valid + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + *(lpTapiLineTestInfo->lphLineApp) = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineTranslateAddress(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lphLineApp) = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineTranslateAddress( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineTranslateAddress( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAddressIn pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAddressIn pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + for (n = 0; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAddressIn = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineTranslateAddress(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwTotalSize", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap ( + sizeof(LINETRANSLATEOUTPUT)); + + for (n = 0; n < NUMTOTALSIZES; n++) + { + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = + dwTotalSizes[n]; + if(dwTotalSizes[n] < dwFixedSize) + lExpected = LINEERR_STRUCTURETOOSMALL; + else + lExpected = LINEERR_INVALPOINTER; + TapiLogDetail( + DBUG_SHOW_PASS, + "dwTotalSize = %lx", dwTotalSizes[n]); + if (! DoLineTranslateAddress(lpTapiLineTestInfo, lExpected)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = dwFixedSize; + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCard = -1", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = + sizeof(LINETRANSLATEOUTPUT); + lpTapiLineTestInfo->dwTranslateOptions = + LINETRANSLATEOPTION_CARDOVERRIDE; + lpTapiLineTestInfo->dwCard = 0xffffffff; + + if (! DoLineTranslateAddress( + lpTapiLineTestInfo, + LINEERR_INVALCARD)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Bad dwCard = dwNumCard", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = + sizeof(LINETRANSLATEOUTPUT); + lpTapiLineTestInfo->dwTranslateOptions = + LINETRANSLATEOPTION_CARDOVERRIDE; + + if (! DoLineGetTranslateCaps( + lpTapiLineTestInfo, + TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwCard = lpTapiLineTestInfo->lpTranslateCaps->dwNumCards; + + if (! DoLineTranslateAddress( + lpTapiLineTestInfo, + LINEERR_INVALCARD)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamErrorTest for dwTranslateOptions", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + if(! TestInvalidBitFlags( + lpTapiLineTestInfo, + DoLineTranslateAddress, + (LPDWORD) &lpTapiLineTestInfo->dwTranslateOptions, + LINEERR_INVALPARAM, + FIELDTYPE_NA, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_LINETRANSLATEOPTIONS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, +// 0x00000000, + 0xffffffff, + FALSE + )) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: BitVectorParamValidTest for dwTrnslateOptions", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + + + lpTapiLineTestInfo->dwCard = lpTapiLineTestInfo->lpTranslateCaps->dwNumCards - 1; + if(! TestValidBitFlags( + lpTapiLineTestInfo, + DoLineTranslateAddress, + (LPDWORD) &lpTapiLineTestInfo->dwTranslateOptions, + FIELDTYPE_MUTEX, + FIELDTYPE_MUTEX, + FIELDSIZE_32, + ALL_LINETRANSLATEOPTIONS, + ~dwBitVectorMasks[(int) FIELDSIZE_32], + 0x00000000, + 0x00000000, + FALSE + )) + { + TLINE_FAIL(); + } + + + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Success", dwTestCase + 1); + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + 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(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + + lpTapiLineTestInfo->dwCard = 0; // get from GetTranslateCaps + lpTapiLineTestInfo->dwTranslateOptions = LINETRANSLATEOPTION_CANCELCALLWAITING; + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = BUFSIZE; + + if (! DoLineTranslateAddress(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateOutput->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize, + lpTapiLineTestInfo->lpTranslateOutput->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateOutput->dwCurrentCountry = %lx, dwDestCountry = %lx, dwResults = %lx", + lpTapiLineTestInfo->lpTranslateOutput->dwCurrentCountry, + lpTapiLineTestInfo->lpTranslateOutput->dwDestCountry, + lpTapiLineTestInfo->lpTranslateOutput->dwTranslateResults); + + fTestPassed = ShowTestCase(fTestPassed); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineTranslateAddress: 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 lineTranslateAddress <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/itltd.c b/private/tapi/qa/trapper/itest/tyline/itltd.c new file mode 100644 index 000000000..7478533b4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/itltd.c @@ -0,0 +1,634 @@ + + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itltd.c + +Abstract: + + This module contains the test functions for lineTranslateDialog + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/29/96 added unicode support + +--*/ + + +#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 "yline.h" + + +#define DLG_TITLE "Dialing Properties" + + +// lineTranslateDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTranslateDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; +#ifdef WUNICODE + WCHAR wszValidAddressIn[] = L"+1 (206) 936-4738"; + WCHAR wszValidAddressIn1[] = L"+1 (206) 936-1234"; + WCHAR wszAddressIn1[] = L"+1 (206) 936 4738"; + WCHAR wszAddressIn2[] = L"55555"; +#else + CHAR szValidAddressIn[] = "+1 (206) 936-4738"; + CHAR szValidAddressIn1[] = "+1 (206) 936-1234"; + CHAR szAddressIn1[] = "+1 (206) 936 4738"; + CHAR szAddressIn2[] = "55555"; +#endif + BOOL fTestPassed = TRUE; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing lineTranslateDialog <<<<<<<<" + ); + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid hwndOwner handles", dwTestCase + 1); + + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // hwndOwner can be NULL, so from n=1 + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); + lpTapiLineTestInfo->hwndOwner = (HWND) gdwInvalidHandles[n]; + if (! DoLineTranslateDialog(lpTapiLineTestInfo, LINEERR_INVALPARAM)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case: bad Device ID (dwNumDevs, & -1) not tested here for bug postpone"); + +/* + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad Device ID (dwNumDevs)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = *(lpTapiLineTestInfo->lpdwNumDevs); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + PrepareToAutoDismissDlg(FALSE); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Try bad device id (-1) + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: bad device ID (-1)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID_Orig = lpTapiLineTestInfo->dwDeviceID; + lpTapiLineTestInfo->dwDeviceID = DWMINUSONE; + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineTranslateDialog(lpTapiLineTestInfo, LINEERR_BADDEVICEID)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + PrepareToAutoDismissDlg(FALSE); + + lpTapiLineTestInfo->dwDeviceID = lpTapiLineTestInfo->dwDeviceID_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAddressIn pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAddressIn pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // lpszAddressIn can be NULL + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAddressIn = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineTranslateDialog(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid line app handles", dwTestCase + 1); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn; +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hLineApp_Orig = *lpTapiLineTestInfo->lphLineApp; + for (n = 1; n < NUMINVALIDHANDLES; n++) + { + *lpTapiLineTestInfo->lphLineApp = (HLINEAPP) gdwInvalidHandles[n]; + if (! DoLineTranslateDialog(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + *lpTapiLineTestInfo->lphLineApp = lpTapiLineTestInfo->hLineApp_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version too high + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too high)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *lpTapiLineTestInfo->lpdwAPIVersion = TOOHIGH_APIVERSION; + if (! DoLineTranslateDialog( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Check incompatible API Version that's too low + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: incompatible API version (too low)", dwTestCase + 1); + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPIVersion_Orig = + *lpTapiLineTestInfo->lpdwAPIVersion; + *(lpTapiLineTestInfo->lpdwAPIVersion) = TOOLOW_APIVERSION; + if (! DoLineTranslateDialog( + lpTapiLineTestInfo, + LINEERR_INCOMPATIBLEAPIVERSION)) + { + TLINE_FAIL(); + } + fTestPassed = ShowTestCase(fTestPassed); + + *(lpTapiLineTestInfo->lpdwAPIVersion) = + lpTapiLineTestInfo->dwAPIVersion_Orig; + + // Shutdown to isolate the test case + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpwszAddressIn pointers", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: invalid lpszAddressIn pointers", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + // lpszAddressIn can be NULL + for (n = 1; n < NUMINVALIDPOINTERS; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "n= %ld", n); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = + (LPWSTR) gdwInvalidPointers[n]; +#else + lpTapiLineTestInfo->lpszAddressIn = + (LPSTR) gdwInvalidPointers[n]; +#endif + if (! DoLineTranslateDialog(lpTapiLineTestInfo, LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + } + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test valid lpwszAddressIn ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test valid lpszAddressIn ", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn; +#endif + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test valid lpwszAddressIn ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test valid lpszAddressIn ", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszValidAddressIn1; +#else + lpTapiLineTestInfo->lpszAddressIn = szValidAddressIn1; +#endif + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test bad lpwszAddressIn ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test bad lpszAddressIn ", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszAddressIn1; +#else + lpTapiLineTestInfo->lpszAddressIn = szAddressIn1; +#endif + + strcpy(szTitle, DLG_TITLE); + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test bad lpwszAddressIn ", dwTestCase + 1 + ); +#else + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Test bad lpszAddressIn ", dwTestCase + 1 + ); +#endif + + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX| LNEGOTIATEAPIVERSION + )) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = wszAddressIn2; +#else + lpTapiLineTestInfo->lpszAddressIn = szAddressIn2; +#endif + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + fTestPassed = ShowTestCase(fTestPassed); + + + // Shutdown + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ lineTranslateDialog: 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 lineTranslateDialog <<<<<<<<" + ); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/test1.xls b/private/tapi/qa/trapper/itest/tyline/test1.xls new file mode 100644 index 000000000..63596f8aa Binary files /dev/null and b/private/tapi/qa/trapper/itest/tyline/test1.xls differ diff --git a/private/tapi/qa/trapper/itest/tyline/test2.xls b/private/tapi/qa/trapper/itest/tyline/test2.xls new file mode 100644 index 000000000..f6fa517de Binary files /dev/null and b/private/tapi/qa/trapper/itest/tyline/test2.xls differ diff --git a/private/tapi/qa/trapper/itest/tyline/tyline.def b/private/tapi/qa/trapper/itest/tyline/tyline.def new file mode 100644 index 000000000..63a23ee1d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/tyline.def @@ -0,0 +1,23 @@ +LIBRARY tyline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 diff --git a/private/tapi/qa/trapper/itest/tyline/tyline.inc b/private/tapi/qa/trapper/itest/tyline/tyline.inc new file mode 100644 index 000000000..f54e3ea21 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/tyline.inc @@ -0,0 +1,69 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=tyline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLDEF= ..\tyline.def +DLLBASE=0x65000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + + +USE_CRTDLL=1 + +SOURCES= ..\yline.c \ + ..\itlap.c \ + ..\itlcp.c \ + ..\itlgpl.c \ + ..\itlrp.c \ + ..\itlgdt.c \ + ..\itlgc.c \ + ..\itlgtc.c \ + ..\itlta.c \ + ..\itltd.c \ + ..\itlho.c \ + ..\itlgi.c \ + ..\itlgtn.c \ + ..\uline.c \ + ..\yline.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=TYLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/tyline/tylinea/makefile b/private/tapi/qa/trapper/itest/tyline/tylinea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/tylinea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tyline/tylinea/sources b/private/tapi/qa/trapper/itest/tyline/tylinea/sources new file mode 100644 index 000000000..2c78fc8e5 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/tylinea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tyline.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/tyline/tylinew/makefile b/private/tapi/qa/trapper/itest/tyline/tylinew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/tylinew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/tyline/tylinew/sources b/private/tapi/qa/trapper/itest/tyline/tylinew/sources new file mode 100644 index 000000000..03d911561 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/tylinew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\tyline.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/tyline/uline.c b/private/tapi/qa/trapper/itest/tyline/uline.c new file mode 100644 index 000000000..f256f7228 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/uline.c @@ -0,0 +1,254 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "yline.h" + +#define DLG_TITLE "Dialing Properties" + +char szApiName[12][48] = + { + "lineAddProvider", + "lineConfigProvider", + "lineGenerateDigits", + "lineGenerateTone", + "lineGetCountry", + "lineGetIcon", + "lineGetProviderList", + "lineGetTranslateCaps", + "lineRemoveProvider", + "lineTranslateAddress", + "lineTranslateDialog", + "lineHandoff" + }; + + +BOOL TestLineUninitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + lpTapiLineTestInfo->hwndOwner = (HWND)NULL; + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; + lpTapiLineTestInfo->lpwszProviderFilename = L"esp32.tsp"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + lpTapiLineTestInfo->lpszProviderFilename = "esp32.tsp"; +#endif + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 12; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: +/* + if (! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + break; + + case 1: + /* + lpTapiLineTestInfo->dwPermanentProviderID = 2; + if (! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + */ + break; + + case 2: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 4: + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = BIGBUFSIZE; + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 5: + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 6: + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + sizeof(LINEPROVIDERLIST)); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 7: + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 8: +/* + if (! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + break; + + case 9: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + lpTapiLineTestInfo->dwCard = 0; // get from GetTranslateCaps + lpTapiLineTestInfo->dwTranslateOptions = LINETRANSLATEOPTION_CANCELCALLWAITING; + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + sizeof(LINETRANSLATEOUTPUT)); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = sizeof(LINETRANSLATEOUTPUT); + if (! DoLineTranslateAddress(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 10: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + break; + + case 11: + if (! DoLineHandoff(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/tyline/yline.c b/private/tapi/qa/trapper/itest/tyline/yline.c new file mode 100644 index 000000000..6916978f1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/yline.c @@ -0,0 +1,316 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + yline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 26-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "yline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghTYLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +TYLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghTYLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineUninitialize(TRUE, TRUE)); +} + + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigProvider(TRUE, FALSE)); +} + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineGetProviderList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineGenerateDigits(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineGetCountry(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineGetTranslateCaps(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineTranslateAddress(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineTranslateDialog(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineGetIcon(TRUE, FALSE)); +} + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineGenerateTone(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineAddProvider(TRUE, FALSE)); +} + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineRemoveProvider(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineHandoff(TRUE, FALSE)); +} + + diff --git a/private/tapi/qa/trapper/itest/tyline/yline.def b/private/tapi/qa/trapper/itest/tyline/yline.def new file mode 100644 index 000000000..63a23ee1d --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/yline.def @@ -0,0 +1,23 @@ +LIBRARY tyline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 diff --git a/private/tapi/qa/trapper/itest/tyline/yline.h b/private/tapi/qa/trapper/itest/tyline/yline.h new file mode 100644 index 000000000..ff2e8cbfb --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/yline.h @@ -0,0 +1,181 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + yline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef YLINE_H +#define YLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + +BOOL +TestLineUninitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineAddProvider( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineConfigProvider( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGenerateDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetCountry( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetProviderList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetTranslateCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRemoveProvider( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineTranslateAddress( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineTranslateDialog( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestLineGetIcon( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGenerateTone( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineHandoff( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +#endif // YLINE_H diff --git a/private/tapi/qa/trapper/itest/tyline/yline.rc b/private/tapi/qa/trapper/itest/tyline/yline.rc new file mode 100644 index 000000000..6b9fbeb74 --- /dev/null +++ b/private/tapi/qa/trapper/itest/tyline/yline.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI TYLine API test Library" +#define VER_INTERNALNAME_STR "tyline.dll" +#define VER_ORIGINALFILENAME_STR "tyline.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/uline/dirs b/private/tapi/qa/trapper/itest/uline/dirs new file mode 100644 index 000000000..05d578aad --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/dirs @@ -0,0 +1,3 @@ +DIRS= ulinea\ + ulinew + diff --git a/private/tapi/qa/trapper/itest/uline/uline.c b/private/tapi/qa/trapper/itest/uline/uline.c new file mode 100644 index 000000000..66e5d5b1b --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/uline.c @@ -0,0 +1,247 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.c + +Abstract: + + This module contains functions for testing line uninitialize. + Collected all uline.c tests from Line/TLine, TCLine, TILine, TLine20, + TSLine, TXLine, and TYLine. Does NOT include uline.c from TPhone tests + because those are just go/no-go tests. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "uline.h" //javedr + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghUlineDll = NULL; //javedr +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +UlineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghUlineDll = hDLL; //javedr + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestTLineUninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestTCLineUninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestTILineUninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestTLine20Uninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestTSLineUninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestTXLineUninit(TRUE, TRUE)); +} + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestTYLineUninit(TRUE, TRUE)); +} + diff --git a/private/tapi/qa/trapper/itest/uline/uline.def b/private/tapi/qa/trapper/itest/uline/uline.def new file mode 100644 index 000000000..325903687 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/uline.def @@ -0,0 +1,17 @@ +LIBRARY uline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 diff --git a/private/tapi/qa/trapper/itest/uline/uline.h b/private/tapi/qa/trapper/itest/uline/uline.h new file mode 100644 index 000000000..d6648d2ed --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/uline.h @@ -0,0 +1,187 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + uline.h + +Abstract: + + This module contains prototypes for testing TAPI line device + uninitialize functions. + +Author: + + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + + Javed Rasool (JavedR) 2-Jul-1996 Created + +--*/ + + +#ifndef ULINE_H +#define ULINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + +/***********************************/ +BOOL +TestTLineUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTCLineUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTILineUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTLine20Uninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTSLineUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTXLineUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTYLineUninit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +/***********************************/ + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ); + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ); + + +#endif // ULINE_H diff --git a/private/tapi/qa/trapper/itest/uline/uline.inc b/private/tapi/qa/trapper/itest/uline/uline.inc new file mode 100644 index 000000000..bf2c9f643 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/uline.inc @@ -0,0 +1,65 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + uline.inc - included by sources file + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=uline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib + + +DLLDEF=..\uline.def +DLLBASE=0x66000000 + +INCLUDES=..;..\..;..\..\..\..\tcore;..\..\.. + +USE_CRTDLL=1 + +SOURCES=..\uline.c \ + ..\utline.c \ + ..\utcline.c \ + ..\utiline.c \ + ..\utline20.c \ + ..\utsline.c \ + ..\utxline.c \ + ..\utyline.c \ + ..\uline.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + + +UMTYPE=windows + +DLLENTRY=UlineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/uline/uline.rc b/private/tapi/qa/trapper/itest/uline/uline.rc new file mode 100644 index 000000000..420f96b38 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/uline.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI Line 2.0 API test Library" +#define VER_INTERNALNAME_STR "tline20.dll" +#define VER_ORIGINALFILENAME_STR "tline20.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/uline/ulinea/makefile b/private/tapi/qa/trapper/itest/uline/ulinea/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/ulinea/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/uline/ulinea/sources b/private/tapi/qa/trapper/itest/uline/ulinea/sources new file mode 100644 index 000000000..264de74df --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/ulinea/sources @@ -0,0 +1,35 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\uline.inc + +TARGETPATH=$(TARGETPATH) + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) diff --git a/private/tapi/qa/trapper/itest/uline/ulinew/makefile b/private/tapi/qa/trapper/itest/uline/ulinew/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/ulinew/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/uline/ulinew/sources b/private/tapi/qa/trapper/itest/uline/ulinew/sources new file mode 100644 index 000000000..a22ff05f9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/ulinew/sources @@ -0,0 +1,36 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +!include ..\uline.inc + + +TARGETPATH=$(TARGETPATH)\unicode + +TARGETLIBS=$(TARGETLIBS) \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + +C_DEFINES=$(C_DEFINES) -DWUNICODE=1 diff --git a/private/tapi/qa/trapper/itest/uline/utcline.c b/private/tapi/qa/trapper/itest/uline/utcline.c new file mode 100644 index 000000000..53d23b04a --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utcline.c @@ -0,0 +1,188 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utcline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "uline.h" //was "cline.h" --- javedr + + +BOOL TestTCLineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + char szApiName[9][48] = + { + "lineAddToConference", + "lineCompleteCall", + "lineGetConfRelatedCalls", + "linePrepareAddToConference", + "lineRedirect", + "lineRemoveFromConference", + "lineSecureCall", + "lineSetupConference", + "lineSwapHold" + }; + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 9; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineAddToConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 1: + if (! DoLineCompleteCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 4: + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 5: + if (! DoLineRemoveFromConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 6: + if (! DoLineSecureCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 7: + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineSwapHold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/uline/utiline.c b/private/tapi/qa/trapper/itest/uline/utiline.c new file mode 100644 index 000000000..e8650715b --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utiline.c @@ -0,0 +1,215 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utiline.c + +Abstract: + + This module contains the uninitialized testcases for all the iline apis + +Author: + + Xiao Ying Ding (XiaoD) 3-4-96 + +Revision History: + + Rama Koneru (a-ramako) 4-Mar-1996 modified this for the ILINE set of APIs + Javed Rasool (JavedR) 3-Jul-1996 Created as independent Uninitialize test. + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "uline.h" //was "iline.h" --- javedr + + +BOOL TestTILineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + char szApiName[12][48] = + { + "lineAccept", + "lineAnswer", + "lineBlindTransfer", + "lineCompleteTransfer", + "lineForward", + "lineReleaseUserUserInfo", + "lineSendUserUserInfo", + "lineNegotiateExtVersion", + "lineSetupTransfer", + "lineHold", + "lineSetAppSpecific", + "lineUnhold" + }; + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = (DWORD) GetCallbackParams(); + + // + // Allocate more than enough to store a call handle + // + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing Uninitialized Cases <<<<<<<<" + ); + + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + // + // Test for UNINITIALIZED if this is the only TAPI app running + // + + if (fStandAlone) + { + for(n = 0; n < 12; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineAnswer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 1: + if (! DoLineAccept(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineBlindTransfer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineCompleteTransfer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + + case 4: + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 5: + if (! DoLineReleaseUserUserInfo(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 6: + if (! DoLineSendUserUserInfo(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 7: + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 9: + if (! DoLineHold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 10: + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 11: + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + + diff --git a/private/tapi/qa/trapper/itest/uline/utline.c b/private/tapi/qa/trapper/itest/uline/utline.c new file mode 100644 index 000000000..ffc05d1e8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utline.c @@ -0,0 +1,387 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created + +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "uline.h" //was "tline.h" --- javedr + +#define DWNUMCALLS 1 + +// Macro for handling unexpected failures during the tests +#define ITLC_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + +BOOL TestTLineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + char szApiName[23][48] = + { + "lineClose", + "lineDeallocateCall", + "lineDial", + "lineDrop", + "lineGetAddressCaps", + "lineGetAddressID", + "lineGetAddressStatus", + "lineGetCallInfo", + "lineGetCallStatus", + "lineGetDevCaps", + "lineGetID", + "lineGetLineDevStatus", + "lineGetNewCalls", + "lineGetNumRings", + "lineGetProviderList", + "lineGetStatusMessage", +// "lineHold", + "lineMakeCall", + "lineNegotiateAPIVersion", + "lineOpen", +// "lineSetAppSpecific", + "lineSetCallPrivilege", + "lineSetNumRings", + "lineSetStatusMessages", + "lineShutdown", +// "lineUnhold" + }; + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 23; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineClose(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 1: + if (! DoLineDeallocateCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 2: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + if (! DoLineDial(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + + case 3: + if (! DoLineDrop(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + + case 4: + lpTapiLineTestInfo->lpLineAddressCaps = (LPLINEADDRESSCAPS) AllocFromTestHeap( + sizeof(LINEADDRESSCAPS)); + lpTapiLineTestInfo->lpLineAddressCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetAddressCaps(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 5: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsAddress = L"55555"; +#else + lpTapiLineTestInfo->lpsAddress = "55555"; +#endif + lpTapiLineTestInfo->dwAddressMode = LINEADDRESSMODE_DIALABLEADDR; + lpTapiLineTestInfo->dwSize = 16; + if (! DoLineGetAddressID(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 6: + lpTapiLineTestInfo->lpLineAddressStatus = (LPLINEADDRESSSTATUS) AllocFromTestHeap ( + sizeof(LINEADDRESSSTATUS)); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = sizeof(LINEADDRESSSTATUS); + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 7: + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap ( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + if (! DoLineGetCallInfo(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 8: + if (! DoLineGetCallStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 9: + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof (LINEDEVCAPS)); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 10: + lpTapiLineTestInfo->lpDeviceID = (LPVARSTRING)AllocFromTestHeap( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + if (! DoLineGetID(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 11: + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap ( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 12: + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap( + sizeof(LINECALLLIST) + (DWNUMCALLS) * sizeof(HCALL) + 8 + ); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST) + + (DWNUMCALLS) * sizeof(HCALL) + 8; + if (! DoLineGetNewCalls(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + FreeTestHeap(); + break; + + case 13: + if (! DoLineGetNumRings(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 14: + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap ( + sizeof(LINEPROVIDERLIST)); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + lpTapiLineTestInfo->dwAPIVersion = 0x20000; + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + ITLC_FAIL(); + } + break; + + case 15: + if (! DoLineGetStatusMessages(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + /* + case 16: + if (! DoLineHold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + */ + + case 16: + if (! DoLineMakeCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + + case 17: + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 18: + if (! DoLineOpen(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + /* + case 20: + if (! DoLineSetAppSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + */ + + case 19: + lpTapiLineTestInfo->dwCallPrivilege = LINECALLPRIVILEGE_OWNER; + if (! DoLineSetCallPrivilege(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 20: + if (! DoLineSetNumRings(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 21: + if (! DoLineSetStatusMessages(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + case 22: + if (! DoLineShutdown(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + ITLC_FAIL(); + } + break; + + /* + case 25: + if (! DoLineUnhold(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + ITLC_FAIL(); + } + break; + */ + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/uline/utline20.c b/private/tapi/qa/trapper/itest/uline/utline20.c new file mode 100644 index 000000000..4970949b1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utline20.c @@ -0,0 +1,433 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utline20.c + +Abstract: + + This module contains the test functions for line20 Uninitialize + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created as independent uninitialize tests + +--*/ + + +#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 "uline.h" //was line20.h --- javedr + +// +// UnInitialize tests +// + +BOOL TestTLine20Uninit(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT i; + BOOL fTestPassed = TRUE; + + dwTestCasePassed = 0; + dwTestCaseFailed = 0; + dwTestCase = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + "\n***************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_PASS, + ">> Test lineUninitialize"); + + // =================================================================== + // =================================================================== + // + // 1. Test Case: lineAgentSpecific uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: lineAgentSpecific uninit test", + dwTestCase+1); + + if (! DoLineAgentSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 2. Test Case: LineGetAgentActivityList uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentActivityList uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) + AllocFromTestHeap(sizeof(LINEAGENTACTIVITYLIST)); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = + sizeof(LINEAGENTACTIVITYLIST); + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 3. Test Case: LineGetAgentCaps uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentCaps uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->lpAgentCaps = (LPLINEAGENTCAPS) AllocFromTestHeap( + sizeof(LINEAGENTCAPS) + ); + lpTapiLineTestInfo->lpAgentCaps->dwTotalSize = sizeof(LINEAGENTCAPS); + lpTapiLineTestInfo->dwAppAPIVersion = TAPI_VERSION2_0; + + if (! DoLineGetAgentCaps(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 4. Test Case: LineGetAgentGroupList uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentGroupList uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = + (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = + sizeof(LINEAGENTGROUPLIST); + + if (! DoLineGetAgentGroupList(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 5. Test Case: LineGetAgentStatus uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetAgentStatus uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpAgentStatus = (LPLINEAGENTSTATUS) AllocFromTestHeap( + sizeof(LINEAGENTSTATUS) + ); + lpTapiLineTestInfo->lpAgentStatus->dwTotalSize = sizeof(LINEAGENTSTATUS); + + if (! DoLineGetAgentStatus(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 6. Test Case: LineGetMessage uninit test(returns INVALAPPHANDLE). + // see raid bug #33177(4/10/1996) + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineGetMessage uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->lpMessage = (LPLINEMESSAGE) AllocFromTestHeap ( + sizeof(LINEMESSAGE)); + + if (! DoLineGetMessage(lpTapiLineTestInfo, LINEERR_INVALAPPHANDLE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 7. Test Case: LineProxyMessage uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineProxyMessage uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwMsg = LINE_AGENTSTATUS; + lpTapiLineTestInfo->dwParam1 = 0; + lpTapiLineTestInfo->dwParam2 = LINEAGENTSTATUS_ACTIVITY; + lpTapiLineTestInfo->dwParam3 = 0; + + if (! DoLineProxyMessage(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 8. Test Case: LineProxyResponse uninit test(returns INVALPOINTER). + // see raid bug #33177(4/10/1996) + // + // =================================================================== + // =================================================================== + +/* + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineProxyResponse uninit test", + dwTestCase+1); + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) AllocFromTestHeap( + sizeof(LINEPROXYREQUEST)); + lpTapiLineTestInfo->lpProxyRequest->dwSize = sizeof(LINEPROXYREQUEST); + if (! DoLineProxyResponse(lpTapiLineTestInfo, + LINEERR_INVALPOINTER)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); +*/ + + // =================================================================== + // =================================================================== + // + // 9. Test Case: LineSetAgentActivity uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineSetAgentActivity uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->dwActivityID = 1; + + if (! DoLineSetAgentActivity(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + // =================================================================== + // =================================================================== + // + // 10. Test Case: LineSetAgentGroup uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineSetAgentGroup uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentGroupList = (LPLINEAGENTGROUPLIST) AllocFromTestHeap( + sizeof(LINEAGENTGROUPLIST) + ); + lpTapiLineTestInfo->lpAgentGroupList->dwTotalSize = sizeof(LINEAGENTGROUPLIST); + + if (! DoLineSetAgentGroup(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // =================================================================== + // =================================================================== + // + // 11. Test Case: LineSetAgentState uninit test. + // + // =================================================================== + // =================================================================== + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + fTestPassed = TRUE; + + TapiLogDetail( + DBUG_SHOW_PASS, + "#### Test Case %ld: LineSetAgentState uninit test", + dwTestCase+1); + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->dwAgentState = LINEAGENTSTATE_READY; + lpTapiLineTestInfo->dwNextAgentState = LINEAGENTSTATE_READY; + + if (! DoLineSetAgentState(lpTapiLineTestInfo, + LINEERR_UNINITIALIZED, + FALSE)) + { + TLINE_FAIL(); + } + + fTestPassed = ShowTestCase(fTestPassed); + + FreeTestHeap(); + + // + // +----------------------edit above this line------------------------- + // + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ LineUnitialize: 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); + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> End testing LineUnitialize <<<<<<<<"); + + if(dwTestCaseFailed > 0) + fTestPassed = FALSE; + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/uline/utsline.c b/private/tapi/qa/trapper/itest/uline/utsline.c new file mode 100644 index 000000000..16614f7ba --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utsline.c @@ -0,0 +1,277 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utsline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + + Javed Rasool (javedr) 3-Jul-1996 Created + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "uline.h" //was sline.h --- javedr + + +BOOL TestTSLineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + char szApiName[15][48] = + { + "lineGetAppPriority", + "lineGatherDigits", + "lineMonitorDigits", + "lineMonitorMedia", + "lineMonitorTones", + "linePark", + "lineSetAppPriority", + "linePickup", + "lineUncompleteCall", + "lineSetCurrentLocation", + "lineSetCallData", + "lineSetCallQualityOfService", + "lineSetCallTreatment", + "lineSetLineDevStatus", + "lineUnpark" + }; + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 15; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_PASS, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case 1: + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineMonitorDigits(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineMonitorMedia(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 4: + if (! DoLineMonitorTones(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 5: + lpTapiLineTestInfo->dwParkMode = LINEPARKMODE_DIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDirAddress = "55555"; +#endif + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_UNICODE; +#else + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; +#endif + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case 6: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + break; + + case 7: + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineUncompleteCall(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 9: + lpTapiLineTestInfo->dwLocation = 1; + if (! DoLineSetCurrentLocation(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 10: + if (! DoLineSetCallData(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 11: + if (! DoLineSetCallQualityOfService(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 12: + if (! DoLineSetCallTreatment(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 13: + if (! DoLineSetLineDevStatus(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 14: + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hCall1; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + +// FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/uline/utxline.c b/private/tapi/qa/trapper/itest/uline/utxline.c new file mode 100644 index 000000000..4dd61cf27 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utxline.c @@ -0,0 +1,242 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utxline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "uline.h" //was xline.h --- javedr + + +BOOL TestTXLineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + char szApiName[13][48] = + { + "lineConfigDialog", + "lineConfigDialogEdit", + "lineDevSpecific", + "lineDevSpecificFeature", + "lineGetDevConfig", + "lineGetRequest", + "lineRegisterRequestRecipient", + "lineSetCallParams", + "lineSetDevConfig", + "lineSetMediaControl", + "lineSetMediaMode", + "lineSetTerminal", + "lineSetTollList" + }; + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + lpTapiLineTestInfo->hwndOwner = (HWND)NULL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 13; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: + if (! DoLineConfigDialog(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 1: + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 2: + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 4: + if (! DoLineGetDevConfig(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 5: + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + if (! DoLineGetRequest(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 6: + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 7: + if (! DoLineSetCallParams(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 8: + if (! DoLineSetDevConfig(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 9: + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 10: + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_INTERACTIVEVOICE; + if (! DoLineSetMediaMode(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 11: + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_DISPLAY; + if (! DoLineSetTerminal(lpTapiLineTestInfo, LINEERR_UNINITIALIZED, TRUE)) + { + TLINE_FAIL(); + } + break; + + case 12: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"+1 (206) 936-4738"; +#else + lpTapiLineTestInfo->lpszAddressIn = "+1 (206) 936-4738"; +#endif + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_ADD; + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/uline/utyline.c b/private/tapi/qa/trapper/itest/uline/utyline.c new file mode 100644 index 000000000..feef8a344 --- /dev/null +++ b/private/tapi/qa/trapper/itest/uline/utyline.c @@ -0,0 +1,255 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + utyline.c + +Abstract: + + This module contains the test functions for all apis uninitialize test + +Author: + + Xiao Ying Ding (XiaoD) 3-5-96 + +Revision History: + + Javed Rasool (JavedR) 3-Jul-1996 Created + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "ttest.h" +#include "doline.h" +#include "uline.h" //was yline.h --- javedr + +#define DLG_TITLE "Dialing Properties" + + +BOOL TestTYLineUninit(BOOL fQuietMode, BOOL fStandAlone) +{ + char szApiName[12][48] = + { + "lineAddProvider", + "lineConfigProvider", + "lineGenerateDigits", + "lineGenerateTone", + "lineGetCountry", + "lineGetIcon", + "lineGetProviderList", + "lineGetTranslateCaps", + "lineRemoveProvider", + "lineTranslateAddress", + "lineTranslateDialog", + "lineHandoff" + }; + LPTAPILINETESTINFO lpTapiLineTestInfo; + LPCALLBACKPARAMS lpCallbackParams; + BOOL fTestPassed = TRUE; + INT n; + + InitTestNumber(); + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + lpTapiLineTestInfo->dwCallbackInstance = + (DWORD) GetCallbackParams(); + + + // Allocate more than enough to store a call handle + + + TapiLogDetail( + DBUG_SHOW_PASS, + ">>>>>>>> Begin testing line uninitialize <<<<<<<<" + ); + + lpTapiLineTestInfo->hwndOwner = (HWND)NULL; + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; + lpTapiLineTestInfo->lpwszProviderFilename = L"esp32.tsp"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + lpTapiLineTestInfo->lpszProviderFilename = "esp32.tsp"; +#endif + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + // Test for UNINITIALIZED if this is the only TAPI app running + if (fStandAlone) + { + for(n = 0; n< 12; n++) + { + strcpy(lpTapiLineTestInfo->szTestFunc, szApiName[n]); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + ">> Test Case %ld: Uninitialized %s", + dwTestCase + 1, szApiName[n]); + + switch (n) + { + case 0: +/* + if (! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + break; + + case 1: + /* + lpTapiLineTestInfo->dwPermanentProviderID = 2; + if (! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + */ + break; + + case 2: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 3: + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 4: + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = BIGBUFSIZE; + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 5: + if (! DoLineGetIcon(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + case 6: + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + sizeof(LINEPROVIDERLIST)); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 7: + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 8: +/* + if (! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } +*/ + break; + + case 9: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + lpTapiLineTestInfo->dwCard = 0; // get from GetTranslateCaps + lpTapiLineTestInfo->dwTranslateOptions = LINETRANSLATEOPTION_CANCELCALLWAITING; + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + sizeof(LINETRANSLATEOUTPUT)); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = sizeof(LINETRANSLATEOUTPUT); + if (! DoLineTranslateAddress(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + break; + + case 10: +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + break; + + case 11: + if (! DoLineHandoff(lpTapiLineTestInfo, LINEERR_UNINITIALIZED)) + { + TLINE_FAIL(); + } + break; + + } + + fTestPassed = ShowTestCase(fTestPassed); + } + + } + + + FreeTestHeap(); + + TapiLogDetail( + DBUG_SHOW_PASS, + "@@ line Uninitialize: 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 line Uninitialize <<<<<<<<" + ); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/version.rc b/private/tapi/qa/trapper/itest/version.rc new file mode 100644 index 000000000..1223b4073 --- /dev/null +++ b/private/tapi/qa/trapper/itest/version.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI main test Library" +#define VER_INTERNALNAME_STR "ttest.dll" +#define VER_ORIGINALFILENAME_STR "ttest.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/wline/makefile b/private/tapi/qa/trapper/itest/wline/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/wline/readme.txt b/private/tapi/qa/trapper/itest/wline/readme.txt new file mode 100644 index 000000000..80c05081f --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/readme.txt @@ -0,0 +1,64 @@ +UNICODE changes for go/no-go tests have been +completed for the following LINE APIs: + +lineAddProviderW +lineBlindTransferW +lineConfigDialogW +lineConfigDialogEditW +lineForwardW +lineGatherDigitsW +lineGenerateDigitsW +lineGetAppPriorityW +lineGetCountryW +lineGetDevConfigW +lineGetIconW +lineGetIDW +lineGetRequestW +lineGetTranslateCapsW +lineHandoffW +lineInitializeExW +lineParkW +linePickupW +linePrepareAddToConferenceW +lineRedirectW +lineSetAppPriorityW +lineSetDevConfigW +lineSetTollListW +lineSetupConferenceW +lineSetupTransferW +lineTranslateAddressW +lineTranslateDialogW +lineUnparkW +lineGetAgentActivityListW +tapiGetLocationInfoW +tapiRequestMakeCallW +tapiRequestMediaCallW + +These go/no-go UNICODE tests are identical to +the corresponding ASCII go/no-go tests +except that they can handle wide chars. + +The UNICODE go/no-go tests for TLINE APIs have +not been done (as per Xiao's suggestion). + +The addition of the UNICODE modifications will not +affect any of the normal functions. You will still +be able to build normally from the sources tree and +run tests. TRAPPER.INI has been updated to include +the new suite of WLINE tests. To test for this suite +though, you'd have to have a new TCORE.DLL built with +the WUNICODE flag. + +(1) Set the "-DWUNICODE=1" flag in the sources +file in the tcore directory and build the DLL. The +WLINE directory would have the sources file with the +WUNICODE set by default. Build WLINE.DLL. + +NOTE: The flag is WUNICODE and not just UNICODE + +(2) Start Trapper.EXE and test only those functions +in the WLINE set - NOTE: the XLINE/YLINE etc functions +that have UNICODE versions would not work with the new +TCORE.DLL. All other XLINE/YLINE functions that donot +have a W version should work fine. + diff --git a/private/tapi/qa/trapper/itest/wline/sources b/private/tapi/qa/trapper/itest/wline/sources new file mode 100644 index 000000000..3392174cc --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/sources @@ -0,0 +1,89 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=wline +TARGETPATH=$(BASEDIR)\public\sdk\lib\unicode +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x66000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES=wline.c \ +witlcd.c \ +witlcde.c \ +witlfw.c \ +witlgad.c \ +witlgap.c \ +witlgc.c \ +witlgdcf.c \ +witlgdt.c \ +witlgi.c \ +witlgr.c \ +witlgtc.c \ +witlho.c \ +witlie.c \ +witlpak.c \ +witlpatc.c \ +witlpk.c \ +witlrd.c \ +witlsap.c \ +witlsdcf.c \ +witlst.c \ +witlstl.c \ +witlsuc.c \ +witltd.c \ +witlta.c \ +witlupak.c \ +wittrmc.c \ +wittgli.c \ +witlgaal.c \ +witlap.c \ +witlbt.c \ +wittrmec.c \ +version.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 -DWUNICODE=1 + +UMTYPE=windows + +DLLENTRY=WLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/wline/version.rc b/private/tapi/qa/trapper/itest/wline/version.rc new file mode 100644 index 000000000..a2512ceee --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/version.rc @@ -0,0 +1,11 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI Phone API test Library" +#define VER_INTERNALNAME_STR "wline.dll" +#define VER_ORIGINALFILENAME_STR "wline.dll" + +#include "common.ver" + diff --git a/private/tapi/qa/trapper/itest/wline/witlap.c b/private/tapi/qa/trapper/itest/wline/witlap.c new file mode 100644 index 000000000..ffe6591e9 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlap.c @@ -0,0 +1,246 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + witlap.c + +Abstract: + + This module contains the test functions for lineAddProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/21/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" +#define DLG_TITLE "ESP32.TSP" + + + +// lineAddProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAddProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp; + BOOL fUnimdm; +#ifdef WUNICODE + WCHAR wszEspProviderFilename[] = L"esp32.tsp"; + WCHAR wszUnimdmProviderFilename[] = L"unimdm.tsp"; +#else + CHAR szEspProviderFilename[] = "esp32.tsp"; + CHAR szUnimdmProviderFilename[] = "unimdm.tsp"; +#endif + DWORD dwNumProviders; + BOOL fAddProvider; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "Test lineAddProvider"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineAddProvider"); + +/* +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = L"esp32.tsp"; +#else + lpTapiLineTestInfo->lpszProviderFilename = "esp32.tsp"; +#endif +*/ + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + + if(FindESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(FindUnimdmLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + else + { + fEsp = FALSE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + { + fAddProvider = TRUE; + } + + + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + } + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineAddProvider Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineAddProvider Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/wline/witlbt.c b/private/tapi/qa/trapper/itest/wline/witlbt.c new file mode 100644 index 000000000..497539eef --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlbt.c @@ -0,0 +1,189 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + witlbt.c + +Abstract: + + This module contains the test functions for lineBlindTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/21/96 Modified for WUNICODE + +--*/ + + +#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 "wline.h" + + + +// lineBlindTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineBlindTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineBlindTransfer"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +#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(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + lpTapiLineTestInfo->dwCountryCode = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineBlindTransfer for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineBlindTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineBlindTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineBlindTransfer Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineBlindTransfer Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlcd.c b/private/tapi/qa/trapper/itest/wline/witlcd.c new file mode 100644 index 000000000..ac08866a4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlcd.c @@ -0,0 +1,154 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + witlcd.c + +Abstract: + + This module contains the test functions for lineConfigDialog + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + +#define DLG_TITLE_ESP "TUISPI_lineConfigDialog" +#define DLG_TITLE_UNIMDM "Zoom VFX 28.8 Properties" + + +// lineConfigDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineConfigDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + HWND hwndOwner, hwndActive; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test LineConfigDialog"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test LineConfigDialog for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwDeviceID = %lx, lpwszDeviceClass = %ws", + lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpwszDeviceClass); +#else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwDeviceID = %lx, lpszDeviceClass = %s", + lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDeviceClass); +#endif + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialg Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialg Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlcde.c b/private/tapi/qa/trapper/itest/wline/witlcde.c new file mode 100644 index 000000000..90517c753 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlcde.c @@ -0,0 +1,236 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcde.c + +Abstract: + + This module contains the test functions for lineConfigDialogEdit + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + +#define DLG_TITLE_ESP "TUISPI_lineConfigDialogEdit" +#define DLG_TITLE_UNIMDM "Zoom VFX 28.8 Properties" + + +// lineConfigDialogEdit +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineConfigDialogEdit(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 2. Test lineConfigDialogEdit"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwNeededSize = %lx, dwStringSize = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize + ); + + + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\t: lpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineConfigDialogEdit for go/no-go"); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfigIn->dwSize = %lx", + lpTapiLineTestInfo->dwSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfigOut->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize + ); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tDeviceConfigOut->dwTotalSize = %lx, neededsize = %lx", + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize); + + if(lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize ) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = dwSize; + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + } + + + // Can call lineSetDevConfig and then call lineGetDevConfig to verify + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialgEdit Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialgEdit Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlfw.c b/private/tapi/qa/trapper/itest/wline/witlfw.c new file mode 100644 index 000000000..ff91d208c --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlfw.c @@ -0,0 +1,188 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlfw.c + +Abstract: + + This module contains the test functions for lineForward + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineForward +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineForward(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineForward"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + lpTapiLineTestInfo->bAllAddresses = TRUE; + lpTapiLineTestInfo->dwAddressID = 0; + lpTapiLineTestInfo->lpForwardList = (LPLINEFORWARDLIST) AllocFromTestHeap ( + sizeof(LINEFORWARDLIST)); + lpTapiLineTestInfo->lpForwardList->dwTotalSize = sizeof(LINEFORWARDLIST); + lpTapiLineTestInfo->lpForwardList->dwNumEntries = 0; + lpTapiLineTestInfo->dwNumRingsNoAnswer = 3; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineForward for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineForward(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lpLineAddressStatus = (LPLINEADDRESSSTATUS) AllocFromTestHeap ( + sizeof(LINEADDRESSSTATUS)); + lpTapiLineTestInfo->lpLineAddressStatus->dwTotalSize = sizeof(LINEADDRESSSTATUS); + + if (! DoLineGetAddressStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineForward Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineForward Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgaal.c b/private/tapi/qa/trapper/itest/wline/witlgaal.c new file mode 100644 index 000000000..84bd2f837 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgaal.c @@ -0,0 +1,214 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + witlgaal.c + +Abstract: + + This module contains the test functions for lineGetAgentActivityList + +Author: + + Xiao Ying Ding (XiaoD) 23-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineGetAgentActivityList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAgentActivityList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LPDWORD lpRequestBuf; + LONG lret; + LPTAPIMSG lpTapiMsg = NULL; + LPTAPIMSG lpMatch; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAgentActivityList"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList unimodem didn't support"); + return fTestPassed; + } + + + lpTapiLineTestInfo->dwAPIVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwExtLowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwExtHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpdwExtVersion = &lpTapiLineTestInfo->dwExtVersion; + + // Negotiate the API Ext Version + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER | + LINEOPENOPTION_PROXY; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) AllocFromTestHeap ( + sizeof(LINECALLPARAMS) + sizeof(DWORD)); + lpTapiLineTestInfo->lpCallParams->dwTotalSize = + sizeof(LINECALLPARAMS) + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificSize = + sizeof(DWORD); + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset = + sizeof(LINECALLPARAMS); + lpRequestBuf = (LPDWORD) (((LPBYTE)lpTapiLineTestInfo->lpCallParams) + + lpTapiLineTestInfo->lpCallParams->dwDevSpecificOffset); + *lpRequestBuf = LINEPROXYREQUEST_GETAGENTACTIVITYLIST; + + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAddressID = 0; + + lpTapiLineTestInfo->lpAgentActivityList = (LPLINEAGENTACTIVITYLIST) AllocFromTestHeap( + sizeof(LINEAGENTACTIVITYLIST) + ); + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize = sizeof(LINEAGENTACTIVITYLIST); + + if (! DoLineGetAgentActivityList(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpMatch = (LPTAPIMSG) AllocFromTestHeap (sizeof(TAPIMSG)); + + lpMatch->dwMsg = LINE_PROXYREQUEST; + lpMatch->dwParam1 = 0; + lpMatch->dwParam2 = 0; + lpMatch->dwParam3 = 0; + lpMatch->dwFlags = TAPIMSG_DWMSG; + + lret = FindReceivedMsgs(&lpTapiMsg, lpMatch, FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "##lret = %lx", lret); + + if(lret == 1) + { + lpTapiLineTestInfo->lpProxyRequest = (LPLINEPROXYREQUEST) lpTapiMsg->dwParam1; + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwNeededSize = + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwTotalSize; + lpTapiLineTestInfo->lpProxyRequest->GetAgentActivityList.ActivityList.dwNumEntries = 2; + lpTapiLineTestInfo->dwResult = 0; + TapiShowProxyBuffer(lpTapiLineTestInfo->lpProxyRequest); + + if (! DoLineProxyResponse(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + AddMessage (LINE_REPLY, 0, 0, 0, + lpTapiLineTestInfo->dwResult, 0, TAPIMSG_DWMSG | TAPIMSG_DWPARAM2); + WaitForAllMessages(); + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "## dwTotalSize = %lx, dwNeededSize = %lx, dwNumEntries = %lx", + lpTapiLineTestInfo->lpAgentActivityList->dwTotalSize, + lpTapiLineTestInfo->lpAgentActivityList->dwNeededSize, + lpTapiLineTestInfo->lpAgentActivityList->dwNumEntries); + + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetAgentActivityList Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgad.c b/private/tapi/qa/trapper/itest/wline/witlgad.c new file mode 100644 index 000000000..742f6bee6 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgad.c @@ -0,0 +1,203 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgat.c + +Abstract: + + This module contains the test functions for lineGatherDigits + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + +#define PULSESIZE 10 +#define DTMFSIZE 16; + + +// lineGatherDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGatherDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGatherDigits"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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->dwDigitModes = LINEDIGITMODE_PULSE; + dwSize = PULSESIZE; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsDigits = (LPWSTR) AllocFromTestHeap (PULSESIZE*sizeof(WCHAR)); + lpTapiLineTestInfo->lpwszTerminationDigits = L"3"; +#else + lpTapiLineTestInfo->lpsDigits = (LPSTR) AllocFromTestHeap (PULSESIZE); + lpTapiLineTestInfo->lpszTerminationDigits = "3"; +#endif + + lpTapiLineTestInfo->dwNumDigits = 2; + lpTapiLineTestInfo->dwFirstDigitTimeout = 100; + lpTapiLineTestInfo->dwInterDigitTimeout = 1000; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGatherDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + +#ifdef WUNICODE + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwsDigits = %s", + lpTapiLineTestInfo->lpwsDigits); +#else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpsDigits = %s", + lpTapiLineTestInfo->lpsDigits); +#endif + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGatherDigits Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGatherDigits Test Failed"); + + return fTestPassed; +} + + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgap.c b/private/tapi/qa/trapper/itest/wline/witlgap.c new file mode 100644 index 000000000..b94703000 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgap.c @@ -0,0 +1,165 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgap.c + +Abstract: + + This module contains the test functions for lineGetAppPriority + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineGetAppPriority +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetAppPriority(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwPrioritySav; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetAppPriority"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetAppPriority for go/no-go"); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + dwPrioritySav = *lpTapiLineTestInfo->lpdwPriority; + lpTapiLineTestInfo->dwPriority = !dwPrioritySav; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetAppPriority Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetAppPriority Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgc.c b/private/tapi/qa/trapper/itest/wline/witlgc.c new file mode 100644 index 000000000..15fc12830 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgc.c @@ -0,0 +1,155 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgc.c + +Abstract: + + This module contains the test functions for lineGetCountry + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// lineGetCountry +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetCountry(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetCountry"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetCountry for go/no-go"); + + + lpTapiLineTestInfo->dwCountryID = 1; + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = BIGBUFSIZE; + + + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lineCountryList->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize, + lpTapiLineTestInfo->lpLineCountryList->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumCountires = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwNumCountries); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetCountry Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetCountry Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgdcf.c b/private/tapi/qa/trapper/itest/wline/witlgdcf.c new file mode 100644 index 000000000..a22c15291 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgdcf.c @@ -0,0 +1,158 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdcf.c + +Abstract: + + This module contains the test functions for lineGetDevConfig + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineGetDevConfig +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetDevConfig(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 5. Test lineGetDevConfig"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineGetDevConfig for go/no-go"); + + + if (! DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwNeededSize = %lx, dwStringSize = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize); + + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetDevConfig Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetDevConfig Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgdt.c b/private/tapi/qa/trapper/itest/wline/witlgdt.c new file mode 100644 index 000000000..5ad4e7d81 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgdt.c @@ -0,0 +1,189 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdt.c + +Abstract: + + This module contains the test functions for lineGenerateDigits + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// lineGenerateDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGenerateDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGenerateDigits"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGenerateDigits for go/no-go"); + + + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDigits = L"1"; +#else + lpTapiLineTestInfo->lpszDigits = "1"; +#endif + + lpTapiLineTestInfo->dwDuration = 0; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGenerateDigits Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGenerateDigits Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgi.c b/private/tapi/qa/trapper/itest/wline/witlgi.c new file mode 100644 index 000000000..dad3bc644 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgi.c @@ -0,0 +1,146 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgi.c + +Abstract: + + This module contains the test functions for lineGetIcon + +Author: + + Xiao Ying Ding (XiaoD) 11-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + + +// lineGetIcon +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetIcon(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetIcon"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDeviceID = (*lpTapiLineTestInfo->lpdwNumDevs == 0 ? + 0 : lpTapiLineTestInfo->dwNumDevs-1); + + // Negotiate the API Version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetIcon for go/no-go"); + + lpTapiLineTestInfo->lphIcon = &lpTapiLineTestInfo->hIcon; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + if (! DoLineGetIcon(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetIcon Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetIcon Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgr.c b/private/tapi/qa/trapper/itest/wline/witlgr.c new file mode 100644 index 000000000..46b182d42 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgr.c @@ -0,0 +1,179 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgr.c + +Abstract: + + This module contains the test functions for lineGetRequest + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineGetRequest +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetRequest(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LINEREQMAKECALL LineReqMakeCall; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 6. Test lineGetRequest"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + 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->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwsztapiAppName = L"tline test"; + lpTapiLineTestInfo->lpwszDestAddress = (LPWSTR) L"55555"; + lpTapiLineTestInfo->lpwszCalledParty = L""; + lpTapiLineTestInfo->lpwszComment = L""; +#else + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpsztapiAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = ""; + lpTapiLineTestInfo->lpszComment = ""; +#endif + + + if(! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineGetRequest for go/no-go"); + + + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetRequest Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetRequest Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlgtc.c b/private/tapi/qa/trapper/itest/wline/witlgtc.c new file mode 100644 index 000000000..d412ff143 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlgtc.c @@ -0,0 +1,198 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgtc.c + +Abstract: + + This module contains the test functions for lineGetTranslateCaps + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// lineGetTranslateCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetTranslateCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetTranslateCaps"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetTranslateCaps for go/no-go"); + + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize, + lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + + if(lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize > + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize) + { + dwSize = lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize; + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = dwSize; + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + } + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetTranslateCaps Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetTranslateCaps Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlho.c b/private/tapi/qa/trapper/itest/wline/witlho.c new file mode 100644 index 000000000..3829c597b --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlho.c @@ -0,0 +1,227 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlho.c + +Abstract: + + This module contains the test functions for lineHandoff + +Author: + + Xiao Ying Ding (XiaoD) 7-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + +#define DLG_TITLE "Tapi App" + + +// lineHandoff +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineHandoff(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + MSG msg; + LPCALLBACKPARAMS lpCallbackParams; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineHandoff"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +// lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? +// 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + +#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(); + } + +/* + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } +*/ + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineHandoff for go/no-go"); + + WinExec("testapp.exe", SW_SHOWDEFAULT); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszFileName = (LPWSTR) L"TESTAPP.EXE"; +#else + lpTapiLineTestInfo->lpszFileName = (LPSTR) "TESTAPP.EXE"; +#endif + + lpTapiLineTestInfo->dwMediaMode = 0; + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissWin(TRUE); + + if (! DoLineHandoff(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(fTestPassed) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + PrepareToAutoDismissWin(FALSE); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineHandoff Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineHandoff Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlie.c b/private/tapi/qa/trapper/itest/wline/witlie.c new file mode 100644 index 000000000..316554435 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlie.c @@ -0,0 +1,104 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlie.c + +Abstract: + + This module contains the test functions for lineInitializeEx + +Author: + + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "stdlib.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "doline.h" +#include "vars.h" +#include "wline.h" + + + +// lineInitializeEx +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineInitializeEx(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineInitializeEx"); + + // Initialize a line app + lpTapiLineTestInfo->lpdwAPIVersion = &lpTapiLineTestInfo->dwAPIVersion; + lpTapiLineTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiLineTestInfo->lpLineInitializeExParams = + (LPLINEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(LINEINITIALIZEEXPARAMS)); + lpTapiLineTestInfo->lpLineInitializeExParams->dwTotalSize = + sizeof(LINEINITIALIZEEXPARAMS); + lpTapiLineTestInfo->lpLineInitializeExParams->dwOptions = + LINEINITIALIZEEXOPTION_USECOMPLETIONPORT; + + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineInitializeEx Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineInitializeEx Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlpak.c b/private/tapi/qa/trapper/itest/wline/witlpak.c new file mode 100644 index 000000000..2bc4778d7 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlpak.c @@ -0,0 +1,191 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpk.c + +Abstract: + + This module contains the test functions for linePark + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// linePark +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePark(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test linePark"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(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->dwParkMode = LINEPARKMODE_DIRECTED; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDirAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDirAddress = "55555"; +#endif + lpTapiLineTestInfo->lpNonDirAddress = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpNonDirAddress->dwTotalSize = sizeof(VARSTRING); +#ifdef WUNICODE + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_UNICODE; +#else + lpTapiLineTestInfo->lpNonDirAddress->dwStringFormat = STRINGFORMAT_ASCII; +#endif + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePark Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePark Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlpatc.c b/private/tapi/qa/trapper/itest/wline/witlpatc.c new file mode 100644 index 000000000..298ebd103 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlpatc.c @@ -0,0 +1,259 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpatc.c + +Abstract: + + This module contains the test functions for linePrepareAddToConference + +Author: + + Xiao Ying Ding (XiaoD) 15-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// linePrepareAddToConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePrepareAddToConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp, fUnimdm; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test linePrepareAddToConference"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(fEsp) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + if(!fEsp) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### Unimdm does not supported these apis"); + + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + return fTestPassed; + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test linePrepareAddToConference for go/no-go"); + + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(fEsp) + { + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLinePrepareAddToConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + lpTapiLineTestInfo->lphCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + sizeof (LINECALLLIST)); + lpTapiLineTestInfo->lpCallList->dwTotalSize = sizeof(LINECALLLIST); + + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpCallList->dwTotalSize < + lpTapiLineTestInfo->lpCallList->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallList->dwNeededSize; + FreeTestHeap(); + lpTapiLineTestInfo->lpCallList = (LPLINECALLLIST) AllocFromTestHeap ( + dwSize); + lpTapiLineTestInfo->lpCallList->dwTotalSize = dwSize; + if (! DoLineGetConfRelatedCalls(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail ( + DBUG_SHOW_DETAIL, + "### lpCallList->dwCallsNumEntries = %lx, dwCallsOffset = %lx", + lpTapiLineTestInfo->lpCallList->dwCallsNumEntries, + lpTapiLineTestInfo->lpCallList->dwCallsOffset); + +/* + for(n=0; n< (INT) lpTapiLineTestInfo->lpCallList->dwCallsNumEntries; n++) + { + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hCall[%lx] = %lx", + n, ((LPBYTE)lpTapiLineTestInfo->lpCallList)+ + lpTapiLineTestInfo->lpCallList->dwCallsOffset+n*sizeof(HCALL)); + } + */ + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePrepareAddToConference Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePrepareAddToConference Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlpk.c b/private/tapi/qa/trapper/itest/wline/witlpk.c new file mode 100644 index 000000000..42bcd32ad --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlpk.c @@ -0,0 +1,171 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlpk.c + +Abstract: + + This module contains the test functions for linePickup + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// linePickup +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLinePickup(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test linePickup"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwAddressID = 0; + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszGroupID = L"55555"; + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszGroupID = "55555"; + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLinePickup(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePickup Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "linePickup Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlrd.c b/private/tapi/qa/trapper/itest/wline/witlrd.c new file mode 100644 index 000000000..438447bdd --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlrd.c @@ -0,0 +1,193 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrd.c + +Abstract: + + This module contains the test functions for lineRedirect + +Author: + + Xiao Ying Ding (XiaoD) 15-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineRedirect +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRedirect(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineRedirect"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + +#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(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineRedirect for go/no-go"); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"64738"; +#else + lpTapiLineTestInfo->lpszDestAddress = "64738"; +#endif + + lpTapiLineTestInfo->dwCountryCode = 0; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineRedirect(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineRedirect(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRedirect Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRedirect Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlsap.c b/private/tapi/qa/trapper/itest/wline/witlsap.c new file mode 100644 index 000000000..f89ea922e --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlsap.c @@ -0,0 +1,165 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsap.c + +Abstract: + + This module contains the test functions for lineSetAppPriority + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineSetAppPriority +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetAppPriority(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwPrioritySav; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetAppPriority"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetAppPriority for go/no-go"); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"testapp.exe"; +#else + lpTapiLineTestInfo->lpszAppFilename = "testapp.exe"; +#endif + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpExtensionName = (LPVARSTRING) AllocFromTestHeap ( + sizeof(VARSTRING)); + lpTapiLineTestInfo->lpExtensionName->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpdwPriority = &lpTapiLineTestInfo->dwPriority; + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + dwPrioritySav = *lpTapiLineTestInfo->lpdwPriority; + lpTapiLineTestInfo->dwPriority = !dwPrioritySav; + + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if (! DoLineGetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "dwPriority = %lx", + *lpTapiLineTestInfo->lpdwPriority); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetAppPriority Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetAppPriority Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlsdcf.c b/private/tapi/qa/trapper/itest/wline/witlsdcf.c new file mode 100644 index 000000000..e7e595460 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlsdcf.c @@ -0,0 +1,175 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsdcf.c + +Abstract: + + This module contains the test functions for lineSetDevConfig + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineSetDevConfig +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetDevConfig(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 9. Test lineSetDevConfig"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->hwndOwner = (HWND)GetTopWindow(NULL); + lpTapiLineTestInfo->dwDeviceID = (*lpTapiLineTestInfo->lpdwNumDevs == 0 ? + 0 : *lpTapiLineTestInfo->lpdwNumDevs-1); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetDevConfig for go/no-go"); + + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfig = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx", + lpTapiLineTestInfo->dwSize); + + + if (! DoLineSetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx", + lpTapiLineTestInfo->dwSize); + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetDevConfig Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetDevConfig Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlst.c b/private/tapi/qa/trapper/itest/wline/witlst.c new file mode 100644 index 000000000..a38bec2c0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlst.c @@ -0,0 +1,189 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlst.c + +Abstract: + + This module contains the test functions for lineSetupTransfer + +Author: + + Xiao Ying Ding (XiaoD) 7-Feb-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineSetupTransfer +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetupTransfer(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetupTransfer"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + +#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(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetupTransfer for go/no-go"); + + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupTransfer(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetupTransfer Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetupTransfer Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlstl.c b/private/tapi/qa/trapper/itest/wline/witlstl.c new file mode 100644 index 000000000..c4167ef6a --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlstl.c @@ -0,0 +1,151 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlstl.c + +Abstract: + + This module contains the test functions for lineSetTollList + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineSetTollList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetTollList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test lineSetTollList"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test lineSetTollList for go/no-go"); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"+1 (206) 936-4738"; +#else + lpTapiLineTestInfo->lpszAddressIn = "+1 (206) 936-4738"; +#endif + + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_ADD; + + + if (DoLineSetTollList(lpTapiLineTestInfo, LINEERR_INIFILECORRUPT)) + { + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + else if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_REMOVE; + + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetTollList Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetTollList Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlsuc.c b/private/tapi/qa/trapper/itest/wline/witlsuc.c new file mode 100644 index 000000000..8bd1a1664 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlsuc.c @@ -0,0 +1,181 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + witlsuc.c + +Abstract: + + This module contains the test functions for lineSetupConference + +Author: + + Xiao Ying Ding (XiaoD) 15-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// lineSetupConference +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetupConference(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineSetupConference"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineSetupConference for go/no-go"); + + lpTapiLineTestInfo->lphConfCall = &lpTapiLineTestInfo->hConfCall1; + lpTapiLineTestInfo->lphConsultCall = &lpTapiLineTestInfo->hConsultCall1; + lpTapiLineTestInfo->dwNumParties = 8; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetupConference(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else + { + if (! DoLineSetupConference(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### hConfCall = %lx, hConsultCall = %lx", + *lpTapiLineTestInfo->lphConfCall, + *lpTapiLineTestInfo->lphConsultCall); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetupConference Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineSetupConference Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlta.c b/private/tapi/qa/trapper/itest/wline/witlta.c new file mode 100644 index 000000000..8fb7c6277 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlta.c @@ -0,0 +1,179 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + witlta.c + +Abstract: + + This module contains the test functions for lineTranslateAddress + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// lineTranslateAddress +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTranslateAddress(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineTranslateAddress"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineTranslateAddress for go/no-go"); + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + + lpTapiLineTestInfo->dwCard = 0; // get from GetTranslateCaps + lpTapiLineTestInfo->dwTranslateOptions = LINETRANSLATEOPTION_CANCELCALLWAITING; + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = BUFSIZE; + + if (! DoLineTranslateAddress(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateOutput->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize, + lpTapiLineTestInfo->lpTranslateOutput->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateOutput->dwCurrentCountry = %lx, dwDestCountry = %lx, dwResults = %lx", + lpTapiLineTestInfo->lpTranslateOutput->dwCurrentCountry, + lpTapiLineTestInfo->lpTranslateOutput->dwDestCountry, + lpTapiLineTestInfo->lpTranslateOutput->dwTranslateResults); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateAddress Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateAddress Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witltd.c b/private/tapi/qa/trapper/itest/wline/witltd.c new file mode 100644 index 000000000..a644eb997 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witltd.c @@ -0,0 +1,195 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itltd.c + +Abstract: + + This module contains the test functions for lineTranslateDialog + +Author: + + Xiao Ying Ding (XiaoD) 3-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + +#define DLG_TITLE "Dialing Properties" + + + +// lineTranslateDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTranslateDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineTranslateDialog"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineTranslateDialog for go/no-go"); + + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAddressIn = L"55555"; +#else + lpTapiLineTestInfo->lpszAddressIn = "55555"; +#endif + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + + + strcpy(szTitle, DLG_TITLE); + + PrepareToAutoDismissDlg(TRUE); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + + lpTapiLineTestInfo->dwCountryID = 1; + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize, + lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateDialog Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateDialog Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/witlupak.c b/private/tapi/qa/trapper/itest/wline/witlupak.c new file mode 100644 index 000000000..5a7a54c77 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/witlupak.c @@ -0,0 +1,172 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlupak.c + +Abstract: + + This module contains the test functions for lineUnpark + +Author: + + Xiao Ying Ding (XiaoD) 31-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + + +// lineUnpark +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineUnpark(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineUnpark"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineUnpark for go/no-go"); + + + lpTapiLineTestInfo->dwAddressID = 0; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; +#endif + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineUnpark(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineUnpark(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineUnpark Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineUnpark Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/wittgli.c b/private/tapi/qa/trapper/itest/wline/wittgli.c new file mode 100644 index 000000000..5036a182e --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/wittgli.c @@ -0,0 +1,140 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittgli.c + +Abstract: + + This module contains the test functions for tapiGetLocationInfo + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// tapiGetLocationInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiGetLocationInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwCountrySize, dwCitySize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiGetLocationInfo"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiGetLocationInfo for go/no-go"); + + dwCountrySize = 10; + dwCitySize = 10; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszCountryCode = AllocFromTestHeap(dwCountrySize*sizeof(WCHAR)); + lpTapiLineTestInfo->lpwszCityCode = AllocFromTestHeap(dwCitySize*sizeof(WCHAR)); +#else + lpTapiLineTestInfo->lpszCountryCode = AllocFromTestHeap(dwCountrySize); + lpTapiLineTestInfo->lpszCityCode = AllocFromTestHeap(dwCitySize); +#endif + + if (! DoTapiGetLocationInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + +#ifdef WUNICODE + (lpTapiLineTestInfo->lpwszCountryCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCountryCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCountryCode = %ws", + lpTapiLineTestInfo->lpwszCountryCode); + + (lpTapiLineTestInfo->lpwszCityCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCityCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpwszCityCode = %ws", + lpTapiLineTestInfo->lpwszCityCode); +#else + (lpTapiLineTestInfo->lpszCountryCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCountryCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCountryCode = %s", + lpTapiLineTestInfo->lpszCountryCode); + + (lpTapiLineTestInfo->lpszCityCode == NULL) ? + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCityCode = NULL") : + TapiLogDetail( + DBUG_SHOW_DETAIL, + "### lpszCityCode = %s", + lpTapiLineTestInfo->lpszCityCode); +#endif + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiGetLocationInfo Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiGetLocationInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/wittrmc.c b/private/tapi/qa/trapper/itest/wline/wittrmc.c new file mode 100644 index 000000000..3232fba76 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/wittrmc.c @@ -0,0 +1,132 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrmc.c + +Abstract: + + This module contains the test functions for tapiRequestMakeCall + +Author: + + Xiao Ying Ding (XiaoD) 30-Jan-1996 + +Revision History: + + Rama Koneru (a-ramako) 3/26/96 Modified for UNICODE + +--*/ + + +#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 "wline.h" + + + +// tapiRequestMakeCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestMakeCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiRequestMakeCall"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiRequestMakeCall for go/no-go"); + + + lpTapiLineTestInfo->dwMediaMode = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"wline.dll"; +#else + lpTapiLineTestInfo->lpszAppFilename = "wline.dll"; +#endif + lpTapiLineTestInfo->lpExtID = (LPLINEEXTENSIONID) AllocFromTestHeap ( + sizeof(LINEEXTENSIONID)); + lpTapiLineTestInfo->dwPriority = 1; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)"wline.dll"; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)"wline.dll"; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + + + if (! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + fTestPassed = FALSE; + } + + + lpTapiLineTestInfo->dwMediaMode = 0; + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszAppFilename = L"wline.dll"; +#else + lpTapiLineTestInfo->lpszAppFilename = "wline.dll"; +#endif + lpTapiLineTestInfo->dwPriority = 0; + if (! DoLineSetAppPriority(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMakeCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMakeCall Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/wittrmec.c b/private/tapi/qa/trapper/itest/wline/wittrmec.c new file mode 100644 index 000000000..bd3a9a672 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/wittrmec.c @@ -0,0 +1,114 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + ittrmec.c + +Abstract: + + This module contains the test functions for tapiRequestMediaCall + +Author: + + Xiao Ying Ding (XiaoD) 30-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 "wline.h" + + + +// tapiRequestMediaCall +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestTapiRequestMediaCall(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test tapiRequestMediaCall"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test tapiRequestMediaCall for go/no-go"); + + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->wRequestID = 0; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDeviceClass = L"tapi/line"; +#else + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; +#endif + + lpTapiLineTestInfo->lpDeviceID = 0; + lpTapiLineTestInfo->dwSize = 0; + lpTapiLineTestInfo->dwSecure = 0; + +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszDestAddress = L"55555"; + lpTapiLineTestInfo->lpwsztapiAppName = (LPWSTR)NULL; + lpTapiLineTestInfo->lpwszCalledParty = (LPWSTR) L"xxx"; + lpTapiLineTestInfo->lpwszComment = (LPWSTR)NULL; +#else + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->lpsztapiAppName = (LPSTR)NULL; + lpTapiLineTestInfo->lpszCalledParty = (LPSTR)"xxx"; + lpTapiLineTestInfo->lpszComment = (LPSTR)NULL; +#endif + +// lpTapiLineTestInfo->lpszCalledParty = (LPSTR)NULL; + + if (! DoTapiRequestMediaCall(lpTapiLineTestInfo, TAPIERR_REQUESTFAILED)) + { + fTestPassed = FALSE; + } + + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMediaCall Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "tapiRequestMediaCall Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wline/wline.c b/private/tapi/qa/trapper/itest/wline/wline.c new file mode 100644 index 000000000..b7d9440a4 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/wline.c @@ -0,0 +1,508 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + wline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Rama Koneru 3/18/96 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "wline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghWLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +WLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghWLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineAddProvider(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineBlindTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigDialog(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigDialogEdit(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineForward(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineGatherDigits(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAgentActivityList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineGetAppPriority(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineGetCountry(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineGetDevConfig(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineGenerateDigits(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineGetIcon(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineGetRequest(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test14( + HINSTANCE hAppInst + ) +{ + return (TestLineGetTranslateCaps(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test15( + HINSTANCE hAppInst + ) +{ + return (TestLineHandoff(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test16( + HINSTANCE hAppInst + ) +{ + return (TestLineInitializeEx(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test17( + HINSTANCE hAppInst + ) +{ + return (TestLinePark(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test18( + HINSTANCE hAppInst + ) +{ + return (TestLinePrepareAddToConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test19( + HINSTANCE hAppInst + ) +{ + return (TestLinePickup(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test20( + HINSTANCE hAppInst + ) +{ + return (TestLineRedirect(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test21( + HINSTANCE hAppInst + ) +{ + return (TestLineSetAppPriority(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test22( + HINSTANCE hAppInst + ) +{ + return (TestLineSetDevConfig(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test23( + HINSTANCE hAppInst + ) +{ + return (TestLineSetupTransfer(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test24( + HINSTANCE hAppInst + ) +{ + return (TestLineSetTollList(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test25( + HINSTANCE hAppInst + ) +{ + return (TestLineSetupConference(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test26( + HINSTANCE hAppInst + ) +{ + return (TestLineTranslateAddress(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test27( + HINSTANCE hAppInst + ) +{ + return (TestLineTranslateDialog(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test28( + HINSTANCE hAppInst + ) +{ + return (TestLineUnpark(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test29( + HINSTANCE hAppInst + ) +{ + return (TestTapiGetLocationInfo(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test30( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestMakeCall(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test31( + HINSTANCE hAppInst + ) +{ + return (TestTapiRequestMediaCall(TRUE, FALSE)); +} + + + + + + + + + + + + + diff --git a/private/tapi/qa/trapper/itest/wline/wline.def b/private/tapi/qa/trapper/itest/wline/wline.def new file mode 100644 index 000000000..33953ed26 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/wline.def @@ -0,0 +1,41 @@ +LIBRARY wline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 + Test14 + Test15 + Test16 + Test17 + Test18 + Test19 + Test20 + Test21 + Test22 + Test23 + Test24 + Test25 + Test26 + Test27 + Test28 + Test29 + Test30 + Test31 diff --git a/private/tapi/qa/trapper/itest/wline/wline.h b/private/tapi/qa/trapper/itest/wline/wline.h new file mode 100644 index 000000000..1a61187dc --- /dev/null +++ b/private/tapi/qa/trapper/itest/wline/wline.h @@ -0,0 +1,311 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + wline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Rama Koneru 15-Mar-1996 + +Revision History: + +--*/ + + +#ifndef WLINE_H +#define WLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +//CLINE functions (6) + +BOOL +TestLinePrepareAddToConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetupConference( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRedirect( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestTapiGetLocationInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTapiRequestMakeCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestTapiRequestMediaCall( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + + +//ILINE functions (3) + +BOOL +TestLineBlindTransfer( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineForward( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineSetupTransfer( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +//WLINE20 functions (2) + +BOOL +TestLineGetAgentActivityList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineInitializeEx( + BOOL fQuietMode, + BOOL fStandAlone + ); + +//SLINE functions (6) + +BOOL +TestLineGatherDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePark( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineUnpark( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLinePickup( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + + +BOOL +TestLineGetAppPriority( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetAppPriority( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +//XLINE functions (6) + + +BOOL +TestLineConfigDialog( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineConfigDialogEdit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetDevConfig( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetRequest( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetDevConfig( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineSetTollList( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +//YLINE function (8) + + +BOOL +TestLineAddProvider( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGenerateDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetCountry( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetTranslateCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineTranslateDialog( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineGetIcon( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineHandoff( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineTranslateAddress( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +#endif // WLINE_H diff --git a/private/tapi/qa/trapper/itest/wphone/makefile b/private/tapi/qa/trapper/itest/wphone/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/wphone/sources b/private/tapi/qa/trapper/itest/wphone/sources new file mode 100644 index 000000000..f67169f21 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/sources @@ -0,0 +1,66 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=wphone +TARGETPATH=$(BASEDIR)\public\sdk\lib\unicode +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\unicode\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x68000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + +USE_CRTDLL=1 + +SOURCES=wphone.c \ +wtpcd.c \ +wtpgbi.c \ +wtpgdc.c \ +wtpgi.c \ +wtpgid.c \ +wtpgs.c \ +wtpi.c \ +wtpie.c \ +wtpsbi.c \ +version.rc + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 -DWUNICODE=1 + +UMTYPE=windows + +DLLENTRY=WPhoneDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/wphone/wphone.c b/private/tapi/qa/trapper/itest/wphone/wphone.c new file mode 100644 index 000000000..a05a30075 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wphone.c @@ -0,0 +1,266 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wphone.c + +Abstract: + This module contains functions for testing Telephony phone device APIs. + +Author: + Oliver Wallace (OliverW) 1-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Enabled for Unicode + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "wphone.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghWphoneDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +WPhoneDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghWphoneDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + +//Unicode +BOOL +Test1( + HINSTANCE hAppInst + ) +{ + return (TestPhoneConfigDialog(TRUE, TRUE)); +} + +//Unicode +BOOL +Test2( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetButtonInfo(TRUE, TRUE)); +} + +//Unicode +BOOL +Test3( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetDevCaps(TRUE, TRUE)); +} + +//Unicode +BOOL +Test4( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetIcon(TRUE, TRUE)); +} + +//Unicode +BOOL +Test5( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetID(TRUE, TRUE)); +} + +//Unicode +BOOL +Test6( + HINSTANCE hAppInst + ) +{ + return (TestPhoneGetStatus(TRUE, TRUE)); +} + +//Unicode +BOOL +Test7( + HINSTANCE hAppInst + ) +{ + return (TestPhoneInitialize(TRUE, TRUE)); +} + +//Unicode +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestPhoneInitializeEx(TRUE, FALSE)); +} + +//Unicode +BOOL +Test9( + HINSTANCE hAppInst + ) +{ + return (TestPhoneSetButtonInfo(TRUE, TRUE)); +} + +BOOL +ShouldTapiPhoneTestAbort(BOOL fQuiteMode) +{ + return FALSE; +} diff --git a/private/tapi/qa/trapper/itest/wphone/wphone.def b/private/tapi/qa/trapper/itest/wphone/wphone.def new file mode 100644 index 000000000..9ef1e73d1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wphone.def @@ -0,0 +1,19 @@ +LIBRARY wphone + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 diff --git a/private/tapi/qa/trapper/itest/wphone/wphone.h b/private/tapi/qa/trapper/itest/wphone/wphone.h new file mode 100644 index 000000000..947ea740b --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wphone.h @@ -0,0 +1,136 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wphone.h + +Abstract: + This module contains prototypes for testing TAPI phone device functions. + +Author: + Oliver Wallace (OliverW) 01-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for Unicode +--*/ + + +#ifndef TPHONE_H +#define TPHONE_H + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + +// Macro for handling failures +#define TPHONE_FAIL() { \ + if (ShouldTapiPhoneTestAbort(fQuietMode)) \ + { \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp1); \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp2); \ + phoneShutdown(lpTapiPhoneTestInfo->hPhoneApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +ShouldTapiPhoneTestAbort( + BOOL fQuiteMode + ); + +//Unicode +BOOL +TestPhoneConfigDialog( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +//Unicode +BOOL +TestPhoneGetButtonInfo( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +//Unicode +BOOL +TestPhoneGetDevCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + +//Unicode +BOOL +TestPhoneGetIcon( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +//Unicode +BOOL +TestPhoneGetID( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +//Unicode +BOOL +TestPhoneGetStatus( + BOOL fQuiteMode, + BOOL fStandAlong + ); + +//Unicode +BOOL +TestPhoneInitialize( + BOOL fQuietMode, + BOOL fStandAlone + ); + +//Unicode +BOOL +TestPhoneInitializeEx( + BOOL fQuietMode, + BOOL fStandAlone + ); + +//Unicode +BOOL +TestPhoneSetButtonInfo( + BOOL fQuietMode, + BOOL fStandAlone + ); + +#endif // TPHONE_H diff --git a/private/tapi/qa/trapper/itest/wphone/wtpcd.c b/private/tapi/qa/trapper/itest/wphone/wtpcd.c new file mode 100644 index 000000000..f5ede31e1 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpcd.c @@ -0,0 +1,114 @@ + +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpcd.c + +Abstract: + This module contains the test functions for phoneConfigDialog + +Author: + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 28-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + +#define DLG_TITLE_ESP "TUISPI_phoneConfigDialog" + + +// phoneConfigDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneConfigDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test phoneConfigDialog"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // Initialize a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); +// lpTapiPhoneTestInfo->hwndOwner = (HWND) ghTphoneDll; +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; //WUNICODE +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneConfigDialog for go/no-go"); + + strcpy(szTitle, DLG_TITLE_ESP); + PrepareToAutoDismissDlg(TRUE); + if (! DoPhoneConfigDialog(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneConfigDialog Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneConfigDialog Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/wphone/wtpgbi.c b/private/tapi/qa/trapper/itest/wphone/wtpgbi.c new file mode 100644 index 000000000..5d73aca61 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpgbi.c @@ -0,0 +1,156 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpgbi.c + +Abstract: + This module contains the test functions for phoneGetButtonInfo + +Author: + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + +// phoneGetButtonInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetButtonInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetButtonInfo"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetButtonInfo for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->dwButtonLampID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwNeededSize = %lx", + lpTapiPhoneTestInfo->lpButtonInfo->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwButtonMode = %lx", lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode); + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetButtonInfo Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetButtonInfo Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpgdc.c b/private/tapi/qa/trapper/itest/wphone/wtpgdc.c new file mode 100644 index 000000000..449383ccc --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpgdc.c @@ -0,0 +1,133 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpgdc.c + +Abstract: + This module contains the test functions for phoneGetDevCaps + +Author: + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + +// phoneGetDevCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetDevCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetDevCaps"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetDevCaps for go/no-go "); + + + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetDevCaps Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetDevCaps Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpgi.c b/private/tapi/qa/trapper/itest/wphone/wtpgi.c new file mode 100644 index 000000000..1348f5135 --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpgi.c @@ -0,0 +1,143 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpgi.c + +Abstract: + This module contains the test functions for phoneGetIcon + +Author: + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + + +// phoneGetIcon +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetIcon(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetIcon"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; //WUNICODE -- JavedR +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap(sizeof(PHONECAPS)); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetIcon for go/no-go"); + + lpTapiPhoneTestInfo->lphIcon = &lpTapiPhoneTestInfo->hIcon; +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; //WUNICODE -- JavedR +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + + if (! DoPhoneGetIcon(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetIcon Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetIcon Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpgid.c b/private/tapi/qa/trapper/itest/wphone/wtpgid.c new file mode 100644 index 000000000..2f68c8bce --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpgid.c @@ -0,0 +1,148 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpgid.c + +Abstract: + This module contains the test functions for phoneGetID + +Author: + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + + +// phoneGetID +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetID(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetID"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + +#ifdef WUNICODE + lpTapiPhoneTestInfo->lpwszDeviceClass = L"tapi/phone"; //WUNICODE -- JavedR +#else + lpTapiPhoneTestInfo->lpszDeviceClass = "tapi/phone"; +#endif + lpTapiPhoneTestInfo->lpDeviceID = &(lpTapiPhoneTestInfo->DeviceID); + lpTapiPhoneTestInfo->lpDeviceID->dwTotalSize = sizeof(VARSTRING); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetID for go/no-go"); + + if (! DoPhoneGetID(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### passedSize = %lx, dwNeededSize = %lx", + sizeof(lpTapiPhoneTestInfo->DeviceID), lpTapiPhoneTestInfo->lpDeviceID->dwNeededSize); + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetID Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetID Test Failed"); + + return fTestPassed; +} + + + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpgs.c b/private/tapi/qa/trapper/itest/wphone/wtpgs.c new file mode 100644 index 000000000..f04d0386f --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpgs.c @@ -0,0 +1,147 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpgs.c + +Abstract: + This module contains the test functions for phoneGetStatus + +Author: + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + +// phoneGetStatus +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneGetStatus(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneGetStatus"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneGetStatus for go/no-go for OWNER"); + + lpTapiPhoneTestInfo->lpPhoneStatus = (LPPHONESTATUS) AllocFromTestHeap( + sizeof(PHONESTATUS)); + lpTapiPhoneTestInfo->lpPhoneStatus->dwTotalSize = sizeof(PHONESTATUS); + + if (! DoPhoneGetStatus(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + +// TapiShowPhoneStatusFunc(lpTapiPhoneTestInfo->lpPhoneStatus); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpPhoneStatus->dwNeededSize = %lx", lpTapiPhoneTestInfo->lpPhoneStatus->dwNeededSize); + + + + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetStatus Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneGetStatus Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpi.c b/private/tapi/qa/trapper/itest/wphone/wtpi.c new file mode 100644 index 000000000..ebff83f2f --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpi.c @@ -0,0 +1,88 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpi.c + +Abstract: + This module contains the test functions for phoneInitialize + +Author: + Xiao Ying Ding (XiaoD) 5-Feb-1996 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + + +// phoneInitialize +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneInitialize(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneInitialize"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneInitialize for go/no-go "); + + // Initialize a phone app + if(! DoPhoneInitialize (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitialize Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitialize Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpie.c b/private/tapi/qa/trapper/itest/wphone/wtpie.c new file mode 100644 index 000000000..b2c15ebba --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpie.c @@ -0,0 +1,97 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpie.c + +Abstract: + This module contains the test functions for phoneInitializeEx + +Author: + Xiao Ying Ding (XiaoD) 7-March-1996 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + +// phoneInitializeEx +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneInitializeEx(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneInitializeEx"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneInitializeEx for go/no-go "); + + // InitializeEx a phone app + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = + PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitializeEx Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneInitializeEx Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/wphone/wtpsbi.c b/private/tapi/qa/trapper/itest/wphone/wtpsbi.c new file mode 100644 index 000000000..d509bbf1a --- /dev/null +++ b/private/tapi/qa/trapper/itest/wphone/wtpsbi.c @@ -0,0 +1,185 @@ +/*++ +Copyright (c) 1995 Microsoft Corporation + +Module Name: + wtpsbi.c + +Abstract: + This module contains the test functions for phoneSetButtonInfo + +Author: + Xiao Ying Ding (XiaoD) 5-Dec-1995 + +Revision History: + Javed Rasool (JavedR) 22-Mar-1996 Modified for WUNICODE +--*/ + + +#include "windows.h" +#include "malloc.h" +#include "string.h" +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "ttest.h" +#include "dophone.h" +#include "vars.h" +#include "wphone.h" + + + +// phoneSetButtonInfo +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestPhoneSetButtonInfo(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPIPHONETESTINFO lpTapiPhoneTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiPhoneTestInit(); + lpTapiPhoneTestInfo = GetPhoneTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test phoneSetButtonInfo"); + + lpTapiPhoneTestInfo->lpdwAPIVersion = &lpTapiPhoneTestInfo->dwAPIVersion; + lpTapiPhoneTestInfo->dwAPIVersion = TAPI_VERSION2_0; + lpTapiPhoneTestInfo->lpPhoneInitializeExParams = + (LPPHONEINITIALIZEEXPARAMS) AllocFromTestHeap ( + sizeof(PHONEINITIALIZEEXPARAMS)); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwTotalSize = + sizeof(PHONEINITIALIZEEXPARAMS); + lpTapiPhoneTestInfo->lpPhoneInitializeExParams->dwOptions = +// PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT; + PHONEINITIALIZEEXOPTION_USEHIDDENWINDOW; + + // InitializeEx a phone app + if(! DoPhoneInitializeEx (lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Negotiate the API Version + lpTapiPhoneTestInfo->dwDeviceID = (*(lpTapiPhoneTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiPhoneTestInfo->lpdwNumDevs)-1); + lpTapiPhoneTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiPhoneTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoPhoneNegotiateAPIVersion(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Get the phone device capabilities + lpTapiPhoneTestInfo->lpPhoneCaps = (LPPHONECAPS) AllocFromTestHeap( + sizeof(PHONECAPS) + ); + lpTapiPhoneTestInfo->lpPhoneCaps->dwTotalSize = sizeof(PHONECAPS); + if (! DoPhoneGetDevCaps(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + // Open a phone + lpTapiPhoneTestInfo->dwPrivilege = PHONEPRIVILEGE_OWNER; + if (! DoPhoneOpen(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test phoneSetButtonInfo for go/no-go for OWNER"); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### The dwNumButtonLamps = %lx", + lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps); + + + lpTapiPhoneTestInfo->dwButtonLampID = (lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps == 0 ? + 0 : lpTapiPhoneTestInfo->lpPhoneCaps->dwNumButtonLamps-1); +// lpTapiPhoneTestInfo->dwButtonLampID = 0; + lpTapiPhoneTestInfo->lpButtonInfo = (LPPHONEBUTTONINFO) AllocFromTestHeap( + sizeof(PHONEBUTTONINFO) + ); + + // Do set all field in ButtonInfo here + lpTapiPhoneTestInfo->lpButtonInfo->dwTotalSize = sizeof(PHONEBUTTONINFO); + lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode = PHONEBUTTONMODE_CALL; + + if (! DoPhoneSetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS, TRUE)) + { + TPHONE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "fTestPassed = %lx", + fTestPassed); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Call phoneGetButtonInfo for verify"); + + + if (! DoPhoneGetButtonInfo(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwNeededSize = %lx", + lpTapiPhoneTestInfo->lpButtonInfo->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + " #### lpButtonInfo->dwButtonMode = %lx", lpTapiPhoneTestInfo->lpButtonInfo->dwButtonMode); + + + + // Close the phone + if (! DoPhoneClose(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + // Shutdown and end the tests + if (! DoPhoneShutdown(lpTapiPhoneTestInfo, TAPISUCCESS)) + { + TPHONE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetButtonInfo Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## phoneSetButtonInfo Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/xline/itlcd.c b/private/tapi/qa/trapper/itest/xline/itlcd.c new file mode 100644 index 000000000..97d90d9eb --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlcd.c @@ -0,0 +1,144 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcd.c + +Abstract: + + This module contains the test functions for lineConfigDialog + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +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 "xline.h" + +#define DLG_TITLE_ESP "TUISPI_lineConfigDialog" +#define DLG_TITLE_UNIMDM "Zoom VFX 28.8 Properties" + + +// lineConfigDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineConfigDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 1. Test LineConfigDialog"); + + 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; + + // Initialize a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. LineConfigDialog for go/no-go"); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + + PrepareToAutoDismissDlg(TRUE); + if (! DoLineConfigDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwDeviceID = %lx, lpszDeviceClass = %s", + lpTapiLineTestInfo->dwDeviceID, + lpTapiLineTestInfo->lpszDeviceClass); + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialg Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialg Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlcde.c b/private/tapi/qa/trapper/itest/xline/itlcde.c new file mode 100644 index 000000000..1f27506ba --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlcde.c @@ -0,0 +1,230 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcde.c + +Abstract: + + This module contains the test functions for lineConfigDialogEdit + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +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 "xline.h" + +#define DLG_TITLE_ESP "TUISPI_lineConfigDialogEdit" +#define DLG_TITLE_UNIMDM "Zoom VFX 28.8 Properties" + + +// lineConfigDialogEdit +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineConfigDialogEdit(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 2. Test lineConfigDialogEdit"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwNeededSize = %lx, dwStringSize = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize + ); + + + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\t: lpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfigIn = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = sizeof(VARSTRING); + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineConfigDialogEdit for go/no-go"); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfigIn->dwSize = %lx", + lpTapiLineTestInfo->dwSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfigOut->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize + ); + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_ESP); + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + } + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tDeviceConfigOut->dwTotalSize = %lx, neededsize = %lx", + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize); + + if(lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize ) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfigOut->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfigOut = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfigOut->dwTotalSize = dwSize; + + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineConfigDialogEdit(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + } + + + // Can call lineSetDevConfig and then call lineGetDevConfig to verify + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialgEdit Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineConfigDialgEdit Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlds.c b/private/tapi/qa/trapper/itest/xline/itlds.c new file mode 100644 index 000000000..968d945e0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlds.c @@ -0,0 +1,202 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlds.c + +Abstract: + + This module contains the test functions for lineDevSpecific + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineDevSpecific +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineDevSpecific(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + TAPILINETESTDEVSPEC TapiLineTestDevSpec; + BOOL fEsp, fUnimdm; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 3. Test lineDevSpecific"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + + if(fEsp) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(fUnimdm) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwExtVersion = 0; + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwExtVersion = %lx", + *lpTapiLineTestInfo->lpdwExtVersion); + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineDevSpecific for go/no-go"); + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + lpTapiLineTestInfo->dwAddressID = 0; + + + if(fEsp) + { + if (! DoLineDevSpecific(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdm) + { + if (! DoLineDevSpecific(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwSize = %lx", + lpTapiLineTestInfo->dwSize); + + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineDevSpecific Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineDevSpecific Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itldsf.c b/private/tapi/qa/trapper/itest/xline/itldsf.c new file mode 100644 index 000000000..23cb835e2 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itldsf.c @@ -0,0 +1,188 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itpds.c + +Abstract: + + This module contains the test functions for lineDevSpecificFeature + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineDevSpecificFeature +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineDevSpecificFeature(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + TAPILINETESTDEVSPEC TapiLineTestDevSpec; + BOOL fEsp, fUnimdm; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 4. Test lineDevSpecificFeature"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = 0; + lpTapiLineTestInfo->dwExtLowVersion = GOOD_EXTVERSION; + lpTapiLineTestInfo->dwExtHighVersion = GOOD_EXTVERSION; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; + } + else + { + fUnimdm = FALSE; + } + + if(fEsp) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(fUnimdm) + { + if (! DoLineNegotiateExtVersion(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwExtVersion = 0; + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineDevSpecificFeature for go/no-go"); + + lpTapiLineTestInfo->lpParams = (LPVOID)&TapiLineTestDevSpec; + lpTapiLineTestInfo->dwSize = sizeof(TAPILINETESTDEVSPEC); + lpTapiLineTestInfo->dwFeature = PHONEBUTTONFUNCTION_UNKNOWN; + + + if(fEsp) + { + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(fUnimdm) + { + if (! DoLineDevSpecificFeature(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwSize = %lx, dwFeature = %lx", + lpTapiLineTestInfo->dwSize, + lpTapiLineTestInfo->dwFeature); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineDevSpecificFeature Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineDevSpecificFeature Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlgdcf.c b/private/tapi/qa/trapper/itest/xline/itlgdcf.c new file mode 100644 index 000000000..24b7b5377 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlgdcf.c @@ -0,0 +1,159 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdcf.c + +Abstract: + + This module contains the test functions for lineGetDevConfig + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +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 "xline.h" + + + +// lineGetDevConfig +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetDevConfig(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 5. Test lineGetDevConfig"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineGetDevConfig for go/no-go"); + + + if (! DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwNeededSize = %lx, dwStringSize = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize); + + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVARSTRING) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetDevConfig Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetDevConfig Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlgr.c b/private/tapi/qa/trapper/itest/xline/itlgr.c new file mode 100644 index 000000000..706781bc0 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlgr.c @@ -0,0 +1,169 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgr.c + +Abstract: + + This module contains the test functions for lineGetRequest + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +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 "xline.h" + + + +// lineGetRequest +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetRequest(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LINEREQMAKECALL LineReqMakeCall; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 6. Test lineGetRequest"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + 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->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpszAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = ""; + lpTapiLineTestInfo->lpszComment = ""; + + + if(! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) AllocFromTestHeap( + sizeof(LINEREQMAKECALL) + ); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineGetRequest for go/no-go"); + + + if (! DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetRequest Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineGetRequest Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlrrr.c b/private/tapi/qa/trapper/itest/xline/itlrrr.c new file mode 100644 index 000000000..c4f0cae95 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlrrr.c @@ -0,0 +1,187 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrrr.c + +Abstract: + + This module contains the test functions for lineRegisterRequestRecipient + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineRegisterRequestRecipient +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRegisterRequestRecipient(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + LINEREQMAKECALL LineReqMakeCall; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 7. Test lineRegisterRequestRecipient"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->dwRegistrationInstance = 0; + lpTapiLineTestInfo->bEnable = TRUE; + + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->lpszAppName = "tline test"; + lpTapiLineTestInfo->lpszCalledParty = ""; + lpTapiLineTestInfo->lpszComment = ""; + + + if(! DoTapiRequestMakeCall(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwRequestMode = LINEREQUESTMODE_MAKECALL; + lpTapiLineTestInfo->lpRequestBuffer = (LPVOID) &LineReqMakeCall; + + if(!DoLineGetRequest(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(!DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOREQUEST)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->bEnable = FALSE; + + if (! DoLineRegisterRequestRecipient(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(!DoLineGetRequest(lpTapiLineTestInfo, LINEERR_NOTREGISTERED)) + { + TLINE_FAIL(); + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineRegisterRequestRecipient Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineRegisterRequestRecipient Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlscp.c b/private/tapi/qa/trapper/itest/xline/itlscp.c new file mode 100644 index 000000000..4f98d262f --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlscp.c @@ -0,0 +1,257 @@ + + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlscp.c + +Abstract: + + This module contains the test functions for lineSetCallParams + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + +#define MIN_RATE 10 +#define MAX_RATE 1000 + + +// lineSetCallParams +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetCallParams(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 8. Test lineSetCallParams"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +/* + + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwTotalSize = %lx, NeededSize = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize, + lpTapiLineTestInfo->lpLineDevStatus->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwOpenMediaModes = %lx, dwLineFeatures = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwOpenMediaModes, + lpTapiLineTestInfo->lpLineDevStatus->dwLineFeatures); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwRoamMode = %lx, dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwRoamMode, + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); +*/ + + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if( !DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetCallParams for go/no-go"); + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwBearerMode = %lx, dwRate = %lx", + lpTapiLineTestInfo->lpCallInfo->dwBearerMode, + lpTapiLineTestInfo->lpCallInfo->dwRate); + + lpTapiLineTestInfo->dwBearerMode = LINEBEARERMODE_DATA; + lpTapiLineTestInfo->dwMinRate = MIN_RATE; + lpTapiLineTestInfo->dwMaxRate = MAX_RATE; + lpTapiLineTestInfo->lpDialParams = (LPLINEDIALPARAMS) NULL; + + if (! DoLineSetCallParams(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + if(lpTapiLineTestInfo->lpCallInfo->dwTotalSize < + lpTapiLineTestInfo->lpCallInfo->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallInfo->dwNeededSize; + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = dwSize; + } + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwBearerMode = %lx, dwRate = %lx", + lpTapiLineTestInfo->lpCallInfo->dwBearerMode, + lpTapiLineTestInfo->lpCallInfo->dwRate); + } + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetCallParams Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetCallParams Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlsdcf.c b/private/tapi/qa/trapper/itest/xline/itlsdcf.c new file mode 100644 index 000000000..21e813ccb --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlsdcf.c @@ -0,0 +1,176 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsdcf.c + +Abstract: + + This module contains the test functions for lineSetDevConfig + +Author: + + Xiao Ying Ding (XiaoD) 19-Dec-1995 + +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 "xline.h" + + + +// lineSetDevConfig +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetDevConfig(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 9. Test lineSetDevConfig"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->hwndOwner = (HWND)GetTopWindow(NULL); + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + sizeof(VARSTRING) + ); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = sizeof(VARSTRING); + + + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + if(lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize < + lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwNeededSize; + lpTapiLineTestInfo->lpDeviceConfig = (LPVOID) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize = dwSize; + if(!DoLineGetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx, dwStringSize = %lx, dwStringOffset = %lx", + lpTapiLineTestInfo->lpDeviceConfig->dwTotalSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringSize, + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset + ); + } + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetDevConfig for go/no-go"); + + lpTapiLineTestInfo->dwSize = lpTapiLineTestInfo->lpDeviceConfig->dwStringSize; + lpTapiLineTestInfo->lpDeviceConfig = + (LPVOID) ((LPBYTE)lpTapiLineTestInfo->lpDeviceConfig + lpTapiLineTestInfo->lpDeviceConfig->dwStringOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx", + lpTapiLineTestInfo->dwSize); + + + if (! DoLineSetDevConfig(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpDeviceConfig->dwTotalSize = %lx", + lpTapiLineTestInfo->dwSize); + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetDevConfig Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetDevConfig Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlsmc.c b/private/tapi/qa/trapper/itest/xline/itlsmc.c new file mode 100644 index 000000000..eda008e9b --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlsmc.c @@ -0,0 +1,234 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsmc.c + +Abstract: + + This module contains the test functions for lineSetMediaControl + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineSetMediaControl +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetMediaControl(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 13. Test lineSetMediaControl"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +/* + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwTotalSize = %lx, NeededSize = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize, + lpTapiLineTestInfo->lpLineDevStatus->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwOpenMediaModes = %lx, dwLineFeatures = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwOpenMediaModes, + lpTapiLineTestInfo->lpLineDevStatus->dwLineFeatures); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwRoamMode = %lx, dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwRoamMode, + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); +*/ + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams =(LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetMediaControl for go/no-go"); + + lpTapiLineTestInfo->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->lpMCDigitList = (LPLINEMEDIACONTROLDIGIT) AllocFromTestHeap( + sizeof (LINEMEDIACONTROLDIGIT)); + lpTapiLineTestInfo->lpMCDigitList->dwDigit = 0; + lpTapiLineTestInfo->lpMCDigitList->dwDigitModes = LINEDIGITMODE_PULSE; + lpTapiLineTestInfo->lpMCDigitList->dwMediaControl = LINEMEDIACONTROL_RATEUP; + lpTapiLineTestInfo->dwDigitNumEntries = 1; + lpTapiLineTestInfo->lpMCMediaList = (LPLINEMEDIACONTROLMEDIA) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLMEDIA)); + lpTapiLineTestInfo->lpMCMediaList->dwMediaModes = LINEMEDIAMODE_UNKNOWN; + lpTapiLineTestInfo->lpMCMediaList->dwDuration = 10; + lpTapiLineTestInfo->lpMCMediaList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->dwMediaNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList = (LPLINEMEDIACONTROLTONE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLTONE)); + lpTapiLineTestInfo->dwToneNumEntries = 1; + lpTapiLineTestInfo->lpMCToneList->dwAppSpecific = 0; + lpTapiLineTestInfo->lpMCToneList->dwDuration = 10; + lpTapiLineTestInfo->lpMCToneList->dwFrequency1 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency2 = 0; + lpTapiLineTestInfo->lpMCToneList->dwFrequency3 = 0; + lpTapiLineTestInfo->lpMCToneList->dwMediaControl = LINEMEDIACONTROL_NONE; + lpTapiLineTestInfo->lpMCCallStateList = (LPLINEMEDIACONTROLCALLSTATE) AllocFromTestHeap( + sizeof(LINEMEDIACONTROLCALLSTATE)); + lpTapiLineTestInfo->dwCallStateNumEntries = 1; + lpTapiLineTestInfo->lpMCCallStateList->dwCallStates = LINECALLSTATE_IDLE; + lpTapiLineTestInfo->lpMCCallStateList->dwMediaControl = LINEMEDIACONTROL_NONE; + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetMediaControl(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetMediaControl(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetMediaControl Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetMediaControl Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlsmm.c b/private/tapi/qa/trapper/itest/xline/itlsmm.c new file mode 100644 index 000000000..59df46482 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlsmm.c @@ -0,0 +1,201 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlsmm.c + +Abstract: + + This module contains the test functions for lineSetMediaMode + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineSetMediaMode +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetMediaMode(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 10. Test lineSetMediaMode"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR) "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams =(LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tBefore: lpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "lpCallInfo->dwMedialMode = %lx", + lpTapiLineTestInfo->lpCallInfo->dwMediaMode); + + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetMediaMode for go/no-go"); + + lpTapiLineTestInfo->dwMediaMode = LINEMEDIAMODE_INTERACTIVEVOICE; + + + if (! DoLineSetMediaMode(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tAfter: lpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwMedialMode = %lx", + lpTapiLineTestInfo->lpCallInfo->dwMediaMode); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetMediaMode Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetMediaMode Test Failed"); + + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlst.c b/private/tapi/qa/trapper/itest/xline/itlst.c new file mode 100644 index 000000000..37bc8ac37 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlst.c @@ -0,0 +1,256 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlst.c + +Abstract: + + This module contains the test functions for lineSetTerminal + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineSetTerminal +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetTerminal(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 11. Test lineSetTerminal"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpTapiLineTestInfo->hLine = %lx, dwMedisModes = %lx", + *lpTapiLineTestInfo->lphLine, + lpTapiLineTestInfo->dwMediaModes); + +/* + lpTapiLineTestInfo->lpLineDevStatus = (LPLINEDEVSTATUS) AllocFromTestHeap( + sizeof(LINEDEVSTATUS)); + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize = sizeof(LINEDEVSTATUS); + + if (! DoLineGetLineDevStatus(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineDevStatus->dwTotalSize = %lx, NeededSize = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwTotalSize, + lpTapiLineTestInfo->lpLineDevStatus->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwOpenMediaModes = %lx, dwLineFeatures = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwOpenMediaModes, + lpTapiLineTestInfo->lpLineDevStatus->dwLineFeatures); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpLineDevStatus->dwRoamMode = %lx, dwDevStatusFlags = %lx", + lpTapiLineTestInfo->lpLineDevStatus->dwRoamMode, + lpTapiLineTestInfo->lpLineDevStatus->dwDevStatusFlags); + +*/ + + lpTapiLineTestInfo->lpszDestAddress = (LPSTR)"55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams =(LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetTerminal for go/no-go"); + + + lpTapiLineTestInfo->dwAddressID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumAddresses-1); + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_LINE; + lpTapiLineTestInfo->dwTerminalModes = LINETERMMODE_DISPLAY; + lpTapiLineTestInfo->dwTerminalID = (lpTapiLineTestInfo->lpLineDevCaps->dwNumTerminals == 0 ? + 0 : lpTapiLineTestInfo->lpLineDevCaps->dwNumTerminals-1); + lpTapiLineTestInfo->bEnable = TRUE; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetTerminal(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineSetTerminal(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL, TRUE)) + { + TLINE_FAIL(); + } + } + +/* + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + sizeof(LINECALLINFO)); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = sizeof(LINECALLINFO); + + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTotalSize, + lpTapiLineTestInfo->lpCallInfo->dwNeededSize); + + if(lpTapiLineTestInfo->lpCallInfo->dwTotalSize < + lpTapiLineTestInfo->lpCallInfo->dwNeededSize) + { + dwSize = lpTapiLineTestInfo->lpCallInfo->dwNeededSize; + lpTapiLineTestInfo->lpCallInfo = (LPLINECALLINFO) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpCallInfo->dwTotalSize = dwSize; + if (! DoLineGetCallInfo(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tlpCallInfo->dwTerminalModesSize = %lx, Offset = %lx", + lpTapiLineTestInfo->lpCallInfo->dwTerminalModesSize, + lpTapiLineTestInfo->lpCallInfo->dwTerminalModesOffset); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "\tdwTerminalModes = %lx", + (LPBYTE)lpTapiLineTestInfo->lpCallInfo+lpTapiLineTestInfo->lpCallInfo->dwTerminalModesOffset); +*/ + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetTerminal Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetTerminal Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/itlstl.c b/private/tapi/qa/trapper/itest/xline/itlstl.c new file mode 100644 index 000000000..c5601889d --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/itlstl.c @@ -0,0 +1,144 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlstl.c + +Abstract: + + This module contains the test functions for lineSetTollList + +Author: + + Xiao Ying Ding (XiaoD) 20-Dec-1995 + +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 "xline.h" + + + +// lineSetTollList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineSetTollList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## 12. Test lineSetTollList"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "## Test Case 1. lineSetTollList for go/no-go"); + + lpTapiLineTestInfo->lpszAddressIn = "+1 (206) 936-4738"; + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_ADD; + + + if (DoLineSetTollList(lpTapiLineTestInfo, LINEERR_INIFILECORRUPT)) + { + lpTapiLineTestInfo->hwnd = (HWND) GetTopWindow(NULL); + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + + else if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwTollListOption = LINETOLLLISTOPTION_REMOVE; + + if (! DoLineSetTollList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + if(fTestPassed) + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetTollList Test Passed"); + else + TapiLogDetail( + DBUG_SHOW_DETAIL, + "## lineSetTollList Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/xline/makefile b/private/tapi/qa/trapper/itest/xline/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/xline/sources b/private/tapi/qa/trapper/itest/xline/sources new file mode 100644 index 000000000..75dc93e6e --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/sources @@ -0,0 +1,72 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=xline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x64000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES= xline.c \ + itlcd.c \ + itlcde.c \ + itlds.c \ + itldsf.c \ + itlgdcf.c \ + itlgr.c \ + itlrrr.c \ + itlscp.c \ + itlsdcf.c \ + itlsmm.c \ + itlst.c \ + itlstl.c \ + itlsmc.c \ + xline.rc + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=XLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/xline/xline.c b/private/tapi/qa/trapper/itest/xline/xline.c new file mode 100644 index 000000000..1d52c645b --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/xline.c @@ -0,0 +1,316 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + xline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 26-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "xline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghXLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +XLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghXLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigDialog(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigDialogEdit(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineDevSpecific(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineDevSpecificFeature(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineGetDevConfig(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineGetRequest(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineRegisterRequestRecipient(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineSetCallParams(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineSetDevConfig(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineSetMediaControl(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineSetMediaMode(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineSetTerminal(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test13( + HINSTANCE hAppInst + ) +{ + return (TestLineSetTollList(TRUE, FALSE)); +} + + + + diff --git a/private/tapi/qa/trapper/itest/xline/xline.def b/private/tapi/qa/trapper/itest/xline/xline.def new file mode 100644 index 000000000..9dda8eda3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/xline.def @@ -0,0 +1,23 @@ +LIBRARY xline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + Test13 diff --git a/private/tapi/qa/trapper/itest/xline/xline.h b/private/tapi/qa/trapper/itest/xline/xline.h new file mode 100644 index 000000000..21fd15c86 --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/xline.h @@ -0,0 +1,178 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + xline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef XLINE_H +#define XLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineConfigDialog( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineConfigDialogEdit( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDevSpecific( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineDevSpecificFeature( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetDevConfig( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetRequest( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRegisterRequestRecipient( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineSetCallParams( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetDevConfig( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetMediaControl( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetMediaMode( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetTerminal( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineSetTollList( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +#endif // XLINE_H diff --git a/private/tapi/qa/trapper/itest/xline/xline.rc b/private/tapi/qa/trapper/itest/xline/xline.rc new file mode 100644 index 000000000..17992a87e --- /dev/null +++ b/private/tapi/qa/trapper/itest/xline/xline.rc @@ -0,0 +1,12 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI XLine API test Library" +#define VER_INTERNALNAME_STR "xline.dll" +#define VER_ORIGINALFILENAME_STR "xline.dll" + +#include "common.ver" + + diff --git a/private/tapi/qa/trapper/itest/yline/itlap.c b/private/tapi/qa/trapper/itest/yline/itlap.c new file mode 100644 index 000000000..e16afb4d3 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlap.c @@ -0,0 +1,238 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlap.c + +Abstract: + + This module contains the test functions for lineAddProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" +#define DLG_TITLE_ESP "TUISPI_providerConfig" +#define DLG_TITLE_UNIMDM "Modems Properties" +#define DLG_TITLE "ESP32.TSP" + +// lineAddProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineAddProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp; + BOOL fUnimdm; +#ifdef WUNICODE + WCHAR wszEspProviderFilename[] = L"esp32.tsp"; + WCHAR wszUnimdmProviderFilename[] = L"unimdm.tsp"; +#else + CHAR szEspProviderFilename[] = "esp32.tsp"; + CHAR szUnimdmProviderFilename[] = "unimdm.tsp"; +#endif + DWORD dwNumProviders; + BOOL fAddProvider; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "Test lineAddProvider"); + 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; + + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### Before Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineAddProvider"); + + +// lpTapiLineTestInfo->lpszProviderFilename = "esp32.tsp"; + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + + + if(FindESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(FindUnimdmLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + else + { + fEsp = FALSE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + { + fAddProvider = TRUE; + } + + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Add: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + PrepareToAutoDismissDlg(FALSE); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + } + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineAddProvider Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineAddProvider Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/yline/itlcp.c b/private/tapi/qa/trapper/itest/yline/itlcp.c new file mode 100644 index 000000000..9ba9095b8 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlcp.c @@ -0,0 +1,166 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlcp.c + +Abstract: + + This module contains the test functions for lineConfigProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + +#define DLG_TITLE_ESP "TUISPI_providerConfig" +#define DLG_TITLE_UNIMDM "Modems Properties" + + + +// lineConfigProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineConfigProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n=1; + BOOL fTestPassed = TRUE; + MSG msg; + LPLINEPROVIDERENTRY lpProviderEntry; + LPSTR lpszProviderName; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "Test lineConfigProvider"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + if(! DoLineNegotiateAPIVersion (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpProviderEntry = (LPLINEPROVIDERENTRY) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpTapiLineTestInfo->lpProviderList->dwProviderListOffset); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineConfigProvider"); + + + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + for(n = 1; n <= (INT)lpTapiLineTestInfo->lpProviderList->dwNumProviders; n++) + { + lpTapiLineTestInfo->dwPermanentProviderID = lpProviderEntry->dwPermanentProviderID; + lpszProviderName = (LPSTR) (((LPBYTE) lpTapiLineTestInfo->lpProviderList) + + lpProviderEntry->dwProviderFilenameOffset); + if(strstr(lpszProviderName, "unimdm")) + { + strcpy(szTitle, DLG_TITLE_UNIMDM); + PrepareToAutoDismissWin(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + PrepareToAutoDismissWin(FALSE); + } + else if(strstr(lpszProviderName, "esp")) + { + strcpy(szTitle, DLG_TITLE_ESP); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineConfigProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + PrepareToAutoDismissDlg(FALSE); + } + lpProviderEntry++; + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + FreeTestHeap(); + + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineConfigProvider Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineConfigProvider Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/yline/itlgc.c b/private/tapi/qa/trapper/itest/yline/itlgc.c new file mode 100644 index 000000000..ecaa53b12 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlgc.c @@ -0,0 +1,152 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgc.c + +Abstract: + + This module contains the test functions for lineGetCountry + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineGetCountry +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetCountry(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetCountry"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetCountry for go/no-go"); + + + lpTapiLineTestInfo->dwCountryID = 1; + lpTapiLineTestInfo->lpLineCountryList = (LPLINECOUNTRYLIST) AllocFromTestHeap( + BIGBUFSIZE); + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize = BIGBUFSIZE; + + if (! DoLineGetCountry(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lineCountryList->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwTotalSize, + lpTapiLineTestInfo->lpLineCountryList->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwNumCountires = %lx", + lpTapiLineTestInfo->lpLineCountryList->dwNumCountries); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetCountry Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetCountry Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itlgdt.c b/private/tapi/qa/trapper/itest/yline/itlgdt.c new file mode 100644 index 000000000..29bd46385 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlgdt.c @@ -0,0 +1,176 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgdt.c + +Abstract: + + This module contains the test functions for lineGenerateDigits + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineGenerateDigits +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGenerateDigits(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGenerateDigits"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGenerateDigits for go/no-go"); + + + lpTapiLineTestInfo->dwDigitMode = LINEDIGITMODE_PULSE; + lpTapiLineTestInfo->lpszDigits = "1"; + lpTapiLineTestInfo->dwDuration = 0; + + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateDigits(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGenerateDigits Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGenerateDigits Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itlgi.c b/private/tapi/qa/trapper/itest/yline/itlgi.c new file mode 100644 index 000000000..a21afcefd --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlgi.c @@ -0,0 +1,139 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgi.c + +Abstract: + + This module contains the test functions for lineGetIcon + +Author: + + Xiao Ying Ding (XiaoD) 11-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 "yline.h" + + + + + +// lineGetIcon +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetIcon(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetIcon"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDeviceID = (*lpTapiLineTestInfo->lpdwNumDevs == 0 ? + 0 : lpTapiLineTestInfo->dwNumDevs-1); + + // Negotiate the API Version + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetIcon for go/no-go"); + + lpTapiLineTestInfo->lphIcon = &lpTapiLineTestInfo->hIcon; + lpTapiLineTestInfo->lpszDeviceClass = "tapi/line"; + + if (! DoLineGetIcon(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetIcon Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetIcon Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itlgpl.c b/private/tapi/qa/trapper/itest/yline/itlgpl.c new file mode 100644 index 000000000..a7556e999 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlgpl.c @@ -0,0 +1,155 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgpl.c + +Abstract: + + This module contains the test functions for lineGetProviderList + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineGetProviderList +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetProviderList(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetProviderList"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + sizeof(LINEPROVIDERLIST)); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = sizeof(LINEPROVIDERLIST); + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpProviderList->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpProviderList->dwTotalSize, + lpTapiLineTestInfo->lpProviderList->dwNeededSize); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpProviderList->dwNumProviders = %lx, dwProviderListSize = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders, + lpTapiLineTestInfo->lpProviderList->dwProviderListSize); + + + if(lpTapiLineTestInfo->lpProviderList->dwNeededSize > + lpTapiLineTestInfo->lpProviderList->dwTotalSize) + { + dwSize = lpTapiLineTestInfo->lpProviderList->dwNeededSize; + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = dwSize; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpProviderList->dwNumProviders = %lx, dwProviderListSize = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders, + lpTapiLineTestInfo->lpProviderList->dwProviderListSize); + } + + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetProviderList Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetProviderList Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/yline/itlgtc.c b/private/tapi/qa/trapper/itest/yline/itlgtc.c new file mode 100644 index 000000000..2e2b8c918 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlgtc.c @@ -0,0 +1,196 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgtc.c + +Abstract: + + This module contains the test functions for lineGetTranslateCaps + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineGetTranslateCaps +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGetTranslateCaps(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + DWORD dwSize; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGetTranslateCaps"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGetTranslateCaps for go/no-go"); + + + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize, + lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + + if(lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize > + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize) + { + dwSize = lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize; + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + dwSize); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = dwSize; + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + } + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetTranslateCaps Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGetTranslateCaps Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itlgtn.c b/private/tapi/qa/trapper/itest/yline/itlgtn.c new file mode 100644 index 000000000..6137ca212 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlgtn.c @@ -0,0 +1,178 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlgtn.c + +Abstract: + + This module contains the test functions for lineGenerateTone + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineGenerateTone +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineGenerateTone(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineGenerateTone"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwCountryCode = 0; + lpTapiLineTestInfo->lpCallParams = (LPLINECALLPARAMS) NULL; + + if(!DoLineMakeCall(lpTapiLineTestInfo, TAPISUCCESS, TRUE)) + { + TLINE_FAIL(); + } + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineGenerateTone for go/no-go"); + + + lpTapiLineTestInfo->dwToneMode = LINETONEMODE_RINGBACK; + lpTapiLineTestInfo->dwNumTones = 1; + lpTapiLineTestInfo->lpTones = (LPLINEGENERATETONE) AllocFromTestHeap ( + sizeof(LINEGENERATETONE)); + + // Should check LINE_GENERATE message is sent to the app + + if(IsESPLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateTone(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + } + else if(IsUNIMDMLineDevice(lpTapiLineTestInfo)) + { + if (! DoLineGenerateTone(lpTapiLineTestInfo, LINEERR_OPERATIONUNAVAIL)) + { + TLINE_FAIL(); + } + } + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGenerateTone Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineGenerateTone Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itlho.c b/private/tapi/qa/trapper/itest/yline/itlho.c new file mode 100644 index 000000000..57f20b050 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlho.c @@ -0,0 +1,175 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlho.c + +Abstract: + + This module contains the test functions for lineHandoff + +Author: + + Xiao Ying Ding (XiaoD) 7-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 "yline.h" + +#define DLG_TITLE "Tapi App" +#define TESTAPPNAME "TESTAPP.EXE" + + +// lineHandoff +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineHandoff(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + MSG msg; + LPCALLBACKPARAMS lpCallbackParams; + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + lpCallbackParams = GetCallbackParams(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineHandoff"); + + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + + 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->lphCall = &lpTapiLineTestInfo->hCall1; + lpTapiLineTestInfo->lphLine = &lpTapiLineTestInfo->hLine1; + lpTapiLineTestInfo->lpszDestAddress = "55555"; + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + lpTapiLineTestInfo->lpsUserUserInfo = NULL; + lpTapiLineTestInfo->dwSelect = LINECALLSELECT_CALL; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_MONITOR; + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + + if (! DoTapiLineFuncs( + lpTapiLineTestInfo, + LINITIALIZEEX | LNEGOTIATEAPIVERSION | LGETDEVCAPS | LOPEN | + LMAKECALL + )) + { + TLINE_FAIL(); + } + + WinExec("testapp.exe", SW_SHOWDEFAULT); + lpTapiLineTestInfo->lpszFileName = (LPSTR) "TESTAPP.EXE"; + lpTapiLineTestInfo->dwMediaMode = 0; + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineHandoff for go/no-go"); + + strcpy(szTitle, DLG_TITLE); + + PrepareToAutoDismissWin(TRUE); + + if (! DoLineHandoff(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + if(fTestPassed) + { + AddMessage( + LINE_CALLINFO, + (DWORD) lpTapiLineTestInfo->hCall1, + (DWORD) lpCallbackParams, + LINECALLINFOSTATE_NUMOWNERINCR, + 0x00000000, + 0x00000000, + TAPIMSG_DWMSG | TAPIMSG_HDEVCALL | TAPIMSG_DWCALLBACKINST | + TAPIMSG_DWPARAM1 + ); + + if (! WaitForAllMessages()) + { + TLINE_FAIL(); + } + } + while( GetMessage((LPMSG)&msg, (HWND)NULL, 0, 0)) + { + TranslateMessage((LPMSG)&msg); + DispatchMessage ((LPMSG)&msg); + } + + PrepareToAutoDismissWin(FALSE); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineHandoff Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineHandoff Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itlrp.c b/private/tapi/qa/trapper/itest/yline/itlrp.c new file mode 100644 index 000000000..23a459d30 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlrp.c @@ -0,0 +1,230 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlrp.c + +Abstract: + + This module contains the test functions for lineRemoveProvider + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + +#define DLG_TITLE_ADD "TUISPI_providerInstall" +#define DLG_TITLE_REMOVE "TUISPI_providerRemove" + +// lineRemoveProvider +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineRemoveProvider(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + BOOL fEsp; + BOOL fUnimdm; + BOOL fRemovedProvider; + BOOL fAddProvider; +#ifdef WUNICODE + WCHAR wszEspProviderFilename[] = L"esp32.tsp"; + WCHAR wszUnimdmProviderFilename[] = L"unimdm.tsp"; +#else + CHAR szEspProviderFilename[] = "esp32.tsp"; + CHAR szUnimdmProviderFilename[] = "unimdm.tsp"; +#endif + + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "Test lineRemoveProvider"); + + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + +// lpTapiLineTestInfo->lpszProviderFilename = ESP_PROVIDERNAME; + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + lpTapiLineTestInfo->lpdwPermanentProviderID = &lpTapiLineTestInfo->dwPermanentProviderID; + +// strcpy(szTitle, DLG_TITLE_ADD); +// PrepareToAutoDismissDlg(TRUE); + + if(FindESPLineDevice(lpTapiLineTestInfo)) + { + fEsp = TRUE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else if(FindUnimdmLineDevice(lpTapiLineTestInfo)) + { + fEsp = FALSE; + fUnimdm = TRUE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszUnimdmProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szUnimdmProviderFilename; +#endif + } + else + { + fEsp = FALSE; + fUnimdm = FALSE; +#ifdef WUNICODE + lpTapiLineTestInfo->lpwszProviderFilename = wszEspProviderFilename; +#else + lpTapiLineTestInfo->lpszProviderFilename = szEspProviderFilename; +#endif + } + + strcpy(szTitle, DLG_TITLE_ADD); + PrepareToAutoDismissDlg(TRUE); + if(! DoLineAddProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fAddProvider = FALSE; + } + else + fAddProvider = TRUE; + + PrepareToAutoDismissDlg(FALSE); + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### dwPermanentProviderID = %lx", + lpTapiLineTestInfo->dwPermanentProviderID); + + lpTapiLineTestInfo->lpProviderList = (LPLINEPROVIDERLIST) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpProviderList->dwTotalSize = BUFSIZE; + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### lpLineProviderList->dwTotalSize = %lx, dwNeededSize = %lx, dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwTotalSize, + lpTapiLineTestInfo->lpProviderList->dwNeededSize, + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineRemoveProvider"); + + if(fAddProvider) + { + strcpy(szTitle, DLG_TITLE_REMOVE); + PrepareToAutoDismissDlg(TRUE); + + if(! DoLineRemoveProvider(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + fRemovedProvider = FALSE; + } + else + fRemovedProvider = TRUE; + PrepareToAutoDismissDlg(FALSE); + } + else + fRemovedProvider = FALSE; + + + // Verify by call lineGetProviderList + + if (! DoLineGetProviderList(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### After Remove: lpLineProviderList->dwNumProviders = %lx", + lpTapiLineTestInfo->lpProviderList->dwNumProviders); + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRemoveProvider Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineRemoveProvider Test Failed"); + + return fTestPassed; +} diff --git a/private/tapi/qa/trapper/itest/yline/itlta.c b/private/tapi/qa/trapper/itest/yline/itlta.c new file mode 100644 index 000000000..3d40e1eed --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itlta.c @@ -0,0 +1,173 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itlta.c + +Abstract: + + This module contains the test functions for lineTranslateAddress + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + + + + +// lineTranslateAddress +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTranslateAddress(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineTranslateAddress"); + + 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; + + // InitializeEx a line app + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineTranslateAddress for go/no-go"); + + + lpTapiLineTestInfo->lpszAddressIn = "55555"; + lpTapiLineTestInfo->dwCard = 0; // get from GetTranslateCaps + lpTapiLineTestInfo->dwTranslateOptions = LINETRANSLATEOPTION_CANCELCALLWAITING; + lpTapiLineTestInfo->lpTranslateOutput = (LPLINETRANSLATEOUTPUT) AllocFromTestHeap( + BUFSIZE); + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize = BUFSIZE; + + if (! DoLineTranslateAddress(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateOutput->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateOutput->dwTotalSize, + lpTapiLineTestInfo->lpTranslateOutput->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateOutput->dwCurrentCountry = %lx, dwDestCountry = %lx, dwResults = %lx", + lpTapiLineTestInfo->lpTranslateOutput->dwCurrentCountry, + lpTapiLineTestInfo->lpTranslateOutput->dwDestCountry, + lpTapiLineTestInfo->lpTranslateOutput->dwTranslateResults); + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateAddress Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateAddress Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/itltd.c b/private/tapi/qa/trapper/itest/yline/itltd.c new file mode 100644 index 000000000..b0b08801e --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/itltd.c @@ -0,0 +1,186 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + itltd.c + +Abstract: + + This module contains the test functions for lineTranslateDialog + +Author: + + Xiao Ying Ding (XiaoD) 3-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 "yline.h" + +#define DLG_TITLE "Dialing Properties" + + + +// lineTranslateDialog +// +// The following tests are made: +// +// Tested Notes +// ------------------------------------------------------------------------- +// Go/No-Go test +// +// * = Stand-alone test case +// +// + +BOOL TestLineTranslateDialog(BOOL fQuietMode, BOOL fStandAlone) +{ + LPTAPILINETESTINFO lpTapiLineTestInfo; + INT n; + BOOL fTestPassed = TRUE; + + TapiLineTestInit(); + lpTapiLineTestInfo = GetLineTestInfo(); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "\n*****************************************************************************************"); + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + ">> Test lineTranslateDialog"); + + // InitializeEx a line app + 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; + if(! DoLineInitializeEx (lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + lpTapiLineTestInfo->dwDeviceID = (*(lpTapiLineTestInfo->lpdwNumDevs) == 0 ? + 0 : *(lpTapiLineTestInfo->lpdwNumDevs)-1); + lpTapiLineTestInfo->dwAPILowVersion = LOW_APIVERSION; + lpTapiLineTestInfo->dwAPIHighVersion = HIGH_APIVERSION; + + // Negotiate the API Version + if (! DoLineNegotiateAPIVersion(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + // Get the line device capabilities + lpTapiLineTestInfo->lpLineDevCaps = (LPLINEDEVCAPS) AllocFromTestHeap( + sizeof(LINEDEVCAPS) + ); + lpTapiLineTestInfo->lpLineDevCaps->dwTotalSize = sizeof(LINEDEVCAPS); + if (! DoLineGetDevCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Open a line + lpTapiLineTestInfo->dwMediaModes = LINEMEDIAMODE_DATAMODEM; + lpTapiLineTestInfo->dwPrivileges = LINECALLPRIVILEGE_OWNER; + + if (! DoLineOpen(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "#### Test lineTranslateDialog for go/no-go"); + + + lpTapiLineTestInfo->lpszAddressIn = "55555"; + lpTapiLineTestInfo->hwndOwner = (HWND) GetTopWindow(NULL); + + strcpy(szTitle, DLG_TITLE); + PrepareToAutoDismissDlg(TRUE); + + if (! DoLineTranslateDialog(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + PrepareToAutoDismissDlg(FALSE); + + lpTapiLineTestInfo->dwCountryID = 1; + lpTapiLineTestInfo->lpTranslateCaps = (LPLINETRANSLATECAPS) AllocFromTestHeap( + sizeof(LINETRANSLATECAPS)); + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize = sizeof(LINETRANSLATECAPS); + + + if (! DoLineGetTranslateCaps(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwTotalSize = %lx, dwNeededSize = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwTotalSize, + lpTapiLineTestInfo->lpTranslateCaps->dwNeededSize); + + + TapiLogDetail( + DBUG_SHOW_DETAIL, + "#### LineTranslateCaps->dwNumLocations = %lx, dwCurrentLocationID = %lx, dwnumCards = %lx", + lpTapiLineTestInfo->lpTranslateCaps->dwNumLocations, + lpTapiLineTestInfo->lpTranslateCaps->dwCurrentLocationID, + lpTapiLineTestInfo->lpTranslateCaps->dwNumCards); + + + // Close the line + if (! DoLineClose(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + + // Shutdown and end the tests + if (! DoLineShutdown(lpTapiLineTestInfo, TAPISUCCESS)) + { + TLINE_FAIL(); + } + + FreeTestHeap(); + + if(fTestPassed) + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateDialog Test Passed"); + else + OutputTAPIDebugInfo( + DBUG_SHOW_DETAIL, + "lineTranslateDialog Test Failed"); + + return fTestPassed; +} + + diff --git a/private/tapi/qa/trapper/itest/yline/makefile b/private/tapi/qa/trapper/itest/yline/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/itest/yline/sources b/private/tapi/qa/trapper/itest/yline/sources new file mode 100644 index 000000000..e9a23325f --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/sources @@ -0,0 +1,71 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl + +Revision History: + +!ENDIF + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=yline +TARGETPATH=$(BASEDIR)\public\sdk\lib +TARGETTYPE=DYNLINK +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\advapi32.lib \ + $(BASEDIR)\public\sdk\lib\*\user32.lib \ + $(BASEDIR)\public\sdk\lib\*\tcore.lib \ + $(BASEDIR)\public\sdk\lib\*\ttest.lib \ + $(BASEDIR)\public\sdk\lib\*\tapi32.lib + + +DLLBASE=0x65000000 + +INCLUDES=..;.;..\..\..\tcore;..\.. + + +USE_CRTDLL=1 + +SOURCES= yline.c \ + itlap.c \ + itlcp.c \ + itlgpl.c \ + itlrp.c \ + itlgdt.c \ + itlgc.c \ + itlgtc.c \ + itlta.c \ + itltd.c \ + itlho.c \ + itlgi.c \ + itlgtn.c \ + yline.rc + + +C_DEFINES=-DWINVER=0x400 -DTAPI_NT=1 -DTAPI_1_1=1 -DTAPI_1_4=1 -DTAPI_2_0=1 + +UMTYPE=windows + +DLLENTRY=YLineDllMain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF diff --git a/private/tapi/qa/trapper/itest/yline/yline.c b/private/tapi/qa/trapper/itest/yline/yline.c new file mode 100644 index 000000000..f4cd22460 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/yline.c @@ -0,0 +1,303 @@ + +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + yline.c + +Abstract: + + This module contains functions for testing Telephony line device APIs. + +Author: + + Xiao Ying Ding (XiaoD) 26-Dec-1995 + +Revision History: + +--*/ + + +#include +#include "tapi.h" +#include "trapper.h" +#include "doline.h" +#include "dophone.h" +#include "tcore.h" +#include "vars.h" +#include "yline.h" + + +// Put a module usage counter in a shared data section. +// Its value will be used to determine whether or not the ttest dll +// and the tcore dll should be loaded/freed during a process +// attach/detach, respectively. +#pragma data_seg("Shared") + +LONG glModuleUsage = 0; + +#pragma data_seg() + + +// Instruct the linker to make the Shared section readable, +// writable, and shared. +#pragma data_seg(".drectve") + static char szLinkDirectiveShared[] = "-section:Shared,rws"; +#pragma data_seg() + + +// Globals for storing dll handles and the log function pointer +HANDLE ghYLineDll = NULL; +LOGPROC glpfnLogProc = NULL; +CHAR gszTcoreDll[] = "tcore"; +CHAR gszTtestDll[] = "ttest"; + + +BOOL +WINAPI +YLineDllMain( + HANDLE hDLL, + DWORD dwReason, + LPVOID lpReserved + ) +{ + HANDLE hTcoreDll; + HANDLE hTtestDll; + BOOL fFreeOK; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + + // Increment this module's usage count + InterlockedIncrement((PLONG) &glModuleUsage); + + ghYLineDll = hDLL; + + // Load the tcore dll and the ttest dll if this is the + // first process to attach and if the dlls haven't already + // been mapped into this process's address space. + if (glModuleUsage == 1) + { + if (GetModuleHandle(gszTcoreDll) == NULL); + { + hTcoreDll = LoadLibrary(gszTcoreDll); + } + + if (GetModuleHandle(gszTtestDll) == NULL); + { + hTtestDll = LoadLibrary(gszTtestDll); + } + + if (hTcoreDll == NULL || hTtestDll == NULL) + { + return FALSE; + } + } + + break; + + case DLL_THREAD_ATTACH: + + break; + + case DLL_THREAD_DETACH: + + break; + + case DLL_PROCESS_DETACH: + + // Decrement this module's usage count + InterlockedDecrement((PLONG) &glModuleUsage); + + // Free the tcore dll if this is the last process + // to detach and if the core dll is mapped into this + // process's address space. + if (glModuleUsage == 0) + { + if ((hTcoreDll = GetModuleHandle(gszTcoreDll)) != NULL) + { + fFreeOK = FreeLibrary(hTcoreDll); + } + + if ((hTtestDll = GetModuleHandle(gszTtestDll)) != NULL) + { + return ( fFreeOK && (FreeLibrary(hTtestDll)) ); + } + } + + break; + } + + return TRUE; +} + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ) +{ + // Store the log function pointer and pass it to the core dll. + // Return whether or not the core suite init function succeeds. + glpfnLogProc = pfnLog; + return (TcoreSuiteInit(pfnLog)); +} + + +BOOL +WINAPI +SuiteShutdown( + void + ) +{ + return TRUE; +} + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "About the Interface Test Suite", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ) +{ + MessageBox (hwndOwner, "xxx", "Interface Test Suite Config", MB_OK); + + return TRUE; +} + + +BOOL +WINAPI +Test1( + HINSTANCE hAppInst + ) +{ + return (TestLineAddProvider(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test2( + HINSTANCE hAppInst + ) +{ + return (TestLineConfigProvider(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test3( + HINSTANCE hAppInst + ) +{ + return (TestLineGenerateDigits(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test4( + HINSTANCE hAppInst + ) +{ + return (TestLineGetCountry(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test5( + HINSTANCE hAppInst + ) +{ + return (TestLineGetProviderList(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test6( + HINSTANCE hAppInst + ) +{ + return (TestLineGetTranslateCaps(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test7( + HINSTANCE hAppInst + ) +{ + return (TestLineRemoveProvider(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test8( + HINSTANCE hAppInst + ) +{ + return (TestLineTranslateAddress(TRUE, FALSE)); +} + + +BOOL +WINAPI +Test9( + HINSTANCE hAppInst + ) +{ + return (TestLineTranslateDialog(TRUE, FALSE)); +} + + + +BOOL +WINAPI +Test10( + HINSTANCE hAppInst + ) +{ + return (TestLineGetIcon(TRUE, FALSE)); +} + +BOOL +WINAPI +Test11( + HINSTANCE hAppInst + ) +{ + return (TestLineGenerateTone(TRUE, FALSE)); +} + +BOOL +WINAPI +Test12( + HINSTANCE hAppInst + ) +{ + return (TestLineHandoff(TRUE, FALSE)); +} + + diff --git a/private/tapi/qa/trapper/itest/yline/yline.def b/private/tapi/qa/trapper/itest/yline/yline.def new file mode 100644 index 000000000..817b1554f --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/yline.def @@ -0,0 +1,23 @@ +LIBRARY yline + +CODE MOVEABLE DISCARDABLE +DATA READ WRITE PRELOAD MOVEABLE + +EXPORTS + SuiteInit + SuiteShutdown + SuiteAbout + SuiteConfig + Test1 + Test2 + Test3 + Test4 + Test5 + Test6 + Test7 + Test8 + Test9 + Test10 + Test11 + Test12 + diff --git a/private/tapi/qa/trapper/itest/yline/yline.h b/private/tapi/qa/trapper/itest/yline/yline.h new file mode 100644 index 000000000..7bccd0415 --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/yline.h @@ -0,0 +1,175 @@ +/*++ + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + yline.h + +Abstract: + + This module contains prototypes for testing TAPI line device functions. + +Author: + + Xiao Ying Ding (XiaoD) 1-Dec-1995 + +Revision History: + +--*/ + + +#ifndef YLINE_H +#define YLINE_H + + +#include +#include "tapi.h" +#include "trapper.h" +#include "tcore.h" +#include "vars.h" + + + +typedef struct TAPILINETESTDEVSPEC_TAG { + DWORD lResult; + DWORD dwRequestID; + } TAPILINETESTDEVSPEC, FAR * LPTAPILINETESTDEVSPEC; + + +#define LINEADDRESSSTATE_ALL (LINEADDRESSSTATE_OTHER | \ + LINEADDRESSSTATE_DEVSPECIFIC | \ + LINEADDRESSSTATE_INUSEZERO | \ + LINEADDRESSSTATE_INUSEONE | \ + LINEADDRESSSTATE_INUSEMANY | \ + LINEADDRESSSTATE_NUMCALLS | \ + LINEADDRESSSTATE_FORWARD | \ + LINEADDRESSSTATE_TERMINALS | \ + LINEADDRESSSTATE_CAPSCHANGE \ + ) + + +// Macro for handling unexpected failures during the tests +#define TLINE_FAIL() { \ + if (ShouldTapiTestAbort( \ + lpTapiLineTestInfo->szTestFunc, \ + fQuietMode)) \ + { \ + lineShutdown(lpTapiLineTestInfo->hLineApp1); \ + lineShutdown(lpTapiLineTestInfo->hLineApp2); \ + lineShutdown(lpTapiLineTestInfo->hLineApp3); \ + return FALSE; \ + } \ + fTestPassed = FALSE; \ + } + + + + + +BOOL +WINAPI +SuiteInit( + LOGPROC pfnLog + ); + + +BOOL +WINAPI +SuiteShutdown( + void + ); + + +BOOL +WINAPI +SuiteAbout( + HWND hwndOwner + ); + + +BOOL +WINAPI +SuiteConfig( + HWND hwndOwner + ); + + +BOOL +TestLineAddProvider( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineConfigProvider( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGenerateDigits( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetCountry( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetProviderList( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGetTranslateCaps( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineRemoveProvider( + BOOL fQuietMode, + BOOL fStandAloneTest + ); + +BOOL +TestLineTranslateAddress( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineTranslateDialog( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +BOOL +TestLineGetIcon( + BOOL fQuietMode, + BOOL fStandAlone + ); + +BOOL +TestLineGenerateTone( + BOOL fQuietMode, + BOOL fStandAlone + ); + + +BOOL +TestLineHandoff( + BOOL fQuietMode, + BOOL fStandAlone + ); + + + +#endif // YLINE_H diff --git a/private/tapi/qa/trapper/itest/yline/yline.rc b/private/tapi/qa/trapper/itest/yline/yline.rc new file mode 100644 index 000000000..a4b27549f --- /dev/null +++ b/private/tapi/qa/trapper/itest/yline/yline.rc @@ -0,0 +1,13 @@ +#include +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN +#define VER_FILEDESCRIPTION_STR "TAPI YLine API test Library" +#define VER_INTERNALNAME_STR "yline.dll" +#define VER_ORIGINALFILENAME_STR "yline.dll" + +#include "common.ver" + + + diff --git a/private/tapi/qa/trapper/private.h b/private/tapi/qa/trapper/private.h new file mode 100644 index 000000000..8ade1516f --- /dev/null +++ b/private/tapi/qa/trapper/private.h @@ -0,0 +1,116 @@ +/*++ BUILD Version: 0000 // Increment this if a change has global effects + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + private.h + +Abstract: + + This module contains private defs for the trapper (test wrapper) app + +Author: + + Dan Knudson (DanKn) 06-Jun-1995 + +Revision History: + + +Notes: + + +--*/ + +#define TRAPP_LOGLEVEL_PARAMS 11 +#define TRAPP_LOGLEVEL_NOPARAMS 7 +#define TRAPP_LOGLEVEL_NOENTEREXIT 5 +#define TRAPP_LOGLEVEL_PASSONLY 2 + + +#define INIT_MENU_POS 0 +#define HELLO_MENU_POS 2 + +#define IDM_NEWTESTTHREAD 10 +#define IDM_CLOSE 11 +#define IDM_MEMORYSTATUS 12 +#define IDM_LOADTAPI 13 +#define IDM_UNLOADTAPI 14 +#define IDM_EXIT 15 + +#define IDM_START 20 +#define IDM_STOP 21 +#define IDM_KILLTAPISRV 22 +#define IDM_LOGFILE 23 +#define IDM_RUNONCE 24 +#define IDM_RUNFOREVER 25 +#define IDM_STOPONFAILURE 26 +#define IDM_ALLTESTS 27 +#define IDM_NOTESTS 28 +#define IDM_ALLTESTSINSUITE 29 +#define IDM_NOTESTSINSUITE 30 +#define IDM_CONFIGSUITE 31 +#define IDM_ABOUTSUITE 32 +#define IDM_PARAMS 33 +#define IDM_NOPARAMS 34 +#define IDM_NOENTEREXIT 35 +#define IDM_PASSONLY 36 + + +#define IDM_TILE 80 +#define IDM_CASCADE 81 +#define IDM_ARRANGE 82 +#define IDM_CLOSEALL 83 + +#define IDM_USAGE 90 +#define IDM_ABOUT 91 + +#define IDC_LIST1 100 +#define IDC_EDIT1 101 +#define IDC_EDIT2 102 + +#define IDM_FIRSTCHILD 1000 + +#define IDD_DIALOG1 50 + +#define TRAPPER_MSG_KEY 0x95551212 + +#define WM_ADDTEXT (WM_USER + 0x55) +#define WM_TESTTHREADTERMINATED (WM_USER + 0x56) + + +typedef struct _INSTANCE_INFO +{ + HWND hwnd; + + HWND hwndList1; + + HWND hwndList2; + + HWND hwndEdit1; + + HWND hwndEdit2; + + int iNumSuites; + + DWORD dwTextBufTotalSize; + + DWORD dwTextBufUsedSize; + + char *pTextBuf; + + HANDLE hTextBufMutex; + + FILE *hLogFile; + + BOOL bTestInProgress; + + BOOL bStopTest; + + BOOL bStopOnFailure; + + BOOL bRunForever; + + BOOL bLogFile; + +} INSTANCE_INFO, FAR *PINSTANCE_INFO; diff --git a/private/tapi/qa/trapper/readme.txt b/private/tapi/qa/trapper/readme.txt new file mode 100644 index 000000000..d7f2100d2 --- /dev/null +++ b/private/tapi/qa/trapper/readme.txt @@ -0,0 +1,26 @@ +Readme file for running TAPI tests. + +1. Make sure trapper.ini get updated, make sure the path of dll is correct. +2. Testapp.exe is a window application, it used to help test some tapi apis. + After finish test, should manuly to close it. +3. Before run test, run espexe make sure the default values are set correct. + Num Lines ~ 3 + Num Phones ~ 4 + Num Add Per Line ~ 3 + Num Calls Per Add ~8 +4. In trapper, there is a menu item, "Select Log Level". And submenu for select + "With Params" that is print out params. "No Params" that is not print out params + but all others. "No EnterExit" that is not print out ENTER_EXIT info for + all apis. "Pass/Fail" that is print out the Passed/Failed log info only. The + default is With Params, then user can set up to differnt log level. +5. iline.dll doesn't support lineAccept and lineAnswer for Unimodem. It needs + test by manuly. + The steps: + - Run tb20 + - Call lineInitialize, must have two lines and two modems installed + - Call lineOpen at dwDeviceID 0, with NONE priviledge + - Call lineOpen at dwDeviceID 1, with OWNER priviledge + - Call lineMakeCall at dwDeviceID 0, with lpszDestAddress of line2 + - Call lineAccept or lineAnswer, select hCall with OFFERING state + - It should accepted + diff --git a/private/tapi/qa/trapper/trapper.c b/private/tapi/qa/trapper/trapper.c new file mode 100644 index 000000000..e953fd5ce --- /dev/null +++ b/private/tapi/qa/trapper/trapper.c @@ -0,0 +1,1901 @@ +/*++ BUILD Version: 0000 // Increment this if a change has global effects + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + trapper.c + +Abstract: + + This module contains the src for the trapper (test wrapper) app + +Author: + + Dan Knudson (DanKn) 06-Jun-1995 + +Revision History: + + Javed Rasool (JavedR) 01-July 1996 Added IDM_KILLTAPISRV (i.e., menu command to Kill Tapisrv.exe) + Also modifed corresponding files: trapper.rc and private.h + +Notes: + + +--*/ + + +#include +#include +#include +#include +#include +#include +#include "private.h" +#include "trapper.h" + + +#ifdef WIN32 +#define _export +#define __export +#endif + + +char szFrameClass [] = "MdiFrame"; +char szHelloClass [] = "MdiHelloChild"; +HANDLE hInst; +HMENU hMenuInit, hMenuHello; +HMENU hMenuInitWindow, hMenuHelloWindow; +HWND hwndClient, hwndFrame; + +char gszTrapperIni[] = ".\\trapper.ini"; + +int giLogLevel = TRAPP_LOGLEVEL_PARAMS; + +DWORD gdwTlsIndex; + +MEMORYSTATUS gInitialMemoryStatus; + + +BOOL +CALLBACK +FrameWndProc( + HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam + ); + +BOOL +FAR +PASCAL +_export +CloseEnumProc( + HWND hwnd, + LONG lParam + ); + +BOOL +CALLBACK +HelloWndProc( + HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam + ); + +void +TestThread( + PINSTANCE_INFO pInstInfo + ); + +BOOL +CALLBACK +MemoryStatusWndProc( + HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam + ); + +VOID +ShowStr( + PINSTANCE_INFO pInstInfo, + char far *format, + ... + ); + +void +__export +LogProc( + int level, + char *format, + ... + ); + + +int +WINAPI +WinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow + ) +{ + HANDLE hAccel; + MSG msg; + WNDCLASS wndclass; + + + hInst = hInstance; + + if (!hPrevInstance) + { + wndclass.style = CS_HREDRAW | CS_VREDRAW; + wndclass.lpfnWndProc = FrameWndProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = 0; + wndclass.hInstance = hInstance; + wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION); + wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); + wndclass.hbrBackground = GetStockObject (LTGRAY_BRUSH); + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = szFrameClass; + + RegisterClass (&wndclass); + + wndclass.style = CS_HREDRAW | CS_VREDRAW; + wndclass.lpfnWndProc = HelloWndProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = sizeof (PINSTANCE_INFO); + wndclass.hInstance = hInstance; + wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION); + wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); + wndclass.hbrBackground = GetStockObject (LTGRAY_BRUSH); + wndclass.lpszMenuName = NULL; + wndclass.lpszClassName = szHelloClass; + + RegisterClass (&wndclass); + } + + hMenuInit = LoadMenu (hInst, "MdiMenuInit"); + hMenuHello = LoadMenu (hInst, "MdiMenuHello"); + + if (!hMenuInit || !hMenuHello) + { + MessageBox (NULL, "err1", "", MB_OK); + } + + hMenuInitWindow = GetSubMenu (hMenuInit, INIT_MENU_POS); + hMenuHelloWindow = GetSubMenu (hMenuHello, HELLO_MENU_POS); + + if (!hMenuInitWindow || !hMenuHelloWindow) + { + MessageBox (NULL, "err1", "", MB_OK); + } + + hAccel = LoadAccelerators (hInst, "MdiAccel"); + + hwndFrame = CreateWindow( + szFrameClass, + "Test wRAPPER", + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + hMenuInit, + hInstance, + NULL + ); + + hwndClient = GetWindow (hwndFrame, GW_CHILD); + + ShowWindow (hwndFrame, nCmdShow); + UpdateWindow (hwndFrame); + + + if ((gdwTlsIndex = TlsAlloc()) == 0xffffffff) + { + // BUGBUG + } + + GlobalMemoryStatus (&gInitialMemoryStatus); + + while (GetMessage (&msg, NULL, 0, 0)) + { + if (!TranslateMDISysAccel (hwndClient, &msg) && + !TranslateAccelerator (hwndFrame, hAccel, &msg)) + { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } + + DestroyMenu (hMenuHello); + + return msg.wParam; +} + + +BOOL +CALLBACK +FrameWndProc( + HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam + ) +{ + static HANDLE hTapiLib = (HANDLE) NULL; + + CLIENTCREATESTRUCT clientcreate; + FARPROC lpfnEnum; + HWND hwndChild; + MDICREATESTRUCT mdicreate; + + + switch (msg) + { + case WM_CREATE: // Create the client window + + clientcreate.hWindowMenu = hMenuInitWindow ; + clientcreate.idFirstChild = IDM_FIRSTCHILD ; + + hwndClient = CreateWindow( + "MDICLIENT", + NULL, + WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE, + 0, + 0, + 0, + 0, + hwnd, + (HMENU) 1, + hInst, + (LPVOID) &clientcreate + ); + + return 0; + + case WM_COMMAND: + + switch (LOWORD(wParam)) + { + case IDM_NEWTESTTHREAD: // Create a Hello child window + + mdicreate.szClass = szHelloClass; + mdicreate.szTitle = "Test Thread: stopped"; + mdicreate.hOwner = hInst; + mdicreate.x = CW_USEDEFAULT; + mdicreate.y = CW_USEDEFAULT; + mdicreate.cx = CW_USEDEFAULT; + mdicreate.cy = CW_USEDEFAULT; + mdicreate.style = 0; + mdicreate.lParam = 0; + + hwndChild = (HWND) SendMessage( + hwndClient, + WM_MDICREATE, + 0, + (LPARAM) &mdicreate + ); + + return 0 ; + + case IDM_CLOSE: // Close the active window + + hwndChild = (HWND)SendMessage (hwndClient, WM_MDIGETACTIVE, 0, 0L); + + if (SendMessage (hwndChild, WM_QUERYENDSESSION, 0, 0L)) + { + SendMessage (hwndClient, WM_MDIDESTROY, (WPARAM) hwndChild, 0L); + } + + return 0 ; + + case IDM_MEMORYSTATUS: + + DialogBox( + hInst, + MAKEINTRESOURCE (IDD_DIALOG1), + hwnd, + (DLGPROC) MemoryStatusWndProc + ); + + break; + + case IDM_LOADTAPI: + + if (!hTapiLib) + { + if (!(hTapiLib = LoadLibrary ("tapi32.dll"))) + { + char buf[64]; + + wsprintf( + buf, + "LoadLib(tapi32) failed, err=%d", + GetLastError() + ); + + MessageBox (hwnd, buf, "Trapper: Error", MB_OK); + } + } + + break; + + case IDM_UNLOADTAPI: + + if (hTapiLib) + { + FreeLibrary (hTapiLib); + + hTapiLib = (HANDLE) NULL; + } + + break; + + case IDM_EXIT: // Exit the program + + SendMessage (hwnd, WM_CLOSE, 0, 0L) ; + return 0; + + case IDM_TILE: + + SendMessage (hwndClient, WM_MDITILE, 0, 0L); + return 0; + + case IDM_CASCADE: + + SendMessage (hwndClient, WM_MDICASCADE, 0, 0L); + return 0; + + case IDM_ARRANGE: + + SendMessage (hwndClient, WM_MDIICONARRANGE, 0, 0L); + return 0; + + case IDM_CLOSEALL: + + EnumChildWindows (hwndClient, CloseEnumProc, 0L); + return 0; + + case IDM_USAGE: + { + static char szDlgText[] = + + "ABSTRACT:\n\r" \ + " Trapper is...\n\r" \ + + "\n\rGETTING STARTED:\n\r" \ + " 1. Choose 'File/New Test Thread' to ...\n\r" \ + + "\n\rMORE INFO:\n\r" \ + " * ...\n\r"; + + MessageBox (hwnd, szDlgText, "Using Trapper", MB_OK); + + break; + } + case IDM_ABOUT: + + MessageBox (hwnd, "xxx", "About Trapper", MB_OK); + + break; + + default: // Pass to active child + + hwndChild = (HWND) SendMessage(hwndClient, WM_MDIGETACTIVE, 0, 0L); + + if (IsWindow (hwndChild)) + { + SendMessage (hwndChild, WM_COMMAND, wParam, lParam); + } + break; + } + break; + + case WM_PAINT: + { + PAINTSTRUCT ps; + + + BeginPaint (hwnd, &ps); + FillRect (ps.hdc, &ps.rcPaint, GetStockObject (LTGRAY_BRUSH)); + EndPaint (hwnd, &ps); + break; + } + case WM_QUERYENDSESSION: + case WM_CLOSE: // Attempt to close all children + + SendMessage (hwnd, WM_COMMAND, IDM_CLOSEALL, 0L); + + if (NULL != GetWindow (hwndClient, GW_CHILD)) + { + return 0; + } + + break; + + case WM_DESTROY: + + PostQuitMessage (0); + + if (hTapiLib) + { + FreeLibrary (hTapiLib); + } + + return 0; + } + + // Pass unprocessed messages to DefFrameProc (not DefWindowProc) + + return DefFrameProc (hwnd, hwndClient, msg, wParam, lParam); +} + + +BOOL +FAR +PASCAL +_export +CloseEnumProc( + HWND hwnd, + LONG lParam + ) +{ + if (GetWindow (hwnd, GW_OWNER)) // check for icon title + { + return 1; + } + + SendMessage (GetParent (hwnd), WM_MDIRESTORE, (WPARAM) hwnd, 0L); + + if (!SendMessage (hwnd, WM_QUERYENDSESSION, 0, 0L)) + { + return 1 ; + } + + SendMessage (GetParent (hwnd), WM_MDIDESTROY, (WPARAM) hwnd, 0L); + + return 1 ; +} + + +void +MungeMenuState( + PINSTANCE_INFO pInstInfo + ) +{ + // + // Check/uncheck the appropriate items given the inst info + // + + CheckMenuItem( + hMenuHello, + IDM_STOPONFAILURE, + (pInstInfo->bStopOnFailure ? MF_CHECKED : MF_UNCHECKED) | + MF_BYCOMMAND + ); + + CheckMenuItem( + hMenuHello, + IDM_RUNONCE, + (pInstInfo->bRunForever ? MF_UNCHECKED : MF_CHECKED) | + MF_BYCOMMAND + ); + + CheckMenuItem( + hMenuHello, + IDM_RUNFOREVER, + (pInstInfo->bRunForever ? MF_CHECKED : MF_UNCHECKED) | + MF_BYCOMMAND + ); + + if(giLogLevel == TRAPP_LOGLEVEL_PARAMS) + { + CheckMenuItem( + hMenuHello, + IDM_PARAMS, + MF_CHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOPARAMS, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOENTEREXIT, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_PASSONLY, + MF_UNCHECKED + ); + } + + else if(giLogLevel == TRAPP_LOGLEVEL_NOPARAMS) + { + CheckMenuItem( + hMenuHello, + IDM_PARAMS, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOPARAMS, + MF_CHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOENTEREXIT, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_PASSONLY, + MF_UNCHECKED + ); + } + + else if(giLogLevel == TRAPP_LOGLEVEL_NOENTEREXIT) + { + CheckMenuItem( + hMenuHello, + IDM_PARAMS, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOPARAMS, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOENTEREXIT, + MF_CHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_PASSONLY, + MF_UNCHECKED + ); + } + + else if(giLogLevel == TRAPP_LOGLEVEL_PASSONLY) + { + CheckMenuItem( + hMenuHello, + IDM_PARAMS, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOPARAMS, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_NOENTEREXIT, + MF_UNCHECKED + ); + CheckMenuItem( + hMenuHello, + IDM_PASSONLY, + MF_CHECKED + ); + } + + + CheckMenuItem( + hMenuHello, + IDM_LOGFILE, + (pInstInfo->bLogFile ? MF_CHECKED : MF_UNCHECKED) | + MF_BYCOMMAND + ); + + + // + // Enable/disable the appropriate items given the inst info + // + + EnableMenuItem( + hMenuHello, + IDM_START, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_STOP, + (pInstInfo->bTestInProgress ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_KILLTAPISRV, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + |MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_RUNONCE, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_RUNFOREVER, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_STOPONFAILURE, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_ALLTESTS, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_NOTESTS, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_ALLTESTSINSUITE, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_NOTESTSINSUITE, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_CONFIGSUITE, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) + | MF_BYCOMMAND + ); + + EnableMenuItem( + hMenuHello, + IDM_ABOUTSUITE, + (pInstInfo->bTestInProgress ? (MF_DISABLED | MF_GRAYED) : MF_ENABLED) | MF_BYCOMMAND + ); +} + + +BOOL +CALLBACK +HelloWndProc( + HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam + ) +{ + HMENU hMenu; + PINSTANCE_INFO pInstInfo = (PINSTANCE_INFO) GetWindowLong (hwnd, 0); + + switch (msg) + { + case WM_CREATE: + { + int i; + RECT rect; + + + pInstInfo = LocalAlloc (LPTR, sizeof(INSTANCE_INFO)); + + memset (pInstInfo, 0, sizeof (INSTANCE_INFO)); + + SetWindowLong (hwnd, 0, (LONG) pInstInfo); + + + pInstInfo->hwnd = hwnd; + + pInstInfo->hTextBufMutex = CreateMutex (NULL, FALSE, NULL); + + pInstInfo->dwTextBufTotalSize = 2048; + pInstInfo->dwTextBufUsedSize = 0; + + pInstInfo->pTextBuf = LocalAlloc (LPTR, pInstInfo->dwTextBufTotalSize); + + pInstInfo->pTextBuf[0] = 0; + + pInstInfo->hwndList1 = CreateWindow ( + "listbox", + "", + WS_VISIBLE | WS_CHILD | WS_BORDER | LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY, + 0, + 0, + 0, + 0, + hwnd, + (HMENU) IDC_LIST1, + hInst, + NULL + ); + + pInstInfo->hwndEdit1 = CreateWindow ( + "edit", + "", + WS_VISIBLE | WS_CHILD | WS_BORDER | ES_MULTILINE | + ES_AUTOHSCROLL | WS_VSCROLL, + 0, + 0, + 0, + 0, + hwnd, + (HMENU) IDC_EDIT1, + hInst, + NULL + ); + + pInstInfo->hwndEdit2 = CreateWindow ( + "edit", + "", + WS_VISIBLE | WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, + 0, + 0, + 0, + 0, + hwnd, + (HMENU) IDC_EDIT2, + hInst, + NULL + ); + + pInstInfo->iNumSuites = GetPrivateProfileInt( + "Suites", + "NumSuites", + 0, + gszTrapperIni + ); + + for (i = 0; i < pInstInfo->iNumSuites; i++) + { + #define BUFSIZE 256 + + int j, iNumTests; + char szSuiteN[16], buf[BUFSIZE]; + HWND hwndList; + + + wsprintf (szSuiteN, "Suite%d", i + 1); + + GetPrivateProfileString( + szSuiteN, + "Description", + "", + buf, + BUFSIZE, + gszTrapperIni + ); + + SendMessage (pInstInfo->hwndList1, LB_ADDSTRING, 0, (LPARAM) buf); + + if (!(hwndList = CreateWindow ( + "listbox", + "", + WS_CHILD | WS_BORDER | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + LBS_HASSTRINGS | LBS_MULTIPLESEL | WS_VISIBLE, + 0, + 0, + 0, + 0, + hwnd, + NULL, + hInst, + NULL + ))) + { + MessageBox (NULL, "CreateWnd failed", "", MB_OK); + } + + SendMessage( + pInstInfo->hwndList1, + LB_SETITEMDATA, + i, + (LPARAM) hwndList + ); + + iNumTests = GetPrivateProfileInt( + szSuiteN, + "NumTests", + 0, + gszTrapperIni + ); + + for (j = 0; j < iNumTests; j++) + { + char szTestN[16]; + + + wsprintf (szTestN, "Test%d", j + 1); + + GetPrivateProfileString( + szSuiteN, + szTestN, + "", + buf, + BUFSIZE, + gszTrapperIni + ); + + SendMessage( + hwndList, + LB_ADDSTRING, + 0, + (LPARAM) (strstr (buf, ",") + 1) + ); + } + + if (i == 0) + { + pInstInfo->hwndList2 = hwndList; + } + } + + SendMessage (pInstInfo->hwndList1, LB_SETCURSEL, 0, 0); + + GetClientRect (hwnd, &rect); + + SendMessage( + hwnd, + WM_SIZE, + 0, + MAKELONG((rect.right-rect.left),(rect.bottom-rect.top)) + ); + + CheckMenuItem (hMenuHello, IDM_RUNONCE, MF_CHECKED | MF_BYCOMMAND); + + return 0 ; + } + case WM_COMMAND: + + switch (LOWORD(wParam)) + { + case IDC_EDIT1: + +#ifdef WIN32 + if (HIWORD(wParam) == EN_CHANGE) +#else + if (HIWORD(lParam) == EN_CHANGE) +#endif + { + // + // Watch to see if the edit control is full, & if so + // purge the top half of the text to make room for more + // + + int length = GetWindowTextLength (pInstInfo->hwndEdit1); + + + if (length > 29998) + { +#ifdef WIN32 + SendMessage( + pInstInfo->hwndEdit1, + EM_SETSEL, + (WPARAM) 0, + (LPARAM) 10000 + ); +#else + SendMessage( + pInstInfo->hwndEdit1, + EM_SETSEL, + (WPARAM) 1, + (LPARAM) MAKELONG (0, 10000) + ); +#endif + + SendMessage( + pInstInfo->hwndEdit1, + EM_REPLACESEL, + 0, + (LPARAM) (char far *) "" + ); + +#ifdef WIN32 + SendMessage( + pInstInfo->hwndEdit1, + EM_SETSEL, + (WPARAM)0xfffffffd, + (LPARAM)0xfffffffe + ); +#else + SendMessage( + pInstInfo->hwndEdit1, + EM_SETSEL, + (WPARAM)1, + (LPARAM) MAKELONG (0xfffd, 0xfffe) + ); +#endif + } + } + break; + + case IDC_LIST1: + +#ifdef WIN32 + if (HIWORD(wParam) == LBN_SELCHANGE) +#else + if (HIWORD(lParam) == LBN_SELCHANGE) +#endif + { + int iSel; + RECT rect; + + + iSel = SendMessage (pInstInfo->hwndList1, LB_GETCURSEL, 0, 0); + + ShowWindow (pInstInfo->hwndList2, SW_HIDE); + + pInstInfo->hwndList2 = (HWND) SendMessage( + pInstInfo->hwndList1, + LB_GETITEMDATA, + (WPARAM) iSel, + 0 + ); + + GetClientRect (hwnd, &rect); + + SendMessage( + hwnd, + WM_SIZE, + 0, + MAKELONG((rect.right-rect.left),(rect.bottom-rect.top)) + ); + + ShowWindow (pInstInfo->hwndList2, SW_SHOW); + } + + break; + + case IDM_START: + { + DWORD dwThreadID; + HANDLE hThread; + + + pInstInfo->bStopTest = FALSE; + + if (!(hThread = CreateThread( + NULL, + 0, + (LPTHREAD_START_ROUTINE) TestThread, + (LPVOID) pInstInfo, + 16384, + &dwThreadID + ))) + { + ShowStr( + pInstInfo, + "CreateThread failed, err=%d", + GetLastError() + ); + } + else + { + pInstInfo->bTestInProgress = TRUE; + + CloseHandle (hThread); + EnableWindow (pInstInfo->hwndList1, FALSE); + EnableWindow (pInstInfo->hwndList2, FALSE); + + SetWindowText (hwnd, "Test Thread: running"); + + MungeMenuState (pInstInfo); + } + + break; + } + case IDM_STOP: + pInstInfo->bStopTest = TRUE; + break; + + case IDM_KILLTAPISRV: + WinExec("cmd.exe /c kill tapisrv.exe", SW_SHOWDEFAULT); + break; + + case IDM_RUNONCE: + case IDM_RUNFOREVER: + + pInstInfo->bRunForever = + (LOWORD(wParam) == IDM_RUNONCE ? FALSE : TRUE); + + CheckMenuItem( + hMenuHello, + LOWORD(wParam), + MF_CHECKED | MF_BYCOMMAND + ); + + CheckMenuItem( + hMenuHello, + (LOWORD(wParam) == IDM_RUNONCE ? IDM_RUNFOREVER : IDM_RUNONCE), + MF_UNCHECKED | MF_BYCOMMAND + ); + + break; + + + case IDM_PARAMS: + case IDM_NOPARAMS: + case IDM_NOENTEREXIT: + case IDM_PASSONLY: + { + DWORD dwMenuItem1, dwMenuItem2, dwMenuItem3; + + if( LOWORD (wParam) == IDM_PARAMS) + { + giLogLevel = TRAPP_LOGLEVEL_PARAMS; + dwMenuItem1 = IDM_NOPARAMS; + dwMenuItem2 = IDM_NOENTEREXIT; + dwMenuItem3 = IDM_PASSONLY; + } + else if(LOWORD (wParam) == IDM_NOPARAMS) + { + giLogLevel = TRAPP_LOGLEVEL_NOPARAMS; + dwMenuItem1 = IDM_PARAMS; + dwMenuItem2 = IDM_NOENTEREXIT; + dwMenuItem3 = IDM_PASSONLY; + } + else if( LOWORD (wParam) == IDM_NOENTEREXIT) + { + giLogLevel = TRAPP_LOGLEVEL_NOENTEREXIT; + dwMenuItem1 = IDM_PARAMS; + dwMenuItem2 = IDM_NOPARAMS; + dwMenuItem3 = IDM_PASSONLY; + } + if( LOWORD (wParam) == IDM_PASSONLY) + { + giLogLevel = TRAPP_LOGLEVEL_PASSONLY; + dwMenuItem1 = IDM_PARAMS; + dwMenuItem2 = IDM_NOPARAMS; + dwMenuItem3 = IDM_NOENTEREXIT; + } + + CheckMenuItem( + hMenuHello, + LOWORD(wParam), + MF_CHECKED | MF_BYCOMMAND + ); + CheckMenuItem( + hMenuHello, + dwMenuItem1, + MF_UNCHECKED | MF_BYCOMMAND + ); + CheckMenuItem( + hMenuHello, + dwMenuItem2, + MF_UNCHECKED | MF_BYCOMMAND + ); + CheckMenuItem( + hMenuHello, + dwMenuItem3, + MF_UNCHECKED | MF_BYCOMMAND + ); + break; + } + + + case IDM_STOPONFAILURE: + + pInstInfo->bStopOnFailure = + (pInstInfo->bStopOnFailure ? FALSE : TRUE); + + CheckMenuItem( + hMenuHello, + IDM_STOPONFAILURE, + (pInstInfo->bStopOnFailure ? MF_CHECKED : MF_UNCHECKED) | + MF_BYCOMMAND + ); + + break; + + case IDM_ALLTESTS: + case IDM_NOTESTS: + { + int i; + HWND hwndList; + + + for (i = 0; i < pInstInfo->iNumSuites; i++) + { + hwndList = (HWND) SendMessage( + pInstInfo->hwndList1, + LB_GETITEMDATA, + (WPARAM) i, + 0 + ); + + SendMessage( + hwndList, + LB_SELITEMRANGE, + (WPARAM) (LOWORD(wParam) == IDM_NOTESTS ? FALSE : TRUE), + MAKELPARAM(0, 10000) + ); + } + + break; + } + + case IDM_LOGFILE: + { + if (pInstInfo->hLogFile) + { + fclose (pInstInfo->hLogFile); + pInstInfo->hLogFile = (FILE *) NULL; + CheckMenuItem( + hMenuHello, + IDM_LOGFILE, + MF_BYCOMMAND | MF_UNCHECKED + ); + + pInstInfo->bLogFile = FALSE; + } + else + { + OPENFILENAME ofn; + char szDirName[256] = ".\\"; + char szFile[256] = "trapper.log\0"; + char szFileTitle[256] = ""; + static char *szFilter = + "Log files (*.log)\0*.log\0All files (*.*)\0*.*\0\0"; + + + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hwnd; + ofn.lpstrFilter = szFilter; + ofn.lpstrCustomFilter = (LPSTR) NULL; + ofn.nMaxCustFilter = 0L; + ofn.nFilterIndex = 1; + ofn.lpstrFile = szFile; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFileTitle = szFileTitle; + ofn.nMaxFileTitle = sizeof(szFileTitle); + ofn.lpstrInitialDir = szDirName; + ofn.lpstrTitle = (LPSTR) NULL; + ofn.Flags = OFN_HIDEREADONLY; + ofn.nFileOffset = 0; + ofn.nFileExtension = 0; + ofn.lpstrDefExt = "LOG"; + + if (!GetOpenFileName(&ofn)) + { + return 0L; + } + + if ((pInstInfo->hLogFile = fopen (szFile, "at")) == + (FILE *) NULL) + { + MessageBox( + hwnd, + "Error creating log file", + "TRAPPER.EXE", + MB_OK + ); + } + else + { + struct tm *newtime; + time_t aclock; + + + time (&aclock); + newtime = localtime (&aclock); + fprintf( + pInstInfo->hLogFile, + "\n---Log opened: %s\n", + asctime (newtime) + ); + + CheckMenuItem( + hMenuHello, + IDM_LOGFILE, + MF_BYCOMMAND | MF_CHECKED + ); + + pInstInfo->bLogFile = TRUE; + } + } + break; + } + case IDM_ALLTESTSINSUITE: + case IDM_NOTESTSINSUITE: + + SendMessage( + pInstInfo->hwndList2, + LB_SELITEMRANGE, + (WPARAM) (LOWORD(wParam) == IDM_NOTESTSINSUITE ? FALSE : TRUE), + MAKELPARAM(0, 10000) + ); + + break; + + + case IDM_CONFIGSUITE: + case IDM_ABOUTSUITE: + { + int iSelSuite; + char szSuiteN[16], szLibPath[256]; + HANDLE hLib; + FARPROC pfn; + + + iSelSuite = SendMessage (pInstInfo->hwndList1, LB_GETCURSEL, 0, 0); + + wsprintf (szSuiteN, "Suite%d", iSelSuite + 1); + + GetPrivateProfileString( + szSuiteN, + "Path", + "", + szLibPath, + 256, + gszTrapperIni + ); + + if (!(hLib = LoadLibrary (szLibPath))) + { + ShowStr( + pInstInfo, + "LoadLibrary('%s') failed, err=%ld", + szLibPath, + GetLastError() + ); + + break; + } + + pfn = GetProcAddress( + hLib, + (LOWORD(wParam) == IDM_CONFIGSUITE ? + "SuiteConfig" : "SuiteAbout") + ); + + (*pfn)(hwnd); + + FreeLibrary (hLib); + + break; + } + } // switch + + return 0 ; + + case WM_SIZE: + { + int width = (int) LOWORD(lParam); + int height = (int) HIWORD(lParam); + int cxFrame = (int) GetSystemMetrics (SM_CXFRAME); + int cyFrame = (int) GetSystemMetrics (SM_CYFRAME); + int cyMenu = (int) 3*GetSystemMetrics (SM_CYMENU)/2; + int listboxWidth = (width - 3*cxFrame) / 2; + int listboxHeight = (height - 4*cyFrame - cyMenu) / 3; + + + MoveWindow( + pInstInfo->hwndList1, + cxFrame, + cyFrame, + listboxWidth, + listboxHeight, + TRUE + ); + + MoveWindow( + pInstInfo->hwndList2, + listboxWidth + 2*cxFrame, + cyFrame, + listboxWidth, + listboxHeight, + TRUE + ); + + MoveWindow( + pInstInfo->hwndEdit1, + cxFrame, + listboxHeight + 2*cyFrame, + width - 2*cxFrame, + 2*listboxHeight, + TRUE + ); + + MoveWindow( + pInstInfo->hwndEdit2, + cxFrame, + 3*listboxHeight + 3*cyFrame, + width - 2*cxFrame, + cyMenu, + TRUE + ); + + break; + } + case WM_PAINT: + { + PAINTSTRUCT ps; + + + BeginPaint (hwnd, &ps); + FillRect (ps.hdc, &ps.rcPaint, GetStockObject (LTGRAY_BRUSH)); + EndPaint (hwnd, &ps); + break; + } + case WM_MDIACTIVATE: + + // Set the Hello menu if gaining focus + +#ifdef WIN32 + if ((HWND) lParam == hwnd) // activating + { + SendMessage( + hwndClient, + WM_MDISETMENU, + (WPARAM) hMenuHello, + (LPARAM) hMenuHelloWindow + ) ; + + MungeMenuState (pInstInfo); + } + else + { + SendMessage( + hwndClient, + WM_MDISETMENU, + (WPARAM) hMenuInit, + (LPARAM) hMenuInitWindow + ); + } +#else + if (wParam == TRUE) + { + SendMessage( + hwndClient, + WM_MDISETMENU, + 0, + MAKELONG (hMenuHello, hMenuHelloWindow) + ) ; + + MungeMenuState (pInstInfo); + } + else + { + SendMessage( + hwndClient, + WM_MDISETMENU, + 0, + MAKELONG (hMenuInit, hMenuInitWindow) + ); + } +#endif + DrawMenuBar (hwndFrame); + return 0; + + case WM_ADDTEXT: + { + if (lParam == TRAPPER_MSG_KEY) + { + SendMessage( + pInstInfo->hwndEdit1, + EM_SETSEL, + (WPARAM)0xfffffffd, + (LPARAM)0xfffffffe + ); + + WaitForSingleObject (pInstInfo->hTextBufMutex, INFINITE); + + SendMessage( + pInstInfo->hwndEdit1, + EM_REPLACESEL, + 0, + (LPARAM) pInstInfo->pTextBuf + ); + + pInstInfo->pTextBuf[0] = 0; + + ReleaseMutex (pInstInfo->hTextBufMutex); + + SendMessage (pInstInfo->hwndEdit1, EM_SCROLLCARET, 0, 0); + } + + break; + } + case WM_TESTTHREADTERMINATED: + + if (lParam == TRAPPER_MSG_KEY) + { + pInstInfo->bTestInProgress = FALSE; + + EnableWindow (pInstInfo->hwndList1, TRUE); + EnableWindow (pInstInfo->hwndList2, TRUE); + + SetWindowText (hwnd, "Test Thread: stopped"); + + if (hwnd == (HWND)SendMessage (hwndClient, WM_MDIGETACTIVE, 0, 0L)) + { + MungeMenuState (pInstInfo); + } + } + + break; + + case WM_QUERYENDSESSION: + case WM_CLOSE: + + break; + + case WM_DESTROY: + + LocalFree (LocalHandle (pInstInfo->pTextBuf)); + CloseHandle (pInstInfo->hTextBufMutex); + + LocalFree (LocalHandle (pInstInfo)); + return 0; + } + + return DefMDIChildProc (hwnd, msg, wParam, lParam); +} + + +void +TestThread( + PINSTANCE_INFO pInstInfo + ) +{ + static char gszStatus[] = "Total=%d, Reps=%d, Passed=%d, Failed=%d"; + + int i, iReps = 0, iPassed = 0, iFailed = 0, iTotal = 0; + BOOL bRunForever; + char buf[80]; + + + memset(buf, 0, 80); + ShowStr (pInstInfo, "TestThread: enter"); + + TlsSetValue (gdwTlsIndex, (LPVOID) pInstInfo); + + do + { + for (i = 0; i < pInstInfo->iNumSuites; i++) + { + int iSelCount, *aiSelItems, j; + HWND hwndList; + char szLibName[256], szTestN[16], szSuiteN[16]; + HANDLE hLib; + FARPROC pfn; + char szScriptFileName[256]; + + + if (pInstInfo->bStopTest) + { + goto TestThread_return; + } + + hwndList = (HWND) SendMessage( + pInstInfo->hwndList1, + LB_GETITEMDATA, + (WPARAM) i, + 0 + ); + + if (!(iSelCount = SendMessage (hwndList, LB_GETSELCOUNT, 0, 0))) + { + continue; + } + + aiSelItems = LocalAlloc (LPTR, iSelCount * sizeof (int)); + + SendMessage( + hwndList, + LB_GETSELITEMS, + (WPARAM) iSelCount, + (LPARAM) aiSelItems + ); + + wsprintf (szSuiteN, "Suite%d", i + 1); + + GetPrivateProfileString( + szSuiteN, + "Path", + "", + szLibName, + 256, + gszTrapperIni + ); + + if (!(hLib = LoadLibrary (szLibName))) + { + ShowStr( + pInstInfo, + "LoadLibrary('%s') failed, err=%d", + szLibName, + GetLastError() + ); + + continue; + } + + if (!(pfn = GetProcAddress (hLib, "SuiteInit"))) + { + ShowStr( + pInstInfo, + "GetProcAddress ('%s', 'SuiteInit') failed, err=%d", + szLibName, + GetLastError() + ); + + goto clean_up_Suite; + } + + (*pfn)(LogProc); + + for (j = 0; j < iSelCount; j++) + { + BOOL bResult; + + + if (pInstInfo->bStopTest) + { + LocalFree (LocalHandle (aiSelItems)); + + FreeLibrary (hLib); + + goto TestThread_return; + } + + wsprintf (szTestN, "Test%d", aiSelItems[j] + 1); + + if (!(pfn = GetProcAddress (hLib, szTestN))) + { + ShowStr( + pInstInfo, + "GetProcAddress ('%s', 'SuiteInit') failed, err=%d", + szLibName, + GetLastError() + ); + + continue; + } + + GetPrivateProfileString( + szSuiteN, + "szTestN", + "", + szScriptFileName, + 256, + gszTrapperIni + ); + +// bResult = (*pfn)(hInst, szScriptFileName); + + bResult = (*pfn)(hInst); + + + if (!bResult) + { + iFailed++; + iTotal++; + + if (pInstInfo->bStopOnFailure) + { + LocalFree (LocalHandle (aiSelItems)); + + FreeLibrary (hLib); + + goto TestThread_return; + } + } + else + { + iPassed++; + iTotal++; + } + + wsprintf (buf, gszStatus, iTotal, iReps, iPassed, iFailed); + + SetWindowText (pInstInfo->hwndEdit2, buf); + } + + pfn = GetProcAddress (hLib, "SuiteShutdown"); + + (*pfn)(); + +clean_up_Suite: + + LocalFree (LocalHandle (aiSelItems)); + + FreeLibrary (hLib); + } + + iReps++; + + } while (pInstInfo->bRunForever); + + +TestThread_return: + + wsprintf (buf, gszStatus, iTotal, iReps, iPassed, iFailed); + + SetWindowText (pInstInfo->hwndEdit2, buf); + + PostMessage (pInstInfo->hwnd, WM_TESTTHREADTERMINATED, 0, TRAPPER_MSG_KEY); + + ShowStr (pInstInfo, "TestThread: exit"); + + ShowStr (pInstInfo, buf); + + ExitThread (0); +} + + +BOOL +CALLBACK +MemoryStatusWndProc( + HWND hwnd, + UINT msg, + WPARAM wParam, + LPARAM lParam + ) +{ + switch (msg) + { + case WM_INITDIALOG: + { + static char szMemStatus[] = + + "MemoryLoad = %d%%\r\n" \ + "TotalPhys = x%x\r\n" \ + "AvailPhys = x%x\r\n" \ + "TotalPageFile = x%x\r\n" \ + "AvailPageFile = x%x\r\n" \ + "TotalVirtual = x%x\r\n" \ + "AvailVirtual = x%x"; + char buf[256]; + MEMORYSTATUS memoryStatus; + + + wsprintf( + buf, + szMemStatus, + gInitialMemoryStatus.dwMemoryLoad, + gInitialMemoryStatus.dwTotalPhys, + gInitialMemoryStatus.dwAvailPhys, + gInitialMemoryStatus.dwTotalPageFile, + gInitialMemoryStatus.dwAvailPageFile, + gInitialMemoryStatus.dwTotalVirtual, + gInitialMemoryStatus.dwAvailVirtual + ); + + SetDlgItemText (hwnd, IDC_EDIT1, buf); + + GlobalMemoryStatus (&memoryStatus); + + wsprintf( + buf, + szMemStatus, + memoryStatus.dwMemoryLoad, + memoryStatus.dwTotalPhys, + memoryStatus.dwAvailPhys, + memoryStatus.dwTotalPageFile, + memoryStatus.dwAvailPageFile, + memoryStatus.dwTotalVirtual, + memoryStatus.dwAvailVirtual + ); + + SetDlgItemText (hwnd, IDC_EDIT2, buf); + + break; + } + case WM_COMMAND: + + switch (LOWORD(wParam)) + { + case IDOK: + + EndDialog (hwnd, 0); + break; + + } // switch + + break; + + case WM_PAINT: + { + PAINTSTRUCT ps; + + + BeginPaint (hwnd, &ps); + FillRect (ps.hdc, &ps.rcPaint, GetStockObject (LTGRAY_BRUSH)); + EndPaint (hwnd, &ps); + break; + } + } // switch + + return FALSE; +} + +VOID +ShowStr( + PINSTANCE_INFO pInstInfo, + char far *format, + ... + ) +{ + int iLen; + char buf[256]; + va_list ap; + + + va_start(ap, format); + + wvsprintf (buf, format, ap); + + if (pInstInfo->hLogFile) + { + fprintf(pInstInfo->hLogFile, "%s\n", buf); + } + + strcat (buf, "\r\n"); + + iLen = (int) strlen (buf); + + WaitForSingleObject (pInstInfo->hTextBufMutex, INFINITE); + + if ((pInstInfo->dwTextBufUsedSize + iLen) > pInstInfo->dwTextBufTotalSize) + { + char *pBuf; + + + if ((pBuf = LocalAlloc (LPTR, 2 * pInstInfo->dwTextBufTotalSize))) + { + memcpy (pBuf, pInstInfo->pTextBuf, pInstInfo->dwTextBufUsedSize); + LocalFree (LocalHandle (pInstInfo->pTextBuf)); + pInstInfo->pTextBuf = pBuf; + pInstInfo->dwTextBufTotalSize *= 2; + + if (pInstInfo->pTextBuf[0] == 0) + { + // + // The handler for WM_ADDTEXT zeroes out the first byte in the + // buffer when it has added the text to the edit control,so if + // here we know we need to post another msg to alert that more + // text needs to be added + // + + PostMessage( + pInstInfo->hwnd, + WM_ADDTEXT, + 0, + TRAPPER_MSG_KEY + ); + pInstInfo->dwTextBufUsedSize = 1; + } + strcat (pInstInfo->pTextBuf, buf); + pInstInfo->dwTextBufUsedSize += iLen; + } + else + { + + if (pInstInfo->pTextBuf[0] == 0) + { + // + // The handler for WM_ADDTEXT zeroes out the first byte in the + // buffer when it has added the text to the edit control,so if + // here we know we need to post another msg to alert that more + // text needs to be added + // + + PostMessage( + pInstInfo->hwnd, + WM_ADDTEXT, + 0, + TRAPPER_MSG_KEY + ); + pInstInfo->dwTextBufUsedSize = 1; + } + } + + } + else + { + if (pInstInfo->pTextBuf[0] == 0) + { + // + // The handler for WM_ADDTEXT zeroes out the first byte in the + // buffer when it has added the text to the edit control, so if + // here we know we need to post another msg to alert that more + // text needs to be added + // + + PostMessage( + pInstInfo->hwnd, + WM_ADDTEXT, + 0, + TRAPPER_MSG_KEY + ); + pInstInfo->dwTextBufUsedSize = 1; + } + strcat (pInstInfo->pTextBuf, buf); + pInstInfo->dwTextBufUsedSize += iLen; + } + + ReleaseMutex (pInstInfo->hTextBufMutex); + va_end(ap); +} + + +void +__export +LogProc( + int level, + char *format, + ... + ) +{ + if (level <= giLogLevel) + { + int iLen; + char buf[256] = " "; + va_list ap; + + + va_start(ap, format); + wvsprintf (buf + 4, format, ap); + ShowStr ((PINSTANCE_INFO) TlsGetValue (gdwTlsIndex), buf); + va_end(ap); + } +} + + +/* + +void +__export +SetLogLevel( + int level + ) +{ + giLogLevel = level; +} + + +int +__export +GetLogLevel( + ) +{ + return giLogLevel; +} + +*/ + + + diff --git a/private/tapi/qa/trapper/trapper.def b/private/tapi/qa/trapper/trapper.def new file mode 100644 index 000000000..4c34f7c64 --- /dev/null +++ b/private/tapi/qa/trapper/trapper.def @@ -0,0 +1,8 @@ +NAME trapper + +EXETYPE WINDOWS +STUB 'WINSTUB.EXE' +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 8192 +STACKSIZE 16384 diff --git a/private/tapi/qa/trapper/trapper.h b/private/tapi/qa/trapper/trapper.h new file mode 100644 index 000000000..3a9864ed8 --- /dev/null +++ b/private/tapi/qa/trapper/trapper.h @@ -0,0 +1,35 @@ +/*++ BUILD Version: 0000 // Increment this if a change has global effects + +Copyright (c) 1995 Microsoft Corporation + +Module Name: + + trapper.h + +Abstract: + + This module contains the public prototypes for the trapper + (test wrapper) app, as used by test dll's + +Author: + + Dan Knudson (DanKn) 06-Jun-1995 + +Revision History: + + +Notes: + + +--*/ + + +#ifdef WIN32 + + typedef void (*LOGPROC)(int level, char *format, ...); + +#else + + typedef void (far __export *LOGPROC)(int level, char *format, ...); + +#endif diff --git a/private/tapi/qa/trapper/trapper.ini b/private/tapi/qa/trapper/trapper.ini new file mode 100644 index 000000000..d052bf56d --- /dev/null +++ b/private/tapi/qa/trapper/trapper.ini @@ -0,0 +1,409 @@ +[Suites] +NumSuites=18 + +[Suite1] +Description=Uninitialize Tests +Path=c:\nt\public\sdk\lib\i386\uline.dll +NumTests=7 +Test1=line, TLineUninitalize +Test2=line, TCLineUninitalize +Test3=line, TILineUninitalize +Test4=line, TLine20Uninitalize +Test5=line, TSLineUninitalize +Test6=line, TXLineUninitalize +Test7=line, TYLineUninitalize + +[Suite2] +Description=Phone Tests +Path=c:\nt\public\sdk\lib\i386\tphone.dll +NumTests=32 +Test1=phone, phoneConfigDialog +Test2=phone, phoneDevSpecific +Test3=phone, phoneNegotiateExtVersion +Test4=phone, phoneGetIcon +Test5=phone, phoneGetID +Test6=phone, phoneGetStatus +Test7=phone, phoneSetButtonInfo +Test8=phone, phoneGetButtonInfo +Test9=phone, phoneSetData +Test10=phone, phoneGetData +Test11=phone, phoneSetDisplay +Test12=phone, phoneGetDisplay +Test13=phone, phoneSetGain +Test14=phone, phoneGetGain +Test15=phone, phoneSetHookSwitch +Test16=phone, phoneGetHookSwitch +Test17=phone, phoneSetLamp +Test18=phone, phoneGetLamp +Test19=phone, phoneSetRing +Test20=phone, phoneGetRing +Test21=phone, phoneSetStatusMessages +Test22=phone, phoneGetStatusMessages +Test23=phone, phoneSetVolume +Test24=phone, phoneGetVolume +Test25=phone, phoneClose +Test26=phone, phoneGetDevCaps +Test27=phone, phoneInitialize +Test28=phone, phoneNegotiateAPIVersion +Test29=phone, phoneOpen +Test30=phone, phoneShutdown +Test31=phone, phoneInitializeEx +Test32=phone, phoneGetMessage + + +[Suite3] +Description=X Line Tests +Path=c:\nt\public\sdk\lib\i386\xline.dll +NumTests=13 +Test1=line, lineConfigDialog +Test2=line, lineConfigDialogEdit +Test3=line, lineDevSpecific +Test4=line, lineDevSpecificFeature +Test5=line, lineGetDevConfig +Test6=line, lineGetRequest +Test7=line, lineRegisterRequestRecipient +Test8=line, lineSetCallParams +Test9=line, lineSetDevConfig +Test10=line, lineSetMediaControl +Test11=line, lineSetMediaMode +Test12=line, lineSetTerminal +Test13=line, lineSetTollList + + +[Suite4] +Description=Y Line Tests +Path=c:\nt\public\sdk\lib\i386\yline.dll +NumTests=12 +Test1=line, lineAddProvider +Test2=line, lineConfigProvider +Test3=line, lineGenerateDigits +Test4=line, lineGetCountry +Test5=line, lineGetProviderList +Test6=line, lineGetTranslateCaps +Test7=line, lineRemoveProvider +Test8=line, lineTranslateAddress +Test9=line, lineTranslateDialog +Test10=line, lineGetIcon +Test11=line, lineGenerateTone +Test12=line, lineHandoff + + +[Suite5] +Description=C Line Tests +Path=c:\nt\public\sdk\lib\i386\cline.dll +NumTests=13 +Test1=line, lineAddToConference +Test2=line, lineGetConfRelatedCalls +Test3=line, linePrepareAddToConference +Test4=line, lineRemoveFromConference +Test5=line, lineSetupConference +Test6=line, lineCompleteCall +Test7=line, lineRedirect +Test8=line, lineSecureCall +Test9=line, lineSwapHold +Test10=tapi, tapiGetLocationInfo +Test11=tapi, tapiRequestDrop +Test12=tapi, tapiRequestMakeCall +Test13=tapi, tapiRequestMediaCall + + +[Suite6] +Description=S Line Tests +Path=c:\nt\public\sdk\lib\i386\sline.dll +NumTests=15 +Test1=line, lineGatherDigits +Test2=line, lineMonitorDigits +Test3=line, lineMonitorMedia +Test4=line, lineMonitorTones +Test5=line, linePark +Test6=line, lineUnpark +Test7=line, linePickup +Test8=line, lineUncompleteCall +Test9=line, lineGetAppPriority +Test10=line, lineSetAppPriority +Test11=line, lineSetCurrentLocation +Test12=line, lineSetCallData +Test13=line, lineSetCallQualityOfService +Test14=line, lineSetCallTreatment +Test15=line, lineSetLineDevStatus + +[Suite7] +Description=I Line Tests +Path=c:\nt\public\sdk\lib\i386\iline.dll +NumTests=12 +Test1=line, lineAccept +Test2=line, lineAnswer +Test3=line, lineBlindTransfer +Test4=line, lineForward +Test5=line, lineReleaseUserUserInfo +Test6=line, lineSendUserUserInfo +Test7=line, lineSetupTransfer +Test8=line, lineCompleteTransfer +Test9=line, lineNegotiateExtVersion +Test10=line, lineHold +Test11=line, lineUnHold +Test12=line, lineSetAppSpecific + + +[Suite8] +Description=Line 2.0 Tests +Path=c:\nt\public\sdk\lib\i386\line20.dll +NumTests=12 +Test1=line, lineAgentSpecific +Test2=line, lineGetAgentCaps +Test3=line, lineGetAgentActivityList +Test4=line, lineGetAgentGroupList +Test5=line, lineGetAgentStatus +Test6=line, lineProxyMessage +Test7=line, lineProxyResponse +Test8=line, lineSetAgentActivity +Test9=line, lineSetAgentGroup +Test10=line, lineSetAgentState +Test11=line, lineInitializeEx +Test12=line, lineGetMessage + + +[Suite9] +Description=T Line Tests +Path=c:\nt\public\sdk\lib\i386\tline.dll +NumTests=26 +Test1=line, lineUninitialize +Test2=line, lineGetAddressCaps +Test3=line, lineGetDevCaps +Test4=line, lineInitialize +Test5=line, lineMakeCall +Test6=line, lineMakeCall1 +Test7=line, lineMakeCall2 +Test8=line, lineNegotiateAPIVersion +Test9=line, lineOpen +Test10=line, lineShutDown +Test11=line, lineClose +Test12=line, lineGetID +Test13=line, lineGetNumRings +Test14=line, lineSetNumRings +Test15=line, lineDeallocateCall +Test16=line, lineDial +Test17=line, lineDrop +Test18=line, lineGetLineDevStatus +Test19=line, lineGetAddressStatus +Test20=line, lineSetCallPriviledge +Test21=line, lineGetStatusMessages +Test22=line, lineSetStatusMessages +Test23=line, lineGetCallInfo +Test24=line, lineGetCallStatus +Test25=line, lineGetNewCalls +Test26=line, lineGetAddressID + + +[Suite10] +Description=TX Line Tests +Path=c:\nt\public\sdk\lib\i386\txline.dll +NumTests=15 +Test1=line, lineUninitialize +Test2=line, lineConfigDialog +Test3=line, lineConfigDialogEdit +Test4=line, lineDevSpecific +Test5=line, lineDevSpecificFeature +Test6=line, lineGetDevConfig +Test7=line, lineGetRequest +Test8=line, lineRegisterRequestRecipient +Test9=line, lineSetCallParams +Test10=line, lineSetDevConfig +Test11=line, lineSetMediaControl +Test12=line, lineSetMediaMode +Test13=line, lineSetTerminal +Test14=line, lineSetTollList +Test15=line, lineMessages + + + +[Suite11] +Description=TY Line Tests +Path=c:\nt\public\sdk\lib\i386\tyline.dll +NumTests=13 +Test1=line, lineUninitialize +Test2=line, lineConfigProvider +Test3=line, lineGetProviderList +Test4=line, lineGenerateDigits +Test5=line, lineGetCountry +Test6=line, lineGetTranslateCaps +Test7=line, lineTranslateAddress +Test8=line, lineTranslateDialog +Test9=line, lineGetIcon +Test10=line, lineGenerateTone +Test11=line, lineAddProvider +Test12=line, lineRemoveProvider +Test13=line, lineHandoff + + +[Suite12] +Description=TC Line Tests +Path=c:\nt\public\sdk\lib\i386\tcline.dll +NumTests=14 +Test1=line, lineUninitialize +Test2=line, lineAddToConference +Test3=line, lineGetConfRelatedCalls +Test4=line, linePrepareAddToConference +Test5=line, lineRemoveFromConference +Test6=line, lineSetupConference +Test7=line, lineCompleteCall +Test8=line, lineRedirect +Test9=line, lineSecureCall +Test10=line, lineSwapHold +Test11=tapi, tapiGetLocationInfo +Test12=tapi, tapiRequestDrop +Test13=tapi, tapiRequestMakeCall +Test14=tapi, tapiRequestMediaCall + + +[Suite13] +Description=TS Line Tests +Path=c:\nt\public\sdk\lib\i386\tsline.dll +NumTests=16 +Test1=line, lineUninitialize +Test2=line, lineGatherDigits +Test3=line, lineMonitorDigits +Test4=line, lineMonitorMedia +Test5=line, lineMonitorTones +Test6=line, linePark +Test7=line, lineUnpark +Test8=line, linePickup +Test9=line, lineUncompleteCall +Test10=line, lineGetAppPriority +Test11=line, lineSetAppPriority +Test12=line, lineSetCurrentLocation +Test13=line, lineSetCallData +Test14=line, lineSetCallQualityOfService +Test15=line, lineSetCallTreatment +Test16=line, lineSetLineDevStatus + + +[Suite14] +Description=TI Line Tests +Path=c:\nt\public\sdk\lib\i386\tiline.dll +NumTests=15 +Test1=line, lineUninitialize +Test2=line, lineAccept +Test3=line, lineAnswer +Test4=line, lineBlindTransfer +Test5=line, lineForward +Test6=line, lineForward1 +Test7=line, lineForward2 +Test8=line, lineReleaseUserUserInfo +Test9=line, lineSendUserUserInfo +Test10=line, lineSetupTransfer +Test11=line, lineCompleteTransfer +Test12=line, lineNegotiateExtVersion +Test13=line, lineHold +Test14=line, lineUnHold +Test15=line, lineSetAppSpecific + + + +[Suite15] +Description=TLine 2.0 Tests +Path=c:\nt\public\sdk\lib\i386\tline20.dll +NumTests=13 +Test1=line, Uninitialized Tests +Test2=line, lineAgentSpecific +Test3=line, lineGetAgentCaps +Test4=line, lineGetAgentActivityList +Test5=line, lineGetAgentGroupList +Test6=line, lineGetAgentStatus +Test7=line, lineProxyMessage +Test8=line, lineProxyResponse +Test9=line, lineSetAgentActivity +Test10=line, lineSetAgentGroup +Test11=line, lineSetAgentState +Test12=line, lineInitializeEx +Test13=line, lineGetMessage + + +[Suite16] +Description=TPhone Tests +Path=c:\nt\public\sdk\lib\i386\ttphone.dll +NumTests=34 +Test1=phone, phoneUninitialize +Test2=phone, phoneDevSpecific +Test3=phone, phoneNegotiateExtVersion +Test4=phone, phoneGetIcon +Test5=phone, phoneGetID +Test6=phone, phoneGetStatus +Test7=phone, phoneSetButtonInfo +Test8=phone, phoneGetButtonInfo +Test9=phone, phoneSetData +Test10=phone, phoneGetData +Test11=phone, phoneSetDisplay +Test12=phone, phoneGetDisplay +Test13=phone, phoneSetGain +Test14=phone, phoneGetGain +Test15=phone, phoneSetHookSwitch +Test16=phone, phoneGetHookSwitch +Test17=phone, phoneSetLamp +Test18=phone, phoneGetLamp +Test19=phone, phoneSetRing +Test20=phone, phoneGetRing +Test21=phone, phoneSetStatusMessages +Test22=phone, phoneGetStatusMessages +Test23=phone, phoneSetVolume +Test24=phone, phoneGetVolume +Test25=phone, phoneClose +Test26=phone, phoneGetDevCaps +Test27=phone, phoneInitialize +Test28=phone, phoneNegotiateAPIVersion +Test29=phone, phoneOpen +Test30=phone, phoneShutdown +Test31=phone, phoneInitializeEx +Test32=phone, phoneGetMessage +Test33=phone, phoneConfigDialog +Test34=phone, phoneMessages + +[Suite17] +Description=Line UNICODE go/no-go tests +Path=c:\nt\public\sdk\lib\i386\wline.dll +NumTests=31 +Test1=line, lineAddProviderW +Test2=line, lineBlindTransferW +Test3=line, lineConfigDialogW +Test4=line, lineConfigDialogEditW +Test5=line, lineForwardW +Test6=line, lineGatherDigitsW +Test7=line, lineGetAgentActivityListW +Test8=line, lineGetAppPriorityW +Test9=line, lineGetCountryW +Test10=line, lineGetDevConfigW +Test11=line, lineGenerateDigitsW +Test12=line, lineGetIconW +Test13=line, lineGetRequestW +Test14=line, lineGetTranslateCapsW +Test15=line, lineHandoffW +Test16=line, lineInitializeExW +Test17=line, lineParkW +Test18=line, linePrepareAddToConferenceW +Test19=line, linePickupW +Test20=line, lineRedirectW +Test21=line, lineSetAppPriorityW +Test22=line, lineSetDevConfigW +Test23=line, lineSetupTransferW +Test24=line, lineSetTollListW +Test25=line, lineSetupConferenceW +Test26=line, lineTranslateAddressW +Test27=line, lineTranslateDialogW +Test28=line, lineUnparkW +Test29=line, tapiGetLocationInfoW +Test30=line, tapiRequestMakeCallW +Test31=line, tapiRequestMediaCallW + +[Suite18] +Description=Phone UNICODE go/no-go tests +Path=c:\nt\public\sdk\lib\i386\wphone.dll +NumTests=9 +Test1=phone, phoneConfigDialogW +Test2=phone, phoneGetButtonInfoW +Test3=phone, phoneGetDevCapsW +Test4=phone, phoneGetIconW +Test5=phone, phoneGetIDW +Test6=phone, phoneGetStatusW +Test7=phone, phoneInitializeW +Test8=phone, phoneInitializeExW +Test9=phone, phoneSetButtonInfoW \ No newline at end of file diff --git a/private/tapi/qa/trapper/trapper.rc b/private/tapi/qa/trapper/trapper.rc new file mode 100644 index 000000000..cb24bfba5 --- /dev/null +++ b/private/tapi/qa/trapper/trapper.rc @@ -0,0 +1,100 @@ +#include "windows.h" +#include "private.h" + +MdiMenuInit MENU +{ + POPUP "&File" + { + MENUITEM "New &Test Thread", IDM_NEWTESTTHREAD + MENUITEM SEPARATOR + MENUITEM "&Memory status...", IDM_MEMORYSTATUS + MENUITEM SEPARATOR + MENUITEM "&Load Tapi32.dll", IDM_LOADTAPI + MENUITEM "&Unload Tapi32.dll", IDM_UNLOADTAPI + MENUITEM SEPARATOR + MENUITEM "E&xit", IDM_EXIT + } + POPUP "&Help" + { + MENUITEM "&Using Trapper...", IDM_USAGE + MENUITEM "&About...", IDM_ABOUT + } +} + +MdiMenuHello MENU +{ + POPUP "&File" + { + MENUITEM "New &Test Thread", IDM_NEWTESTTHREAD + MENUITEM "&Close", IDM_CLOSE + MENUITEM SEPARATOR + MENUITEM "&Memory status...", IDM_MEMORYSTATUS + MENUITEM SEPARATOR + MENUITEM "&Load Tapi32.dll", IDM_LOADTAPI + MENUITEM "&Unload Tapi32.dll", IDM_UNLOADTAPI + MENUITEM SEPARATOR + MENUITEM "E&xit", IDM_EXIT + } + POPUP "&Tests" + { + MENUITEM "Start", IDM_START + MENUITEM "Stop", IDM_STOP + MENUITEM "Kill &Tapisrv.exe", IDM_KILLTAPISRV + MENUITEM SEPARATOR + POPUP "&Select Log Level" + { + MENUITEM "&With Params", IDM_PARAMS + MENUITEM "&NO Params", IDM_NOPARAMS + MENUITEM "NO &EnterExit", IDM_NOENTEREXIT + MENUITEM "&PassFail", IDM_PASSONLY + } + MENUITEM "&Log to file", IDM_LOGFILE + MENUITEM SEPARATOR + MENUITEM "Run once", IDM_RUNONCE + MENUITEM "Run forever", IDM_RUNFOREVER + MENUITEM SEPARATOR + MENUITEM "Stop on failure", IDM_STOPONFAILURE + MENUITEM SEPARATOR + MENUITEM "Select all tests", IDM_ALLTESTS + MENUITEM "Select no tests", IDM_NOTESTS + MENUITEM "Select all tests in suite", IDM_ALLTESTSINSUITE + MENUITEM "Select no tests in suite", IDM_NOTESTSINSUITE + MENUITEM SEPARATOR + MENUITEM "Config suite...", IDM_CONFIGSUITE + MENUITEM "About suite...", IDM_ABOUTSUITE + } + POPUP "&Window" + { + MENUITEM "&Cascade\tShift+F5", IDM_CASCADE + MENUITEM "&Tile\tShift+F4", IDM_TILE + MENUITEM "Arrange &Icons", IDM_ARRANGE + MENUITEM "Close &All", IDM_CLOSEALL + } + POPUP "&Help" + { + MENUITEM "&Using Trapper...", IDM_USAGE + MENUITEM "&About...", IDM_ABOUT + } +} + +MdiAccel ACCELERATORS +{ + VK_F5, IDM_CASCADE, VIRTKEY, SHIFT + VK_F4, IDM_TILE, VIRTKEY, SHIFT +} + + +IDD_DIALOG1 DIALOG 6, 18, 150, 200 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "System resources" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Initial:", 1, 4, 8, 32, 8 + LTEXT "Current:", 2, 4, 96, 32, 8 + EDITTEXT IDC_EDIT1, 4, 18, 142, 70, ES_MULTILINE | ES_AUTOVSCROLL | + ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_EDIT2, 4, 106, 142, 70, ES_MULTILINE | ES_AUTOVSCROLL | + ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "OK", IDOK, 55, 182, 40, 14 +END diff --git a/private/tapi/qa/trapper/trapper/makefile b/private/tapi/qa/trapper/trapper/makefile new file mode 100644 index 000000000..6ee4f43fa --- /dev/null +++ b/private/tapi/qa/trapper/trapper/makefile @@ -0,0 +1,6 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2 +# +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/private/tapi/qa/trapper/trapper/sources b/private/tapi/qa/trapper/trapper/sources new file mode 100644 index 000000000..8fa75500c --- /dev/null +++ b/private/tapi/qa/trapper/trapper/sources @@ -0,0 +1,59 @@ +!IF 0 + +Copyright (c) 1989-1993 Microsoft Corporation + +Module Name: + + sources. + +Abstract: + + This file specifies the target component being built and the list of + sources files needed to build that component. Also specifies optional + compiler switches and libraries that are unique for the component being + built. + +Author: + + John Rogers (JohnRo) 25-Oct-1991 + +Notes: + + Commented description of this file is in \nt\public\oak\bin\sources.tpl + + Add the following line under the "SOURCES" section if build for the + TAPI-lite on Daytona (may want to chg TARGETNAME too): + + C_DEFINES=-DDAYTONA + +Revision History: + +!ENDIF + + +MAJORCOMP=net +MINORCOMP=tapi + +TARGETNAME=trapper +TARGETPATH=..\..\bin +TARGETTYPE=PROGRAM + +TARGETLIBS=$(BASEDIR)\public\sdk\lib\*\kernel32.lib \ + $(BASEDIR)\public\sdk\lib\*\comdlg32.lib + + +INCLUDES=..;..\..\..\inc + +USE_CRTDLL=1 + +SOURCES=..\trapper.c \ + ..\trapper.rc + +UMTYPE=windows + +UMENTRY=winmain + +!IFNDEF 386_WARNING_LEVEL +386_WARNING_LEVEL=/W3 +!ENDIF + \ No newline at end of file -- cgit v1.2.3