TEST(Vectors, Remove) { Vectors<int>* newVector = new Vectors<int>(5,5,0); newVector->insert(2,3,4); newVector->remove(2,3); EXPECT_EQ(0, newVector->access(2,3)); delete newVector; Vectors<double>* newDouble = new Vectors<double>(5,5,0.0); newDouble->insert(2,3,4.4); newDouble->remove(2,3); EXPECT_EQ(0.0, newDouble->access(2,3)); delete newDouble; Vectors<std::string>* newString = new Vectors<std::string>(5,5,"empty"); newString->insert(2,3,"yes"); newString->remove(2,3); EXPECT_EQ("empty", newString->access(2,3)); delete newString; }
int main(){ Vectors<int>* newVector = new Vectors<int>(10,10,0); for (int i=0; i<10; ++i){ for (int j=0; j<10; ++j){ newVector->insert(i, j, 5); } } newVector->print(); for (int i=0; i<10; ++i){ for (int j=0; j<10; ++j){ newVector->remove(i, j); } } newVector->print(); delete newVector; return 0; }