25 FO_ASSERT_EQUAL(Digits, 2);
42 memset(Fuid,0,
sizeof(Fuid));
49 for(i=0; i<20; i++) { sprintf(Fuid+0+i*2,
"%02X",SumTest->
SHA1digest[i]); }
51 for(i=0; i<16; i++) { sprintf(Fuid+41+i*2,
"%02X",SumTest->
MD5digest[i]); }
53 snprintf(Fuid+74,
sizeof(Fuid)-74,
"%Lu",(
long long unsigned int)SumTest->
DataLen);
55 FO_ASSERT_STRING_EQUAL(Fuid,
"5CBBD4E0487601E9160A5C887E5C0C1E6541B3DE.5234FC4D5F9786A51B2206B9DEEACA68.825");
56 FO_ASSERT_EQUAL((
int)SumTest->
DataLen, 825);
84 FO_ASSERT_STRING_EQUAL(Fuid,
"5CBBD4E0487601E9160A5C887E5C0C1E6541B3DE.5234FC4D5F9786A51B2206B9DEEACA68.825");
char * SumToString(Cksum *Sum)
Return string representing a Cksum. NOTE: The calling function must free() the string!
int CountDigits(uint64_t Num)
Count how many digits are in a number.
Cksum * SumComputeFile(FILE *Fin)
Compute the checksum, allocate and return a string containing the sum value.
Store check sum of a file.
uint8_t SHA1digest[20]
SHA1 digest of the file.
uint64_t DataLen
Size of the file.
uint8_t MD5digest[16]
MD5 digest of the file.
CU_TestInfo Checksum_testcases[]
Checksum test cases.
void testSumToString()
test function SumToString
void testCountDigits()
test function CountDigits
void testSumComputeFile()
test function SumComputeFile