-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathleak.cpp
More file actions
52 lines (44 loc) · 1.5 KB
/
leak.cpp
File metadata and controls
52 lines (44 loc) · 1.5 KB
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
/*
* leak.cpp
*
* Created on: 14 jan. 2014
* Author: Loic Oudot
*/
#include <iostream>
#include <time.h>
#include "java4cpp/java_classes.h"
#include "testsunit.h"
#include "leak.h"
using namespace java4cpp::demos;
void allLeak()
{
std::cout << "================================" << std::endl;
std::cout << "Memory Leak" << std::endl;
std::cout << "================================" << std::endl;
general();
}
void general()
{
std::vector < std::vector<std::vector<std::string> > > threeDims;
std::vector < std::vector<std::string> > dim1;
std::vector < std::string > dim2;
dim2.push_back("string");
dim1.push_back(dim2);
threeDims.push_back(dim1);
do
{
// Allocation
Allocation A;
Allocation Acopy(A);
Allocation Anew = A.clone();
// Arrays
std::vector<std::vector<std::vector<std::string> > > out = Arrays().whatFor(threeDims);
// Strings
assertThat(Arrays().diacritic()).isEqualTo("&é§èçà$€");
// Enums
assertThat(Enumeration::identity(EnumerationEnum::ONE)).isEqualTo(EnumerationEnum::ONE);
assertThat(Enumeration::identity(EnumerationEnum::NULL_VALUE)).isEqualTo(EnumerationEnum::NULL_VALUE);
assertThat(InnerEnumeration::Enumeration::identity(InnerEnumeration::Enumeration::ONE)).isEqualTo(InnerEnumeration::Enumeration::ONE);
assertThat(InnerEnumeration::Enumeration::identity(InnerEnumeration::Enumeration::NULL_VALUE)).isEqualTo(InnerEnumeration::Enumeration::NULL_VALUE);
} while (1);
}