Ignore:
Timestamp:
Aug 14, 2000, 10:57:07 AM (25 years ago)
Author:
bird
Message:

Corrections...
Testing is now done with real kernel image!!!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GRACE/src/win32k/test/win32ktst.c

    r3984 r4010  
    1 /* $Id: win32ktst.c,v 1.1.4.1 2000-08-11 02:22:35 bird Exp $
     1/* $Id: win32ktst.c,v 1.1.4.2 2000-08-14 08:57:07 bird Exp $
    22 *
    33 * Win32k test module.
     
    2626    (PVOID)( ( (((unsigned)(flataddr) << 3) & 0xfff80000) | (SEL_LDT_RPL3 << 16) ) | ((unsigned)(flataddr) & 0xffff) )
    2727
     28#define DWORD   ULONG
     29#define WORD    USHORT
     30
    2831/*******************************************************************************
    2932*   Internal Functions                                                         *
    3033*******************************************************************************/
    3134#include <os2.h>
     35#include <exe386.h>
    3236
    3337#include "malloc.h"
     
    133137 */
    134138
    135 
    136139/*******************************************************************************
    137 *   Internal Functions                                                         *
     140*   Structures and Typedefs                                                    *
    138141*******************************************************************************/
    139 void    syntax(void);
    140 void    workersinit(void);
    141 void    initRPInit(RP32INIT *pRpInit, char *pszInitArgs);
    142 int     tests(int iTest, int argc, char **argv);
    143 int     TestCase1(void);
    144 int     TestCase2(void);
    145 int     TestCase3(void);
    146 int     TestCase4(void);
    147 int     TestCase5(void);
    148 int     CompareOptions(struct options *pOpt);
    149 int     TestCaseExeLoad1(void);
     142#ifndef QS_MTE
     143   /* From OS/2 Toolkit v4.5 (BSEDOS.H) */
     144
     145   /* Global Record structure
     146    * Holds all global system information. Placed first in user buffer
     147    */
     148   typedef struct qsGrec_s {  /* qsGrec */
     149           ULONG         cThrds;
     150           ULONG         c32SSem;
     151           ULONG         cMFTNodes;
     152   }qsGrec_t;
     153
     154   /*
     155    *      System wide MTE information
     156    *      ________________________________
     157    *      |       pNextRec                |----|
     158    *      |-------------------------------|    |
     159    *      |       hmte                    |    |
     160    *      |-------------------------------|    |
     161    *      |       ctImpMod                |    |
     162    *      |-------------------------------|    |
     163    *      |       ctObj                   |    |
     164    *      |-------------------------------|    |
     165    *      |       pObjInfo                |----|----------|
     166    *      |-------------------------------|    |          |
     167    *      |       pName                   |----|----|     |
     168    *      |-------------------------------|    |    |     |
     169    *      |       imported module handles |    |    |     |
     170    *      |          .                    |    |    |     |
     171    *      |          .                    |    |    |     |
     172    *      |          .                    |    |    |     |
     173    *      |-------------------------------| <--|----|     |
     174    *      |       "pathname"              |    |          |
     175    *      |-------------------------------| <--|----------|
     176    *      |       Object records          |    |
     177    *      |       (if requested)          |    |
     178    *      |_______________________________|    |
     179    *                                      <-----
     180    *      NOTE that if the level bit is set to QS_MTE, the base Lib record will be followed
     181    *      by a series of object records (qsLObj_t); one for each object of the
     182    *      module.
     183    */
     184
     185   typedef struct qsLObjrec_s {  /* qsLOrec */
     186           ULONG         oaddr;  /* object address */
     187           ULONG         osize;  /* object size */
     188           ULONG         oflags; /* object flags */
     189   } qsLObjrec_t;
     190
     191   typedef struct qsLrec_s {     /* qsLrec */
     192           void  FAR        *pNextRec;      /* pointer to next record in buffer */
     193           USHORT           hmte;           /* handle for this mte */
     194           USHORT           fFlat;          /* true if 32 bit module */
     195           ULONG            ctImpMod;       /* # of imported modules in table */
     196           ULONG            ctObj;          /* # of objects in module (mte_objcnt)*/
     197           qsLObjrec_t FAR  *pObjInfo;      /* pointer to per object info if any */
     198           UCHAR     FAR    *pName;         /* -> name string following struc */
     199   } qsLrec_t;
     200
     201
     202
     203   /* Pointer Record Structure
     204    *      This structure is the first in the user buffer.
     205    *      It contains pointers to heads of record types that are loaded
     206    *      into the buffer.
     207    */
     208
     209   typedef struct qsPtrRec_s {   /* qsPRec */
     210           qsGrec_t        *pGlobalRec;
     211           void            *pProcRec;      /* ptr to head of process records */
     212           void            *p16SemRec;     /* ptr to head of 16 bit sem recds */
     213           void            *p32SemRec;     /* ptr to head of 32 bit sem recds */
     214           void            *pMemRec;       /* ptr to head of shared mem recs */
     215           qsLrec_t        *pLibRec;       /* ptr to head of mte records */
     216           void            *pShrMemRec;    /* ptr to head of shared mem records */
     217           void            *pFSRec;        /* ptr to head of file sys records */
     218   } qsPtrRec_t;
     219
     220#endif
    150221
    151222
     
    156227const char *    pszInternalRevision = "\r\nInternal revision 14.040_W4";
    157228int             cObjectsFake = 14;
    158 
     229OTE             aKrnlOTE[24];
     230
     231
     232/*******************************************************************************
     233*   External Functions                                                         *
     234*******************************************************************************/
     235#ifndef QS_MTE
     236   /* from OS/2 Toolkit v4.5 */
     237
     238   APIRET APIENTRY DosQuerySysState(ULONG EntityList, ULONG EntityLevel, PID pid,
     239                                    TID tid, PVOID pDataBuf, ULONG cbBuf);
     240    #define QS_MTE         0x0004
     241#endif
     242
     243/*******************************************************************************
     244*   Internal Functions                                                         *
     245*******************************************************************************/
     246void    syntax(void);
     247int     kernelInit(int iTest, int argc, char **argv);
     248void    workersinit(void);
     249void    initRPInit(RP32INIT *pRpInit, char *pszInitArgs);
     250int     tests(int iTest, int argc, char **argv);
     251int     TestCase1(int argc, char **argv);
     252int     TestCase2(void);
     253int     TestCase3(void);
     254int     TestCase4(void);
     255int     TestCase5(void);
     256int     TestCase6(void);
     257int     CompareOptions(struct options *pOpt);
     258int     TestCaseExeLoad2(void);
    159259
    160260
     
    188288    workersinit();
    189289
     290    /*
     291     * Init Kernel
     292     */
     293    if (!kernelInit(iTest, argc, argv))
     294        return -2;
    190295
    191296    /*
     
    227332}
    228333
     334
     335/**
     336 * test case 1: Load the specified kernel
     337 * other cases: Load running kernel.
     338 * @returns Success indicator. (true/false)
     339 * @param   iTest   Testcase number.
     340 * @param   argc    main argc
     341 * @param   argv    main argv
     342 * @status  completely implemented.
     343 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     344 */
     345int     kernelInit(int iTest, int argc, char **argv)
     346{
     347    static char     achBuffer[1024*256];
     348    char            szError[256];
     349    HMODULE         hmod = NULLHANDLE;
     350    int             rc;
     351    char            szName[CCHMAXPATH];
     352    char *          pszSrcName;
     353    char *          pszTmp;
     354    ULONG           ulAction;
     355    HFILE           hFile;
     356    struct e32_exe* pe32 = (struct e32_exe*)(void*)&achBuffer[0];
     357    qsPtrRec_t *    pPtrRec = (qsPtrRec_t*)(void*)&achBuffer[0];
     358    qsLrec_t *      pLrec;
     359    int             i;
     360    FILESTATUS3     fsts3;
     361
     362    /*
     363     * If not testcase 1, use the running kernel.
     364     */
     365    if (iTest != 1)
     366    {
     367        ULONG   ulBootDrv = 3;
     368        pszSrcName = "c:\\os2krnl";
     369        DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, SSToDS(&ulBootDrv), sizeof(ulBootDrv));
     370        pszSrcName[0] = (char)(ulBootDrv + 'a' - 1);
     371    }
     372    else
     373    {
     374        if (argc < 3)
     375        {
     376            printf("Missing parameter!\n");
     377            return FALSE;
     378        }
     379        pszSrcName = argv[2];
     380    }
     381
     382    /*
     383     * Make a temporary copy of the kernel.
     384     */
     385    if (DosScanEnv("TMP", &pszTmp) != NO_ERROR || pszTmp == NULL)
     386    {
     387        printf("Environment variable TMP is not set.\n");
     388        return FALSE;
     389    }
     390    strcpy(szName, pszTmp);
     391    if (szName[strlen(pszTmp) - 1] != '\\' && szName[strlen(pszTmp) - 1] != '/')
     392        strcat(szName, "\\");
     393    strcat(szName, "os2krnl");
     394    rc = DosCopy(pszSrcName, szName, DCPY_EXISTING);
     395    if (rc != NO_ERROR)
     396    {
     397        printf("Failed to copy %s to %s.\n", pszSrcName, szName);
     398        return FALSE;
     399    }
     400    if (DosQueryPathInfo(szName, FIL_STANDARD, &fsts3, sizeof(fsts3)) != NO_ERROR
     401        ||  !(fsts3.attrFile = FILE_ARCHIVED)
     402        ||  DosSetPathInfo(szName, FIL_STANDARD, &fsts3, sizeof(fsts3), 0) != NO_ERROR
     403        )
     404    {
     405        printf("Failed to set attributes for %s.\n", szName);
     406        return FALSE;
     407    }
     408
     409    /*
     410     * Patch the kernel.
     411     *      Remove the entrypoint.
     412     */
     413    ulAction = 0;
     414    rc = DosOpen(szName, &hFile, &ulAction, 0, FILE_NORMAL,
     415                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
     416                 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE,
     417                 NULL);
     418    if (rc != NO_ERROR)
     419    {
     420        printf("Failed to open temporary kernel file. rc = %d\n", rc);
     421        return FALSE;
     422    }
     423    rc = DosRead(hFile, &achBuffer[0], 0x200, &ulAction);
     424    if (rc != NO_ERROR)
     425    {
     426        DosClose(hFile);
     427        printf("Failed to read LX header from temporary kernel file.\n");
     428        return FALSE;
     429    }
     430    pe32 = (struct e32_exe*)(void*)&achBuffer[*(unsigned long*)(void*)&achBuffer[0x3c]];
     431    if (*(PUSHORT)pe32->e32_magic != E32MAGIC)
     432    {
     433        DosClose(hFile);
     434        printf("Failed to read LX header from temporary kernel file (2).\n");
     435        return FALSE;
     436    }
     437    pe32->e32_eip = 0;
     438    pe32->e32_startobj = 0;
     439    pe32->e32_mflags &= ~(E32LIBTERM | E32LIBINIT);
     440    if ((rc = DosSetFilePtr(hFile, *(unsigned long*)(void*)&achBuffer[0x3c], FILE_BEGIN, &ulAction)) != NO_ERROR
     441        || (rc = DosWrite(hFile, pe32, sizeof(struct e32_exe), &ulAction)) != NO_ERROR)
     442    {
     443        DosClose(hFile);
     444        printf("Failed to write patched LX header to temporary kernel file.\n");
     445        return FALSE;
     446    }
     447    DosClose(hFile);
     448
     449    /*
     450     * Load the module.
     451     */
     452    rc = DosLoadModule(szError, sizeof(szError), szName, SSToDS(&hmod));
     453    if (rc != NO_ERROR && (rc != ERROR_INVALID_PARAMETER && hmod == NULLHANDLE))
     454    {
     455        printf("Failed to load OS/2 kernel image %s.");
     456        return FALSE;
     457    }
     458
     459    /*
     460     * Get object information.
     461     */
     462    rc = DosQuerySysState(QS_MTE, QS_MTE, 0L, 0L, pPtrRec, sizeof(achBuffer));
     463    if (rc != NO_ERROR)
     464    {
     465        printf("DosQuerySysState failed with rc=%d.\n", rc);
     466        return FALSE;
     467    }
     468
     469    pLrec = pPtrRec->pLibRec;
     470    while (pLrec != NULL)
     471    {
     472        /*
     473         * Bug detected in OS/2 FP13. Probably a problem which occurs
     474         * in _LDRSysMteInfo when qsCheckCache is calle before writing
     475         * object info. The result is that the cache flushed and the
     476         * attempt of updating the qsLrec_t next and object pointer is
     477         * not done. This used to work earlier and on Aurora AFAIK.
     478         *
     479         * The fix for this problem is to check if the pObjInfo is NULL
     480         * while the number of objects isn't 0 and correct this. pNextRec
     481         * will also be NULL at this time. This will be have to corrected
     482         * before we exit the loop or moves to the next record.
     483         * There is also a nasty alignment of the object info... Hope
     484         * I got it right. (This aligment seems new to FP13.)
     485         */
     486        if (pLrec->pObjInfo == NULL /*&& pLrec->pNextRec == NULL*/ && pLrec->ctObj > 0)
     487            {
     488            pLrec->pObjInfo = (qsLObjrec_t*)(void*)(
     489                (char*)(void*)pLrec
     490                + ((sizeof(qsLrec_t)                            /* size of the lib record */
     491                   + pLrec->ctImpMod * sizeof(short)            /* size of the array of imported modules */
     492                   + strlen((char*)(void*)pLrec->pName) + 1     /* size of the filename */
     493                   + 3) & ~3));                                 /* the size is align on 4 bytes boundrary */
     494            pLrec->pNextRec = (qsLrec_t*)(void*)((char*)(void*)pLrec->pObjInfo
     495                                                 + sizeof(qsLObjrec_t) * pLrec->ctObj);
     496            }
     497        if (pLrec->hmte == hmod)
     498            break;
     499
     500        /*
     501         * Next record
     502         */
     503        pLrec = (qsLrec_t*)pLrec->pNextRec;
     504    }
     505
     506    if (pLrec == NULL)
     507    {
     508        printf("DosQuerySysState(os2krnl): not found\n");
     509        return FALSE;
     510    }
     511    if (pLrec->pObjInfo == NULL)
     512    {
     513        printf("DosQuerySysState(os2krnl): no object info\n");
     514        return FALSE;
     515    }
     516
     517    /*
     518     * Fill the aKrnlOTE array.
     519     */
     520    for (i = 0; i < pLrec->ctObj; i++)
     521    {
     522        aKrnlOTE[i].ote_size    = pLrec->pObjInfo[i].osize;
     523        aKrnlOTE[i].ote_base    = pLrec->pObjInfo[i].oaddr;
     524        aKrnlOTE[i].ote_flags   = pLrec->pObjInfo[i].oflags;
     525        aKrnlOTE[i].ote_pagemap = i > 0 ? aKrnlOTE[i-1].ote_pagemap + aKrnlOTE[i-1].ote_mapsize : 0;
     526        aKrnlOTE[i].ote_mapsize = (pLrec->pObjInfo[i].osize + 0x0FFF) / 0x1000;
     527        aKrnlOTE[i].ote_sel     = (USHORT)FlatToSel(pLrec->pObjInfo[i].oaddr);
     528        aKrnlOTE[i].ote_hob     = 0;
     529    }
     530    cObjectsFake = pLrec->ctObj;
     531
     532    return TRUE;
     533}
    229534
    230535/**
     
    275580    switch (iTest)
    276581    {
    277         case 1:     rc = TestCase1();   break;
     582        case 1:     rc = TestCase1(argc, argv);   break;
    278583        case 2:     rc = TestCase2();   break;
    279         case 3:     rc = TestCase3();   break;
    280         case 4:     rc = TestCase4();   break;
    281         case 5:     rc = TestCase5();   break;
    282584
    283585        default:
     
    296598/**
    297599 * Test case 1.
    298  * Checks that default initiation works fine for Aurora SMP kernels.
     600 * Checks that default initiation works fine for a given kernel.
     601 *
     602 * Syntax:  win32ktst.exe 1 <os2krnl> <majorver> <minorver> <build> <kerneltype: S|U|4> [os2krnl.sym]
    299603 *
    300604 * @sketch  Create init packet with no arguments.
     
    307611 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    308612 */
    309 int TestCase1(void)
    310 {
     613int TestCase1(int argc, char **argv)
     614{
     615    static char szInitArgs[CCHMAXPATH + 10];
    311616    int         rc = 1;
    312617    RP32INIT    rpinit;
    313618
     619    /* verify argument count */
     620    if (argc < 7 || argc > 8)
     621    {
     622        printf("Invalid parameter count for testcase 1.\n");
     623        return ERROR_INVALID_PARAMETER;
     624    }
     625
    314626    /* init fake variabels */
    315     pszInternalRevision ="\r\nInternal revision 14.040_SMP";
    316     cObjectsFake = 15;
    317     _usFakeVerMajor = 20;
    318     _usFakeVerMinor = 45;
     627    _usFakeVerMajor = (USHORT)atoi(argv[3]);
     628    _usFakeVerMinor = (USHORT)atoi(argv[4]);
     629
     630    /* make init string */
     631    strcpy(szInitArgs, "-w3");
     632    if (argc >= 8)
     633        strcat(strcat(szInitArgs, " -S:"), argv[7]);
    319634
    320635    /* $elf */
    321     initRPInit(SSToDS(&rpinit), "-w3");
     636    initRPInit(SSToDS(&rpinit), szInitArgs);
    322637    rc = InitElf(&rpinit);              /* no SSToDS! */
    323638    printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
     
    325640    {
    326641        /* $win32k */
    327         initRPInit(SSToDS(&rpinit), "-w3");
     642        initRPInit(SSToDS(&rpinit), szInitArgs);
    328643        rc = InitWin32k(&rpinit);       /* no SSToDS! */
    329644        printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
     
    331646        {
    332647            struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    333             opt.fKernel = KF_SMP;
    334             opt.ulBuild = 14040;
    335             opt.usVerMajor = 20;
    336             opt.usVerMinor = 45;
    337648            opt.ulInfoLevel = 3;
     649            opt.fKernel = argv[6][0] == 'S' ? KF_SMP : (argv[6][0] == '4' ? KF_W4 : KF_UNI);
     650            opt.ulBuild = atoi(argv[5]);
     651            opt.usVerMajor = (USHORT)atoi(argv[3]);
     652            opt.usVerMinor = (USHORT)atoi(argv[4]);
    338653
    339654            rc = CompareOptions(SSToDS(&opt));
    340             if (rc == NO_ERROR)
    341             {
    342                 rc = TestCaseExeLoad1();
    343             }
    344655        }
    345656        else
     
    352663}
    353664
    354 
    355665/**
    356666 * Test case 2.
    357  * Checks that default initiation works fine for Aurora UNI kernels.
     667 * Checks that all parameters are read correctly (1).
    358668 *
    359669 * @sketch  Create init packet with no arguments.
     
    370680    int         rc = 1;
    371681    RP32INIT    rpinit;
    372 
    373     /* init fake variabels */
    374     pszInternalRevision ="\r\nInternal revision 14.040_UNI";
    375     cObjectsFake = 14;
    376     _usFakeVerMajor = 20;
    377     _usFakeVerMinor = 45;
    378 
    379     /* $elf */
    380     initRPInit(SSToDS(&rpinit), "");
    381     rc = InitElf(&rpinit);              /* no SSToDS! */
    382     printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
    383     if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    384     {
    385         /* $win32k */
    386         initRPInit(SSToDS(&rpinit), "");
    387         rc = InitWin32k(&rpinit);       /* no SSToDS! */
    388         printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
    389         if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    390         {
    391             struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    392             opt.fKernel = KF_UNI;
    393             opt.ulBuild = 14040;
    394             opt.usVerMajor = 20;
    395             opt.usVerMinor = 45;
    396 
    397             rc = CompareOptions(SSToDS(&opt));
    398         }
    399         else
    400             printf("!failed!\n");
    401     }
    402     else
    403         printf("!failed!\n");
    404 
    405     return rc;
    406 }
    407 
    408 
    409 /**
    410  * Test case 3.
    411  * Checks that default initiation works fine for Warp FP13 kernel.
    412  *
    413  * @sketch  Create init packet with no arguments.
    414  *          Initiate elf$
    415  *          Create init packet with no arguments.
    416  *          Initiate win32k$
    417  * @returns 0 on success.
    418  *          1 on failure.
    419  * @status  completely implemented.
    420  * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    421  */
    422 int TestCase3(void)
    423 {
    424     int         rc = 1;
    425     RP32INIT    rpinit;
    426 
    427     /* init fake variabels */
    428     pszInternalRevision ="\r\nInternal revision 14.040_W4";
    429     cObjectsFake = 14;
    430     _usFakeVerMajor = 20;
    431     _usFakeVerMinor = 45;
    432 
    433     /* $elf */
    434     initRPInit(SSToDS(&rpinit), "");
    435     rc = InitElf(&rpinit);              /* no SSToDS! */
    436     printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
    437     if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    438     {
    439         /* $win32k */
    440         initRPInit(SSToDS(&rpinit), "");
    441         rc = InitWin32k(&rpinit);       /* no SSToDS! */
    442         printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
    443         if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    444         {
    445             struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    446             opt.fKernel = KF_UNI | KF_W4;
    447             opt.ulBuild = 14040;
    448             opt.usVerMajor = 20;
    449             opt.usVerMinor = 45;
    450 
    451             rc = CompareOptions(SSToDS(&opt));
    452         }
    453         else
    454             printf("!failed!\n");
    455     }
    456     else
    457         printf("!failed!\n");
    458 
    459     return rc;
    460 }
    461 
    462 
    463 /**
    464  * Test case 4.
    465  * Checks that default initiation works fine for Aurora SMP kernels.
    466  *
    467  * @sketch  Create init packet with no arguments.
    468  *          Initiate elf$
    469  *          Create init packet with no arguments.
    470  *          Initiate win32k$
    471  * @returns 0 on success.
    472  *          1 on failure.
    473  * @status  completely implemented.
    474  * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    475  */
    476 int TestCase4(void)
    477 {
    478     int         rc = 1;
    479     RP32INIT    rpinit;
    480 
    481     /* init fake variabels */
    482     pszInternalRevision ="\r\nInternal revision 9.036";
    483     cObjectsFake = 14;
    484     _usFakeVerMajor = 20;
    485     _usFakeVerMinor = 40;
    486 
    487     /* $elf */
    488     initRPInit(SSToDS(&rpinit), "");
    489     rc = InitElf(&rpinit);              /* no SSToDS! */
    490     printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
    491     if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    492     {
    493         /* $win32k */
    494         initRPInit(SSToDS(&rpinit), "");
    495         rc = InitWin32k(&rpinit);       /* no SSToDS! */
    496         printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
    497         if ((rpinit.rph.Status & (STDON | STERR)) == STDON)
    498         {
    499             struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    500             opt.fKernel     = KF_UNI;
    501             opt.ulBuild     = 9036;
    502             opt.usVerMajor  = 20;
    503             opt.usVerMinor  = 40;
    504 
    505             rc = CompareOptions(SSToDS(&opt));
    506         }
    507         else
    508             printf("!failed!\n");
    509     }
    510     else
    511         printf("!failed!\n");
    512 
    513     return rc;
    514 }
    515 
    516 
    517 /**
    518  * Test case 5.
    519  * Checks that all parameters are read correctly (1) (Warp FP13 kernel).
    520  *
    521  * @sketch  Create init packet with no arguments.
    522  *          Initiate elf$
    523  *          Create init packet with no arguments.
    524  *          Initiate win32k$
    525  * @returns 0 on success.
    526  *          1 on failure.
    527  * @status  completely implemented.
    528  * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    529  */
    530 int TestCase5(void)
    531 {
    532     int         rc = 1;
    533     RP32INIT    rpinit;
    534682    char *      pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:Mixed -Script:No -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000";
    535 
    536     /* init fake variabels */
    537     pszInternalRevision ="\r\nInternal revision 14.040_W4";
    538     cObjectsFake = 14;
    539     _usFakeVerMajor = 20;
    540     _usFakeVerMinor = 45;
    541683
    542684    /* $elf */
     
    553695        {
    554696            struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    555             opt.fKernel         = KF_UNI | KF_W4;
    556             opt.ulBuild         = 14040;
    557             opt.usVerMajor      = 20;
    558             opt.usVerMinor      = 45;
    559697            opt.cbSwpHeapInit   = 512000;
    560698            opt.cbSwpHeapMax    = 4096000;
     
    600738    if (options.fLogging != pOpt->fLogging)
    601739        printf("fLogging = %d - should be %d\n", options.fLogging, pOpt->fLogging, rc++);
    602     if (options.fKernel != pOpt->fKernel)
    603         printf("fKernel = %d - should be %d\n", options.fKernel, pOpt->fKernel, rc++);
    604     if (options.ulBuild != pOpt->ulBuild)
    605         printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++);
    606     if (options.usVerMajor != pOpt->usVerMajor)
    607         printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++);
    608     if (options.usVerMinor != pOpt->usVerMinor)
    609         printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++);
     740    if (options.ulBuild != ~0UL)
     741    {
     742        if (options.fKernel != pOpt->fKernel)
     743            printf("fKernel = %d - should be %d\n", options.fKernel, pOpt->fKernel, rc++);
     744        if (options.ulBuild != pOpt->ulBuild)
     745            printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++);
     746        if (options.usVerMajor != pOpt->usVerMajor)
     747            printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++);
     748        if (options.usVerMinor != pOpt->usVerMinor)
     749            printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++);
     750    }
    610751    if (options.fPE != pOpt->fPE)
    611752        printf("fPE = %d - should be %d\n", options.fPE, pOpt->fPE, rc++);
     
    649790 * @remark
    650791 */
    651 int TestCaseExeLoad1(void)
     792int TestCaseExeLoad2(void)
    652793{
    653794    APIRET rc;
Note: See TracChangeset for help on using the changeset viewer.