forked from Turupawn/HashMapMiscFunctions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.cpp
68 lines (55 loc) · 1.11 KB
/
Test.cpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "Test.h"
#include "Map.h"
void test()
{
Map map;
map.put("A",10);
map.put("B",20);
map.put("C",30);
map.put("arroz",100);
map.put("zorra",200);
map.put("abc",1);
map.put("acb",2);
map.put("bac",3);
map.put("bca",4);
map.remove("A");
map.remove("zorra");
map.remove("bac");
map.put("cab",5);
Map map2;
map2.put("A",10);
map2.put("B",20);
map2.put("C",30);
Map map3;
map3.put("A",10);
map3.put("B",20);
map3.put("C",30);
map3.remove("C");
map3.clear();
map3.put("A",100);
Map map4;
Map map5;
map5.put("A",10);
map5.clear();
if(map.getSize()==7
&& !map.isEmpty()
&& map2.getSize() == 3
&& !map2.isEmpty()
&& map3.getSize() == 1
&& !map3.isEmpty()
&& map3.get("A") == 100
&& map3.exists("A")
&& !map3.exists("B")
&& !map3.exists("C")
&& map4.getSize() == 0
&& map4.isEmpty()
&& map5.getSize() == 0
&& map5.isEmpty()
)
{
cout<<"Pass"<<endl;
}else
{
cout<<"Fail"<<endl;
}
}