Example #1
0
LONGBOW_TEST_CASE(JSON, parcJSON_HashCode)
{
    TestData *data = longBowTestCase_GetClipBoardData(testCase);

    PARCHashCode expected = parcHashCode_Hash((uint8_t *)data->compactExpected, strlen(data->compactExpected));

    PARCHashCode hashCode = parcJSON_HashCode(data->json);

    assertTrue(hashCode == expected, "Expect correct hash code");
}
Example #2
0
PARCHashCode
parcBuffer_HashCode(const PARCBuffer *buffer)
{
    PARCHashCode result = 0;

    size_t remaining = parcBuffer_Remaining(buffer);
    if (remaining > 0) {
        result = parcHashCode_Hash(parcBuffer_Overlay((PARCBuffer *) buffer, 0), parcBuffer_Remaining(buffer));
    }
    return result;
}
Example #3
0
PARCHashCode
parcStopwatch_HashCode(const PARCStopwatch *timer)
{
    PARCHashCode result = parcHashCode_Hash((uint8_t *) timer, sizeof(PARCStopwatch));
    return result;
}
Example #4
0
PARCHashCode
parcTimer_HashCode(const PARCTimer *timer)
{
    PARCHashCode result = parcHashCode_Hash((uint8_t *) timer, sizeof(PARCTimer));
    return result;
}