This test makes sure we can tolerate the low memory case where we do not have enough memory to allocate the array of buckets for the hash table.
| 623 | // This test makes sure we can tolerate the low memory case where we do not have enough |
| 624 | // memory to allocate the array of buckets for the hash table. |
| 625 | void VeryLowMemTest(bool quadratic) { |
| 626 | const int64_t block_size = 2 * 1024; |
| 627 | const int max_num_blocks = 1; |
| 628 | const int table_size = 1024; |
| 629 | CreateTestEnv(block_size, block_size * max_num_blocks); |
| 630 | |
| 631 | HashTable* hash_table; |
| 632 | ASSERT_FALSE(CreateHashTable( |
| 633 | quadratic, table_size, &hash_table, block_size, max_num_blocks, 0, 1024)); |
| 634 | scoped_ptr<HashTableCtx> ht_ctx; |
| 635 | Status status = HashTableCtx::Create(&pool_, runtime_state_, build_exprs_, |
| 636 | probe_exprs_, false /* !stores_nulls_ */, vector<bool>(build_exprs_.size(), false), 1, 0, 1, |
| 637 | &mem_pool_, &mem_pool_, &mem_pool_, &ht_ctx); |
| 638 | EXPECT_OK(status); |
| 639 | HashTable::Iterator iter = hash_table->Begin(ht_ctx.get()); |
| 640 | EXPECT_TRUE(iter.AtEnd()); |
| 641 | ht_ctx->Close(runtime_state_); |
| 642 | } |
| 643 | }; |
| 644 | |
| 645 | TEST_F(HashTableTest, LinearSetupTest) { |