| 128 | } |
| 129 | |
| 130 | static 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 | |
| 149 | static void AssertExists(cHierDatabase::iterator& iter, const TSTRING& filename, bool should_have) |
| 150 | { |