void CheckData(RegistrarClient& client) { char* result; result = static_cast<char*>(client.ReadData(kKey1)); assert( ! memcmp(result, kData1.c_str(), kData1.size()) ); free(result); result = static_cast<char*>(client.ReadData(kKey2)); assert( ! memcmp(result, kData2, sizeof(kData2)) ); free(result); }
void CheckData(RegistrarClient& client) { Package result = client.ReadData(kKey1); assert( ! memcmp(result.GetData(), kData1.c_str(), kData1.size()) ); result.FreeData(); result = client.ReadData(kKey2); assert( ! memcmp(result.GetData(), kData2, sizeof(kData2)) ); result.FreeData(); result = client.ReadData(kKey3); assert( result.GetData() == NULL ); }
void InitData(RegistrarClient& client) { client.WriteData(kKey1, Package(kData1.c_str(), kData1.size())); client.WriteData(kKey2, Package(&kData2, sizeof(kData2))); }
void CheckData(RegistrarClient& client) { Package result = client.ReadData(kKey); assert( ! memcmp(result.GetData(), kData, sizeof(kData)) ); result.FreeData(); }
void InitData(RegistrarClient& client) { client.WriteData(kKey, Package(&kData, sizeof(kData))); }
void InitData(RegistrarClient& client) { client.WriteData(kKey1, const_cast<char*>(kData1.c_str()), kData1.size()); client.WriteData(kKey2, &kData2, sizeof(kData2)); }