Changeset 4025 for branches/GRACE/src/win32k/test/win32ktst.c
- Timestamp:
- Aug 17, 2000, 10:23:35 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GRACE/src/win32k/test/win32ktst.c
r4017 r4025 1 /* $Id: win32ktst.c,v 1.1.4. 3 2000-08-15 06:16:09bird Exp $1 /* $Id: win32ktst.c,v 1.1.4.4 2000-08-17 08:23:35 bird Exp $ 2 2 * 3 3 * Win32k test module. … … 582 582 case 1: rc = TestCase1(argc, argv); break; 583 583 case 2: rc = TestCase2(); break; 584 case 3: rc = TestCase3(); break; 584 585 585 586 default: … … 681 682 int rc = 1; 682 683 RP32INIT rpinit; 683 char * pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:Mixed -Script: No-W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000";684 char * pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:Mixed -Script:Yes -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000"; 684 685 685 686 /* $elf */ … … 701 702 opt.cbResHeapMax = 0x100000; 702 703 opt.fElf = TRUE; 703 opt.fUNIXScript = FALSE;704 opt.fUNIXScript = TRUE; 704 705 opt.fPE = FLAGS_PE_MIXED; 705 706 opt.fQuiet = TRUE; … … 709 710 710 711 rc = CompareOptions(SSToDS(&opt)); 712 if (rc == NO_ERROR) 713 { 714 rc = TestCaseExeLoad2(); 715 } 711 716 } 712 717 else … … 718 723 return rc; 719 724 } 725 726 /** 727 * Test case 3. 728 * Checks that all parameters are read correctly (1). 729 * 730 * @sketch Create init packet with no arguments. 731 * Initiate elf$ 732 * Create init packet with no arguments. 733 * Initiate win32k$ 734 * @returns 0 on success. 735 * 1 on failure. 736 * @status completely implemented. 737 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 738 */ 739 int TestCase3(void) 740 { 741 int rc = 1; 742 RP32INIT rpinit; 743 char * pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:PE -Script:Yes -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000"; 744 745 /* $elf */ 746 initRPInit(SSToDS(&rpinit), pszInitArgs); 747 rc = InitElf(&rpinit); /* no SSToDS! */ 748 printf("InitElf returned status=0x%04x\n", rpinit.rph.Status); 749 if ((rpinit.rph.Status & (STDON | STERR)) == STDON) 750 { 751 /* $win32k */ 752 initRPInit(SSToDS(&rpinit), pszInitArgs); 753 rc = InitWin32k(&rpinit); /* no SSToDS! */ 754 printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status); 755 if ((rpinit.rph.Status & (STDON | STERR)) == STDON) 756 { 757 struct options opt = DEFAULT_OPTION_ASSIGMENTS; 758 opt.cbSwpHeapInit = 512000; 759 opt.cbSwpHeapMax = 4096000; 760 opt.cbResHeapInit = 0256000; 761 opt.cbResHeapMax = 0x100000; 762 opt.fElf = TRUE; 763 opt.fUNIXScript = TRUE; 764 opt.fPE = FLAGS_PE_PE; 765 opt.fQuiet = TRUE; 766 opt.fLogging = FALSE; 767 opt.usCom = OUTPUT_COM1; 768 opt.ulInfoLevel = INFOLEVEL_INFOALL; 769 770 rc = CompareOptions(SSToDS(&opt)); 771 if (rc == NO_ERROR) 772 { 773 rc = TestCaseExeLoad2(); 774 } 775 } 776 else 777 printf("!failed!\n"); 778 } 779 else 780 printf("!failed!\n"); 781 782 return rc; 783 } 784 720 785 721 786 /** … … 739 804 if (options.fLogging != pOpt->fLogging) 740 805 printf("fLogging = %d - should be %d\n", options.fLogging, pOpt->fLogging, rc++); 741 if ( options.ulBuild != ~0UL)806 if (pOpt->ulBuild != ~0UL) 742 807 { 743 808 if (options.fKernel != pOpt->fKernel) … … 777 842 778 843 779 780 781 844 /** 782 845 * Simulates a executable loading (no errors). … … 804 867 * Do the real execution. 805 868 */ 806 printf("--- TestcaseExeLoad 1- loading win32ktst.exe (LX image) ----\n");869 printf("--- TestcaseExeLoad3 - loading win32ktst.exe (LX image) ----\n"); 807 870 rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "win32ktst.exe"); 808 871 if (rc == NO_ERROR) 809 872 { 810 873 psz = "BIN\\DEBUG\\LIBCONV.EXE\0"; 811 printf("--- TestcaseExeLoad 1- loading libconv.exe (LX image) ----\n");874 printf("--- TestcaseExeLoad3 - loading libconv.exe (LX image) ----\n"); 812 875 rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "bin\\debug\\libconv.exe"); 813 #if 0 //not implemented by CalltkExecPgm...??? 814 /* check result */ 815 if (memcmp(achTkExecPgmArguments, psz, strlen(psz) + 1) != 0) 876 if (rc == NO_ERROR) 816 877 { 817 rc = ERROR_BAD_ARGUMENTS; 818 printf("Bad Arguments! (%s)\n", achTkExecPgmArguments); 878 #if 0 //not implemented by CalltkExecPgm...??? 879 /* check result */ 880 if (memcmp(achTkExecPgmArguments, psz, strlen(psz) + 1) != 0) 881 { 882 rc = ERROR_BAD_ARGUMENTS; 883 printf("Bad Arguments! (%s)\n", achTkExecPgmArguments); 884 } 885 #else 886 psz = psz; 887 #endif 819 888 } 820 #else821 psz = psz;822 #endif823 889 } 824 890 … … 826 892 { 827 893 psz = "REXX\\TST.CMD\0OriginalArgument1 OriginalArgument2\0OriginalArgument3\0"; 828 printf("--- TestcaseExeLoad 1- loading rexx\\tst.cmd (REXX script) ----\n");894 printf("--- TestcaseExeLoad3 - loading rexx\\tst.cmd (REXX script) ----\n"); 829 895 rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "rexx\\tst.cmd"); 830 831 /* check result */ 832 psz[strlen(psz)] = ' '; 833 for (cch = 0; psz[cch] != '\0';) 834 cch += strlen(psz + cch) + 1; 835 cch++; 836 if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0) 896 if (rc == NO_ERROR) 837 897 { 838 rc = ERROR_BAD_ARGUMENTS; 839 printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1); 898 /* check result */ 899 psz = "REXX\\TST.CMD OriginalArgument1 OriginalArgument2\0OriginalArgument3\0"; 900 cch = strlen(psz); 901 if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0) 902 { 903 rc = ERROR_BAD_ARGUMENTS; 904 printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1); 905 } 840 906 } 841 907 } … … 844 910 { 845 911 psz = "TEST\\TST.SH\0OrgArg1 OrgArg2\0OrgArg3\0"; 846 printf("--- TestcaseExeLoad 1 - loading test\\testscript.sh (UNIX shell script) ----\n");912 printf("--- TestcaseExeLoad3 - loading test\\tst.sh (UNIX shell script) ----\n"); 847 913 rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "test\\tst.sh"); 848 849 /* check result */ 850 psz[strlen(psz)] = ' '; 851 for (cch = 0; psz[cch] != '\0';) 852 cch += strlen(psz + cch) + 1; 853 cch++; 854 if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0) 914 if (rc == NO_ERROR) 855 915 { 856 rc = ERROR_BAD_ARGUMENTS; 857 printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1); 916 /* check result */ 917 psz = "TEST\\TST.SH OrgArg1 OrgArg2\0OrgArg3\0"; 918 cch = strlen(psz); 919 if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0) 920 { 921 rc = ERROR_BAD_ARGUMENTS; 922 printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1); 923 } 858 924 } 859 925 } 860 926 861 862 927 if (rc == NO_ERROR) 863 928 { 864 printf("--- TestcaseExeLoad1 - loading SOL.EXE (PE image) ----\n"); 929 psz = "TEST\\TST2.SH\0OrgArg1 OrgArg2\0OrgArg3\0"; 930 printf("--- TestcaseExeLoad3 - loading test\\tst2.sh (UNIX shell script) ----\n"); 931 rc = CalltkExecPgm(EXEC_LOAD, psz, NULL, "test\\tst2.sh"); 932 if (rc == NO_ERROR) 933 { 934 /* check result */ 935 psz = "-arg1 -arg2 -arg3 TEST\\TST2.SH OrgArg1 OrgArg2\0OrgArg3\0"; 936 cch = strlen(psz) + 1; 937 if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0) 938 { 939 rc = ERROR_BAD_ARGUMENTS; 940 printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1); 941 } 942 } 943 } 944 945 if (rc == NO_ERROR) 946 { 947 printf("--- TestcaseExeLoad3 - loading SOL.EXE (PE image) ----\n"); 865 948 rc = CalltkExecPgm(EXEC_LOAD, NULL, NULL, "e:\\Win32Prog\\Sol\\Sol.exe"); 949 if (rc == NO_ERROR) 950 { 951 /* check result */ 952 psz = "E:\\WIN32PROG\\SOL\\SOL.EXE\0"; 953 cch = strlen(psz) + 1 + 1; 954 if (memcmp(achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1, psz, cch) != 0) 955 { 956 rc = ERROR_BAD_ARGUMENTS; 957 printf("Bad Arguments! (achTkExecPgmArguments=%s).\n", achTkExecPgmArguments + strlen(achTkExecPgmArguments) + 1); 958 } 959 } 866 960 } 867 961 … … 871 965 return rc; 872 966 } 967
Note:
See TracChangeset
for help on using the changeset viewer.