| 1164 | } |
| 1165 | |
| 1166 | void BufferPoolTest::CreatePageLoop(BufferPool* pool, TmpFileGroup* file_group, |
| 1167 | ReservationTracker* parent_tracker, int num_ops) { |
| 1168 | BufferPool::ClientHandle client; |
| 1169 | ASSERT_OK(pool->RegisterClient("test client", file_group, parent_tracker, NULL, |
| 1170 | TEST_BUFFER_LEN, NewProfile(), &client)); |
| 1171 | ASSERT_TRUE(client.IncreaseReservation(TEST_BUFFER_LEN)); |
| 1172 | for (int i = 0; i < num_ops; ++i) { |
| 1173 | BufferPool::PageHandle handle; |
| 1174 | ASSERT_OK(pool->CreatePage(&client, TEST_BUFFER_LEN, &handle)); |
| 1175 | pool->Unpin(&client, &handle); |
| 1176 | ASSERT_OK(pool->Pin(&client, &handle)); |
| 1177 | pool->DestroyPage(&client, &handle); |
| 1178 | } |
| 1179 | pool->DeregisterClient(&client); |
| 1180 | } |
| 1181 | |
| 1182 | /// Test that DCHECK fires when trying to unpin a page with spilling disabled. |
| 1183 | TEST_F(BufferPoolTest, SpillingDisabledDcheck) { |
nothing calls this directly
no test coverage detected