MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / AssertData

Function AssertData

src/twtest/hierdatabase_t.cpp:130–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static void AssertData(cHierDatabase::iterator& iter, const TSTRING& filename, bool should_have)
131{
132 bool exists = iter.SeekTo(filename.c_str());
133 TEST(exists == should_have);
134
135 if (exists)
136 {
137 bool has_data = iter.HasData();
138 TEST(has_data == should_have);
139
140 if (has_data)
141 {
142 int32 dummyLength;
143 TSTRING read_str((TCHAR*)iter.GetData(dummyLength));
144 TEST(read_str == g_block_data);
145 }
146 }
147}
148
149static void AssertExists(cHierDatabase::iterator& iter, const TSTRING& filename, bool should_have)
150{

Callers 1

TestHierDatabaseBasicFunction · 0.70

Calls 4

c_strMethod · 0.80
HasDataMethod · 0.80
SeekToMethod · 0.45
GetDataMethod · 0.45

Tested by 1

TestHierDatabaseBasicFunction · 0.56