-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest0.cpp
More file actions
33 lines (28 loc) · 749 Bytes
/
test0.cpp
File metadata and controls
33 lines (28 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <string>
#include "HashTable.h"
using namespace std;
bool test0() {
HashTable hashtable1, hashtable2(113);
if (hashtable1.size() != 11) {
cout << "Default size for a hashtable should be 11." << endl;
return false;
}
if (hashtable2.size() < 113) {
cout << "Requested a hash table of size 113, but got a table of a smaller size." << endl;
return false;
}
if (HashTable(12000).size() < 12000) {
cout << "Requested a hash table of size 12000, but got a table of a smaller size." << endl;
return false;
}
return true;
}
int main() {
if (test0()) {
cout << "Test 0 completed successfully. " << endl;
return 0;
}
cout << "Test 0 failed." << endl;
return 1;
}