1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
|
/*
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
* for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
* in the process of the client. The client initialises the server by calling the
* one and only ordinal.
*
*/
#include <e32base.h>
#include <e32cmn.h>
#if (!defined TS_TE_Cntsrv_API_Policing_SERVER_H_)
#include "csuite.h"
#endif
#include "ecntcloseview1_cstep.h"
#include "ecntsendpluginuidtoserver1_cstep.h"
#include "cntcntctmatchingcriteriaexternalizedsize1_cstep.h"
#include "ecntviewsortorderexternalizedsize1_cstep.h"
#include "ecntviewat1_cstep.h"
#include "ecntviewcount1_cstep.h"
#include "ecntviewfind1_cstep.h"
#include "ecntallfieldslength1_cstep.h"
#include "ecntgetviewsortorder1_cstep.h"
#include "ecntrequestviewevent1_cstep.h"
#include "ecntcancelrequestviewevent1_cstep.h"
#include "ecntgetincludedtypes1_cstep.h"
#include "ecntgetcontactids1_cstep.h"
#include "ecntgetsortpluginuidfromserver1_cstep.h"
#include "ecntgetcurrentitem1_cstep.h"
#include "ecntsetheapfailure1_cstep.h"
#include "ecntresourcecount1_cstep.h"
#include "ecntdbcontactcount1_cstep.h"
#include "ecntsetdbviewcontacttype1_cstep.h"
#include "ecntviewcontactatlength1_cstep.h"
#include "ecntrequestevent1_cstep.h"
#include "ecntcanceleventrequest1_cstep.h"
#include "ecntconnectionid1_cstep.h"
#include "ecntmachineid1_cstep.h"
#include "ecntoverridemachineid1_cstep.h"
#include "ecntgetpreftemplateid1_cstep.h"
#include "ecnticctemplateid1_cstep.h"
#include "ecntphonebookgroupid1_cstep.h"
#include "ecntclosedatabase1_cstep.h"
#include "ecntclosedbtables1_cstep.h"
#include "ecntcancelasyncopendatabase1_cstep.h"
#include "ecntfileuniqueid1_cstep.h"
#include "ecntopstimeout1_cstep.h"
#include "ecntfilessize1_cstep.h"
#include "ecntmatcheshintfield1_cstep.h"
#include "ecntgetdefaultdatabasename1_cstep.h"
#include "ecntgetcurrentdb1_cstep.h"
#include "ecntdatabasedrive1_cstep.h"
#include "ecntdatabaseexists1_cstep.h"
#include "ecntsetsortprefs1_cstep.h"
#include "ecntgetowncard1_cstep.h"
#include "ecntfetchtemplateids1_cstep.h"
#include "ecntfetchgroupidlists1_cstep.h"
#include "ecntchangeviewdef1_cstep.h"
#include "ecntgetsortprefs1_cstep.h"
#include "ecntitemclose1_cstep.h"
#include "ecntgetdefinitionsforexistingview1_cstep.h"
#include "ecntopenviewsession1_cstep.h"
#include "ecntcloseviewsession1_cstep.h"
#include "ecntviewchangesortorderl1_cstep.h"
#include "ecntopenviewsession2_cstep.h"
#include "ecntcloseviewsession2_cstep.h"
#include "ecntviewchangesortorderl2_cstep.h"
#include "ecntopendatabase1_cstep.h"
#include "ecntreopendbtables1_cstep.h"
#include "ecntcreateview1_cstep.h"
#include "ecntcreatenamedview1_cstep.h"
#include "ecntviewcontactat1_cstep.h"
#include "ecntallfieldstext1_cstep.h"
#include "ecntgetcontactsmatchingfilter1_cstep.h"
#include "ecntgetcontactmatchingcriteria1_cstep.h"
#include "ecntgetspeeddialcontactidandphonenumber1_cstep.h"
#include "ecntitemread1_cstep.h"
#include "ecntreadcontacttextdef1_cstep.h"
#include "ecntfilterdatabase1_cstep.h"
#include "ecntfind1_cstep.h"
#include "ecntfindasyncinit1_cstep.h"
#include "ecntfindasynctextdefinit1_cstep.h"
#include "ecntfindasync1_cstep.h"
#include "ecntitematl1_cstep.h"
#include "ecntgetcollection1_cstep.h"
#include "ecntlistdatabases1_cstep.h"
#include "ecntviewbeginiterate1_cstep.h"
#include "ecntviewenditerate1_cstep.h"
#include "ecntviewnextiteml1_cstep.h"
#include "ecntcreatedatabase1_cstep.h"
#include "ecntsetpreftemplateid1_cstep.h"
#include "ecntsetowncard1_cstep.h"
#include "ecntrecreatetemplate1_cstep.h"
#include "ecntsetcurrentitem1_cstep.h"
#include "ecntremovecurrentitem1_cstep.h"
#include "ecntsetcurrentdb1_cstep.h"
#include "ecntsetspeeddialidforposition1_cstep.h"
#include "ecntchangeviewsortorder1_cstep.h"
#include "ecntitemopen1_cstep.h"
#include "ecntsetdatabasedrive1_cstep.h"
#include "ecntreplacedatabase1_cstep.h"
#include "ecntdeletedatabase1_cstep.h"
#include "ecntitemupdate1_cstep.h"
#include "ecntitemcommit1_cstep.h"
#include "ecntitemdelete1_cstep.h"
#include "ecntitemcreate1_cstep.h"
#include "ebegindbtransaction1_cstep.h"
#include "eenddbtransaction1_cstep.h"
#include "erollbackdbtransaction1_cstep.h"
#include "elocksrvnotsupported1_cstep.h"
// __EDIT_ME__ - Substitute the name of your test server
_LIT(KServerName,"Cap_TE_Cntsrv_API_Policing_sc");
// __EDIT_ME__ - Use your own server class name
CTestTE_Cntsrv_API_PolicingServer* CTestTE_Cntsrv_API_PolicingServer::NewL()
/**
* @return - Instance of the test server
* Same code for Secure and non-secure variants
* Called inside the MainL() function to create and start the
* CTestServer derived server.
*/
{
// __EDIT_ME__ - Use your own server class name
CTestTE_Cntsrv_API_PolicingServer * server = new (ELeave) CTestTE_Cntsrv_API_PolicingServer();
CleanupStack::PushL(server);
// CServer base class call
server->StartL(KServerName);
CleanupStack::Pop(server);
return server;
}
CTestStep* CTestTE_Cntsrv_API_PolicingServer::CreateTestStep(const TDesC& aStepName)
/**
* @return - A CTestStep derived instance
* Secure and non-secure variants
* Implementation of CTestServer pure virtual
*/
{
CTestStep* testStep = NULL;
TBool testStepFound(EFalse);
// add test steps
if (aStepName == _L("CECntCloseView1Step"))
{
testStep = new CECntCloseView1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSendPluginUidToServer1Step"))
{
testStep = new CECntSendPluginUidToServer1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CCntCntctMatchingCriteriaExternalizedSize1Step"))
{
testStep = new CCntCntctMatchingCriteriaExternalizedSize1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewSortOrderExternalizedSize1Step"))
{
testStep = new CECntViewSortOrderExternalizedSize1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewAt1Step"))
{
testStep = new CECntViewAt1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewCount1Step"))
{
testStep = new CECntViewCount1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewFind1Step"))
{
testStep = new CECntViewFind1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntAllFieldsLength1Step"))
{
testStep = new CECntAllFieldsLength1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetViewSortOrder1Step"))
{
testStep = new CECntGetViewSortOrder1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntRequestViewEvent1Step"))
{
testStep = new CECntRequestViewEvent1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCancelRequestViewEvent1Step"))
{
testStep = new CECntCancelRequestViewEvent1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetIncludedTypes1Step"))
{
testStep = new CECntGetIncludedTypes1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetContactIds1Step"))
{
testStep = new CECntGetContactIds1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetSortPluginUidFromServer1Step"))
{
testStep = new CECntGetSortPluginUidFromServer1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetCurrentItem1Step"))
{
testStep = new CECntGetCurrentItem1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetHeapFailure1Step"))
{
testStep = new CECntSetHeapFailure1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntResourceCount1Step"))
{
testStep = new CECntResourceCount1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntDbContactCount1Step"))
{
testStep = new CECntDbContactCount1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetDbViewContactType1Step"))
{
testStep = new CECntSetDbViewContactType1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewContactAtLength1Step"))
{
testStep = new CECntViewContactAtLength1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntRequestEvent1Step"))
{
testStep = new CECntRequestEvent1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCancelEventRequest1Step"))
{
testStep = new CECntCancelEventRequest1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntConnectionId1Step"))
{
testStep = new CECntConnectionId1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntMachineID1Step"))
{
testStep = new CECntMachineID1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntOverrideMachineID1Step"))
{
testStep = new CECntOverrideMachineID1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetPrefTemplateId1Step"))
{
testStep = new CECntGetPrefTemplateId1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntICCTemplateId1Step"))
{
testStep = new CECntICCTemplateId1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntPhonebookGroupId1Step"))
{
testStep = new CECntPhonebookGroupId1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCloseDataBase1Step"))
{
testStep = new CECntCloseDataBase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCloseDbTables1Step"))
{
testStep = new CECntCloseDbTables1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCancelAsyncOpenDatabase1Step"))
{
testStep = new CECntCancelAsyncOpenDatabase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFileUniqueId1Step"))
{
testStep = new CECntFileUniqueId1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntOpsTimeOut1Step"))
{
testStep = new CECntOpsTimeOut1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFilesSize1Step"))
{
testStep = new CECntFilesSize1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntMatchesHintField1Step"))
{
testStep = new CECntMatchesHintField1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetDefaultDatabaseName1Step"))
{
testStep = new CECntGetDefaultDatabaseName1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetCurrentDb1Step"))
{
testStep = new CECntGetCurrentDb1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntDatabaseDrive1Step"))
{
testStep = new CECntDatabaseDrive1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntDatabaseExists1Step"))
{
testStep = new CECntDatabaseExists1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetSortPrefs1Step"))
{
testStep = new CECntSetSortPrefs1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetOwnCard1Step"))
{
testStep = new CECntGetOwnCard1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFetchTemplateIds1Step"))
{
testStep = new CECntFetchTemplateIds1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFetchGroupIdLists1Step"))
{
testStep = new CECntFetchGroupIdLists1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntChangeViewDef1Step"))
{
testStep = new CECntChangeViewDef1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetSortPrefs1Step"))
{
testStep = new CECntGetSortPrefs1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemClose1Step"))
{
testStep = new CECntItemClose1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetDefinitionsForExistingView1Step"))
{
testStep = new CECntGetDefinitionsForExistingView1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntOpenViewSession1Step"))
{
testStep = new CECntOpenViewSession1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCloseViewSession1Step"))
{
testStep = new CECntCloseViewSession1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewChangeSortOrderL1Step"))
{
testStep = new CECntViewChangeSortOrderL1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntOpenViewSession2Step"))
{
testStep = new CECntOpenViewSession2Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCloseViewSession2Step"))
{
testStep = new CECntCloseViewSession2Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewChangeSortOrderL2Step"))
{
testStep = new CECntViewChangeSortOrderL2Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntOpenDataBase1Step"))
{
testStep = new CECntOpenDataBase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntReOpenDbTables1Step"))
{
testStep = new CECntReOpenDbTables1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCreateView1Step"))
{
testStep = new CECntCreateView1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCreateNamedView1Step"))
{
testStep = new CECntCreateNamedView1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewContactAt1Step"))
{
testStep = new CECntViewContactAt1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntAllFieldsText1Step"))
{
testStep = new CECntAllFieldsText1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetContactsMatchingFilter1Step"))
{
testStep = new CECntGetContactsMatchingFilter1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetContactMatchingCriteria1Step"))
{
testStep = new CECntGetContactMatchingCriteria1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetSpeedDialContactIdAndPhoneNumber1Step"))
{
testStep = new CECntGetSpeedDialContactIdAndPhoneNumber1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemRead1Step"))
{
testStep = new CECntItemRead1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntReadContactTextDef1Step"))
{
testStep = new CECntReadContactTextDef1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFilterDatabase1Step"))
{
testStep = new CECntFilterDatabase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFind1Step"))
{
testStep = new CECntFind1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFindAsyncInit1Step"))
{
testStep = new CECntFindAsyncInit1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFindAsyncTextDefInit1Step"))
{
testStep = new CECntFindAsyncTextDefInit1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntFindAsync1Step"))
{
testStep = new CECntFindAsync1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemAtL1Step"))
{
testStep = new CECntItemAtL1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntGetCollection1Step"))
{
testStep = new CECntGetCollection1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntListDatabases1Step"))
{
testStep = new CECntListDatabases1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewBeginIterate1Step"))
{
testStep = new CECntViewBeginIterate1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewEndIterate1Step"))
{
testStep = new CECntViewEndIterate1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntViewNextItemL1Step"))
{
testStep = new CECntViewNextItemL1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntCreateDatabase1Step"))
{
testStep = new CECntCreateDatabase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetPrefTemplateId1Step"))
{
testStep = new CECntSetPrefTemplateId1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetOwnCard1Step"))
{
testStep = new CECntSetOwnCard1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntReCreateTemplate1Step"))
{
testStep = new CECntReCreateTemplate1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetCurrentItem1Step"))
{
testStep = new CECntSetCurrentItem1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntRemoveCurrentItem1Step"))
{
testStep = new CECntRemoveCurrentItem1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetCurrentDb1Step"))
{
testStep = new CECntSetCurrentDb1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetSpeedDialIdForPosition1Step"))
{
testStep = new CECntSetSpeedDialIdForPosition1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntChangeViewSortOrder1Step"))
{
testStep = new CECntChangeViewSortOrder1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemOpen1Step"))
{
testStep = new CECntItemOpen1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntSetDatabaseDrive1Step"))
{
testStep = new CECntSetDatabaseDrive1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntReplaceDatabase1Step"))
{
testStep = new CECntReplaceDatabase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntDeleteDatabase1Step"))
{
testStep = new CECntDeleteDatabase1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemUpdate1Step"))
{
testStep = new CECntItemUpdate1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemCommit1Step"))
{
testStep = new CECntItemCommit1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemDelete1Step"))
{
testStep = new CECntItemDelete1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CECntItemCreate1Step"))
{
testStep = new CECntItemCreate1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CEBeginDbTransaction1Step"))
{
testStep = new CEBeginDbTransaction1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CEEndDbTransaction1Step"))
{
testStep = new CEEndDbTransaction1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CERollbackDbTransaction1Step"))
{
testStep = new CERollbackDbTransaction1Step ;
testStepFound = ETrue;
}
else if (aStepName == _L("CELockSrvNotSupported1Step"))
{
testStep = new CELockSrvNotSupported1Step ;
testStepFound = ETrue;
}
if (testStepFound && !testStep)
{
_LIT(KAllocationFailed,
"Could not allocate teststep in CTestTE_Cntsrv_API_PolicingServer::CreateTestStep()\n");
ERR_PRINTF1(KAllocationFailed);
User::Invariant();
}
return testStep;
}
// Secure variants much simpler
// Just an E32Main and a MainL()
LOCAL_C void MainL()
/**
* Secure variant
* Much simpler, uses the new Rendezvous() call to sync with the client
*/
{
#if (defined __DATA_CAGING__)
RProcess().DataCaging(RProcess::EDataCagingOn);
RProcess().DataCaging(RProcess::ESecureApiOn);
#endif
CActiveScheduler* sched=NULL;
sched=new(ELeave) CActiveScheduler;
CActiveScheduler::Install(sched);
// __EDIT_ME__ - Use your own server class name
CTestTE_Cntsrv_API_PolicingServer* server = NULL;
// Create the CTestServer derived server
TRAPD(err,server = CTestTE_Cntsrv_API_PolicingServer::NewL());
if(!err)
{
// Sync with the client and enter the active scheduler
RProcess::Rendezvous(KErrNone);
sched->Start();
}
delete server;
delete sched;
}
GLDEF_C TInt E32Main()
/**
* @return - Standard Epoc error code on process exit
* Secure variant only
* Process entry point. Called by client using RProcess API
*/
{
__UHEAP_MARK;
CTrapCleanup* cleanup = CTrapCleanup::New();
if(cleanup == NULL)
{
return KErrNoMemory;
}
TInt err = KErrNone;
TRAP(err,MainL());
delete cleanup;
__UHEAP_MARKEND;
return KErrNone;
}
TVerdict CCapabilityTestStep::doTestStepPreambleL( void )
{
//If Preamble is not required just pass a success value
TVerdict testResult = CTestStep::doTestStepPreambleL();
return TestStepResult();
}
TVerdict CCapabilityTestStep::doTestStepPostambleL( void )
{
//If Postamble is not required just pass a success value
TVerdict testResult = CTestStep::doTestStepPostambleL();
return TestStepResult();
}
// Moved from CStep.cpp
enum TVerdict CCapabilityTestStep::doTestStepL()
{
//DEF! INFO_PRINTF2(_L("%S - Starting ..."), &iTestStepName);
//The MainThread()creates a separate thread that executes SendReceive
TVerdict vResult = MainThread();
SetTestStepResult(vResult);
return TestStepResult();
}
/*
ThreadStartFn:
Called by: The Child thread
Function: Calls the Exec_SendReceive
*/
static TInt ThreadStartFn( TAny * ptr )
{
return(((CCapabilityTestStep *)ptr)->Exec_SendReceive());
}
/*
TVerdict GetVerdict(TInt aAPIretValue)
Called by: "MainThread" for returning verdict
Parameters(TInt aRetValue) : 0 if API call gets thru without any rejection
1 if API call is rejected for capability error
*/
enum TVerdict CCapabilityTestStep::GetVerdict(TInt aAPIretValue)
{
TVerdict vVerdict[] = {EPass, EFail};
//please leave the following if/else block as the information printed by INFO_PRINTF1 is used bu CapTestSumm
if(iExpect_Rejection)//[Inverse Test] EPass for 1 while EFail for 0
{
INFO_PRINTF1(_L("Test Expected to Fail due to lack of capabilities"));
return vVerdict[(aAPIretValue)?0:1];
}
else //[Direct Test] EPass for 0 while EFail for 1
{
INFO_PRINTF1(_L("Test Expected to Pass with correct capabilities"));
return vVerdict[(aAPIretValue)?1:0];
}
}
/*
TVerdict MainThread()
Called by: "doTestStepL"
Purpose: Creates the child thread(which calls the respective function with regard
to the server and also implements the Message Call). Then this fn.waits for the
completion of the childthread( doesnt matter how the thread did die!)
Return Value(Verdict of the TestStep):
A.Reporting PASS/FAIL
Direct Test:
When a message call gets thru. Please note that in such cases
actually the implementation of the message has started. As we
are passing "0" Parameters, server may panic, though our botheration
stops once the call gets thru.
NOTE: The style is the same when CONNECTION capabilities
are tested, the only diff is you dont have to expect a
panic from server
Inverse Test:
The call should be either failed or panicked with
"KErrPermissionDenied" flag.
General Case:
If a thread creation failed or if the server couldnt be connected
apart from the above two cases, then a FAIL is reported
B.Reporting INCONCLUSIVE
Any panic say from unexpected source (eg:KERN-EXEC) will be
reported INCONCLUSIVE
*/
TVerdict CCapabilityTestStep::MainThread()
{
TBuf<100> tExitCategory;
TInt tExitReason = 0;
TBuf<100> TestStyle;
iExpect_Rejection?TestStyle = _L("Inverse"):TestStyle = _L("Direct");
TCapabilitySet theCaps = TSecurityInfo(RProcess()).iCaps ;
const TInt KMaxTestThreadHeapSize = 0x10000;
//Initialize return values
iResult_SR = iResult_Server = KErrNone;
// Create a child thread, with a new heap
TInt nRes_Thread = tChildThread.Create(
ChildThread_SR,
ThreadStartFn,
KDefaultStackSize,
KMinHeapSize,
KMaxTestThreadHeapSize,
this,
EOwnerProcess);
if(nRes_Thread == KErrNone)//Thread Created
{
//Let me know when the thread is dead
TRequestStatus ThreadStatus;
tChildThread.Logon(ThreadStatus);
tChildThread.Resume();
//Is the thread dead?
User::WaitForRequest( ThreadStatus );
//yes, he is dead. RIP! Now the Killer's profile
tExitCategory = tChildThread.ExitCategory();
tExitReason = tChildThread.ExitReason();
//Somebody Please say what are we testing!!
if(iSessionCreated && (SR_MESSAGE_ID >=0))//Flag set by Child thread when connected to Server
{
//DEF INFO_PRINTF5(_L("Connected to Server(%S) for %S Test [MessageID: %d,Req.Cap: 0x%x,Present.Cap: 0x%x]"),&SR_ServerName,&TestStyle,SR_MESSAGE_ID,iStepCap,TSecurityInfo(RProcess()));
}
else if(SR_MESSAGE_ID < 0)
{
//DEF INFO_PRINTF5(_L("Testing Connection capabilities[%S Test] for Server(%S) [Req.Cap: 0x%x,Present.Cap: 0x%x]"),&TestStyle,
//&SR_ServerName,TSecurityInfo(RProcess()));
}
else if(!iSessionCreated)// NO Connection
{
INFO_PRINTF4(_L("Couldnt connect to the Server(%S) ErrorCode - ServerRet: %d C32ret: %d"),&SR_ServerName,iResult_Server,iResult_C32);
//INFO_PRINTF3(_L("Child Thread: ExitCategory : %S ExitReason : %d"),&tExitCategory,tExitReason);
return EFail;
}
switch(tChildThread.ExitType())
{
case EExitPanic:
//1.A Panic from the connected Server
//2.A CServer Panic normally for capability rejection
//3.A kernel Panic (consider yourself doomed!)
if((tExitReason == KErrPermissionDenied) ||
//DEF ? it's old version (tExitReason == CServer::EClientDoesntHaveRequiredCaps))//Rejected for Insufficient Cap.
// is it correct ?
(tExitReason == CServer2::EClientDoesntHaveRequiredCaps))//Rejected for Insufficient Cap.
{
INFO_PRINTF2(_L("Rejected for insufficient capabilities [Return Value : %d] "),tExitReason);
return(GetVerdict(API_RetValue_PermissionDenied));
}
else if(tExitCategory == iServer_Panic) //Panic from Server
{
INFO_PRINTF2(_L("Server(%S) Panic to child thread"),&tExitCategory);
INFO_PRINTF3(_L("Child Thread: ExitCategory : %S ExitReason : %d"),&tExitCategory,tExitReason);
return(GetVerdict(API_RetValue_ServerPanic));
}
else//A kernel Panic possibly
{
INFO_PRINTF3(_L("Child Thread: Panic from unexpected source (ExitCategory: %S ExitReason : %d)!"),&tExitCategory,tExitReason);
return EInconclusive;
}
case EExitKill:
if(iResult_SR != KErrPermissionDenied)
{
INFO_PRINTF2(_L("A Successfull call (Return Value : %d)"),((SR_MESSAGE_ID >=0)?iResult_SR:iResult_Server));
return(GetVerdict(API_RetValue_NoCapError));
}
else
{
INFO_PRINTF2(_L("Rejected for insufficient capabilities [Return Value : %d] "),((SR_MESSAGE_ID >=0)?iResult_SR:iResult_Server));
return(GetVerdict(API_RetValue_PermissionDenied));
}
default:
break;
}
}
else //Our thread couldnt start :o(
{
INFO_PRINTF2(_L("ERROR: Failed to create Child thread, ErrorCode:(%d)"),nRes_Thread);
return EFail;
}
return EInconclusive;
}
TInt CCapabilityTestStep::StartServer()
{
TInt err = KErrNone ;
// EKA2 is simple No path required
TBuf<32> serverFile;
serverFile.Copy(_L("CNTSRV"));
_LIT(KExe,".exe");
serverFile.Append(KExe);
RProcess server;
err = server.Create(serverFile,_L(""));
if(err != KErrNone)
return err;
// Synchronise with the server
TRequestStatus reqStatus;
server.Rendezvous(reqStatus);
server.Resume();
//Server will call the reciprocal static synchronise call
User::WaitForRequest(reqStatus);
//server.Close();
if(reqStatus.Int() != KErrNone)
return reqStatus.Int();
return err;
}
TInt CCapabilityTestStep::TestDebugHeap(TInt* iDbgIPCNo)
{
//TDbgFns {MarkHeapStart, MarkHeapEnd, CheckHeap, FailNext, ResetFailNext};
TInt aFnToTest= iDbgIPCNo[5];
TInt iResult_SR [6] ={0};
TInt i = 1;
TInt testedFn = 0;
TInt dbgTestSequence[5][6] = { {MarkHeapStart ,2,0,1,-1,-1},
{MarkHeapEnd ,2,0,1,-1,-1},
{CheckHeap ,3,0,2, 1,-1},
{FailNext ,4,0,3, 4, 1},
{ResetFailNext ,4,0,3, 4, 1}
};
TInt aCount = dbgTestSequence[aFnToTest][i];
while(aCount-- )
{
testedFn = dbgTestSequence[aFnToTest][(++i)];
iResult_SR[testedFn ]= SendReceive( iDbgIPCNo[testedFn],TIpcArgs(((iDbgIPCNo[testedFn]==3 )?4:0),0,0,0));
if( ((testedFn !=aFnToTest)?iResult_SR[testedFn]:KErrNone) == KErrPermissionDenied)
User::Panic(_L("Failed at Initialization"),iResult_SR[testedFn]);
}
return iResult_SR[aFnToTest];
}
|