Fix a couple of twtest-only valgrind issues

This commit is contained in:
Brian Cox 2017-09-01 19:43:05 -07:00
parent 7a262bf1c1
commit 736a761bff
2 changed files with 16 additions and 5 deletions

View File

@ -44,9 +44,13 @@ void TestCrypto()
const int BUFSIZE = 9000;
char source[BUFSIZE];
char crypt[COUNT + BUFSIZE]; // needs to be able to hold even number of blocks
char dest[COUNT];
std::vector<char> source_buf(BUFSIZE);
std::vector<char> crypt_buf(COUNT + BUFSIZE); // needs to be able to hold even number of blocks
std::vector<char> dest_buf(COUNT);
char* source = &source_buf[0];
char* crypt = &crypt_buf[0];
char* dest = &dest_buf[0];
memcpy(source, "I love the smell of the sheep.", 31);

View File

@ -75,10 +75,12 @@ void TestFCOSetImpl()
pFCO3->Release();
// let's iterate over the fcos
cIterProxy<iFCOIter> pit(set.GetIter());
iFCOIter* pIter = set.GetIter();
cIterProxy<iFCOIter> pit(pIter);
pit->SeekBegin();
PrintIter(pit, d);
// lookup a specific fco
cIterProxy<iFCOIter> pit2(set.Lookup(cFCOName(_T("fco2"))));
if(! (iFCOIter*)pit2)
@ -113,10 +115,14 @@ void TestFCOSetImpl()
// test operator=
cFCOSetImpl set2;
set2 = set;
pit = set2.GetIter();
pIter->DestroyIter();
pIter = set2.GetIter();
pit = pIter;
d.TraceDebug("Made a new set and set it equal to the first with operator=; printing out...\n");
PrintIter(pit, d);
// test IsEmpty
set.Clear();
TEST(set.IsEmpty());
@ -142,6 +148,7 @@ void TestFCOSetImpl()
pit = set3.GetIter();
PrintIter(pit, d);
pIter->DestroyIter();
d.TraceDebug("Leaving...\n");
return;