Changeset 4898 in CLRX


Ignore:
Timestamp:
Aug 14, 2019, 10:03:04 PM (2 months ago)
Author:
matszpk
Message:

CLRadeonExtender: ROCm: Add testcases for ROCm MsgPack? parser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/tests/amdbin/ROCmMsgPack.cpp

    r4897 r4898  
    7070        assertValue("MsgPack0", "tc2.DataPtr", dataPtr, tc2 + sizeof(tc2));
    7171    }
     72   
     73    const cxbyte tc3[2] = { 0x91, 0x21 };
     74    dataPtr = tc3;
     75    {
     76        MsgPackArrayParser arrParser(dataPtr, dataPtr + sizeof(tc3));
     77        assertValue("MsgPack0", "tc3.value0", uint64_t(33),
     78                   arrParser.parseInteger(MSGPACK_WS_UNSIGNED));
     79        assertValue("MsgPack0", "tc3.DataPtr", dataPtr, tc3 + sizeof(tc3));
     80    }
     81    dataPtr = tc3;
     82    {
     83        MsgPackArrayParser arrParser(dataPtr, dataPtr + sizeof(tc3)-1);
     84        assertCLRXException("MsgPack0", "tc3_1.Ex", "MsgPack: Can't parse integer value",
     85                    [&arrParser]() { arrParser.parseInteger(MSGPACK_WS_UNSIGNED); });
     86        assertValue("MsgPack0", "tc3_1.DataPtr", dataPtr, tc3 + sizeof(tc3)-1);
     87    }
     88    const cxbyte tc4[2] = { 0x91, 0x5b };
     89    dataPtr = tc4;
     90    {
     91        MsgPackArrayParser arrParser(dataPtr, dataPtr + sizeof(tc4));
     92        assertValue("MsgPack0", "tc4.value0", uint64_t(91),
     93                   arrParser.parseInteger(MSGPACK_WS_UNSIGNED));
     94        assertValue("MsgPack0", "tc4.DataPtr", dataPtr, tc4 + sizeof(tc4));
     95    }
    7296}
    7397
Note: See TracChangeset for help on using the changeset viewer.