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"); }
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; }
PARCHashCode parcStopwatch_HashCode(const PARCStopwatch *timer) { PARCHashCode result = parcHashCode_Hash((uint8_t *) timer, sizeof(PARCStopwatch)); return result; }
PARCHashCode parcTimer_HashCode(const PARCTimer *timer) { PARCHashCode result = parcHashCode_Hash((uint8_t *) timer, sizeof(PARCTimer)); return result; }