Aktualizr
C++ SOTA Client
tests
leak_test.cc
1
#include <gtest/gtest.h>
2
3
/**
4
* A test case that leaks memory, to check that we can spot this in valgrind
5
*/
6
TEST(Leak, ThisTestLeaks) {
7
int
* temp =
new
int
[45];
8
int
temp2 = *temp++;
9
std::cout << temp2;
10
}
11
12
#ifndef __NO_MAIN__
13
int
main(
int
argc,
char
** argv) {
14
::testing::InitGoogleTest(&argc, argv);
15
return
RUN_ALL_TESTS();
16
}
17
#endif
Generated by
1.8.13