tests/hashtable_unittests.cc
TYPED_TEST(HashtableAllTest, BracketOperatorCrashing) {
  this->ht_.set_deleted_key(this->UniqueKey(1));
  for (int iters = 0; iters < 10; iters++) {
    // We start at 33 because after shrinking, we'll be at 32 buckets.
    for (int i = 33; i < 133; i++) {
      this->ht_.bracket_assign(this->UniqueKey(i),
                               this->ht_.get_data(this->UniqueObject(i)));
    }
    this->ht_.clear_no_resize();
    // This will force a shrink on the next insert, which we want to test.
    this->ht_.bracket_assign(this->UniqueKey(2),
                             this->ht_.get_data(this->UniqueObject(2)));
    this->ht_.erase(this->UniqueKey(2));
  }
}
// ------------------------------------------------------------------------
// The above tests test the general API for correctness.  These tests
// test a few corner cases that have tripped us up in the past, and
// more general, cross-API issues like memory management.
The above tests test the general API for correctness.  These tests
test a few corner cases that have tripped us up in the past, and
more general, cross-API issues like memory management.
The above tests test the general API for correctness . These tests test a few corner cases that have tripped us up in the past and more general cross - API issues like memory management .
TYPED_TEST(HashtableAllTest, BracketOperatorCrashing) {
  this->ht_.set_deleted_key(this->UniqueKey(1));
  for (int iters = 0; iters < 10; iters++) {
    for (int i = 33; i < 133; i++) {
      this->ht_.bracket_assign(this->UniqueKey(i),
                               this->ht_.get_data(this->UniqueObject(i)));
    }
    this->ht_.clear_no_resize();
    this->ht_.bracket_assign(this->UniqueKey(2),
                             this->ht_.get_data(this->UniqueObject(2)));
    this->ht_.erase(this->UniqueKey(2));
  }
}
TYPED_TEST ( HashtableAllTest , BracketOperatorCrashing ) { this -> ht_ . set_deleted_key ( this -> UniqueKey ( 1 ) ) ; for ( int iters = 0 ; iters < 10 ; iters ++ ) { for ( int i = 33 ; i < 133 ; i ++ ) { this -> ht_ . bracket_assign ( this -> UniqueKey ( i ) , this -> ht_ . get_data ( this -> UniqueObject ( i ) ) ) ; } this -> ht_ . clear_no_resize ( ) ; this -> ht_ . bracket_assign ( this -> UniqueKey ( 2 ) , this -> ht_ . get_data ( this -> UniqueObject ( 2 ) ) ) ; this -> ht_ . erase ( this -> UniqueKey ( 2 ) ) ; } }
The above tests test the general API for correctness.
The above tests test the general API for correctness .
// We start at 33 because after shrinking, we'll be at 32 buckets. // This will force a shrink on the next insert, which we want to test.