Thomas Buck преди 10 години
родител
ревизия
63e4bb5fd6
променени са 22 файла, в които са добавени 6 реда и са изтрити 1501 реда
  1. 3
    0
      ChangeLog
  2. 3
    26
      Makefile
  3. 0
    1
      README.md
  4. 0
    4
      include/List.h
  5. 0
    4
      include/Vector.h
  6. 0
    84
      include/memory_test.h
  7. 0
    5
      src/Camera.cpp
  8. 0
    4
      src/Emitter.cpp
  9. 0
    5
      src/GLString.cpp
  10. 0
    33
      src/OpenRaider.cpp
  11. 0
    5
      src/Particle.cpp
  12. 0
    4
      src/Render.cpp
  13. 0
    9
      src/SDLSystem.cpp
  14. 0
    4
      src/SkeletalModel.cpp
  15. 0
    6
      src/Sound.cpp
  16. 0
    4
      src/System.cpp
  17. 0
    4
      src/Texture.cpp
  18. 0
    6
      src/TombRaider.cpp
  19. 0
    4
      src/World.cpp
  20. 0
    1146
      src/memory_test.cpp
  21. 0
    4
      src/tga.cpp
  22. 0
    139
      test/memory_test.cpp

+ 3
- 0
ChangeLog Целия файл

@@ -5,6 +5,9 @@
5 5
 
6 6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7 7
 
8
+	[ 20140304 ]
9
+	* Removed memory test
10
+
8 11
 	[ 20140303 ]
9 12
 	* Removed Map.h & Tree.h, using std::map instead...
10 13
 

+ 3
- 26
Makefile Целия файл

@@ -65,7 +65,6 @@ BUILD_DEBUG_DIR=bin/debug
65 65
 BUILD_RELEASE_DIR=bin/release
66 66
 BUILD_PROF_DIR=bin/prof
67 67
 BUILD_TEST_DIR=bin/test
68
-BUILD_MEM_DIR=bin/mem
69 68
 BUILD_INSTALL_DIR=bin/$(BUILD_SELECT)
70 69
 DEB_DIR=/tmp/$(NAME).deb
71 70
 
@@ -154,15 +153,6 @@ ded:
154 153
 	CFLAGS="$(DEBUG_CFLAGS) -DDEDICATED_SERVER" \
155 154
 	LD_FLAGS="$(LD_FLAGS)"
156 155
 
157
-# -DDEBUG_MEMORY_VERBOSE
158
-# -DDEBUG_MEMORY
159
-memory:
160
-	@-mkdir -p $(BUILD_MEM_DIR)
161
-	$(MAKE) targets BUILDDIR=$(BUILD_MEM_DIR) \
162
-	DEBUG_OBJ="$(BUILD_MEM_DIR)/memory_test.o" \
163
-	CFLAGS="$(DEBUG_CFLAGS) -DDEBUG_MEMORY" \
164
-	LD_FLAGS="$(LD_FLAGS)"
165
-
166 156
 depend:
167 157
 	@-echo "Making deps..."
168 158
 	@-echo "# Autogenerated dependency file" > depend
@@ -258,7 +248,6 @@ clean-obj:
258 248
 	@-rm -f $(BUILD_DEBUG_DIR)/*.o
259 249
 	@-rm -f $(BUILD_RELEASE_DIR)/*.o
260 250
 	@-rm -f $(BUILD_TEST_DIR)/*.o
261
-	@-rm -f $(BUILD_MEM_DIR)/*.o
262 251
 	@-echo "[DONE]"
263 252
 
264 253
 clean-build:
@@ -266,7 +255,6 @@ clean-build:
266 255
 	@-rm -f $(BUILD_PROF_DIR)/$(NAME)
267 256
 	@-rm -f $(BUILD_DEBUG_DIR)/$(NAME)
268 257
 	@-rm -f $(BUILD_RELEASE_DIR)/$(NAME)
269
-	@-rm -f $(BUILD_MEM_DIR)/$(NAME)
270 258
 	@-echo "[DONE]"
271 259
 
272 260
 clean-doc:
@@ -311,13 +299,10 @@ TEST_MAP_TR3=~/.OpenRaider/paks/tr3/scotland.tr2
311 299
 TEST_MAP_TR2=~/.OpenRaider/paks/tr2/unwater.tr2
312 300
 TEST_MAP_TR1=~/.OpenRaider/paks/tr1/level1.phd
313 301
 
314
-test.build: Matrix.test Math.test Memory.test Network.test Sound.test tga.test GLString.test TombRaider.test
302
+test.build: Matrix.test Math.test Network.test Sound.test tga.test GLString.test TombRaider.test
315 303
 
316 304
 test: test.build
317 305
 	@-echo "================================================="
318
-	@-echo "Running Memory unit test"
319
-	$(BUILD_TEST_DIR)/memory_test.test
320
-	@-echo "================================================="
321 306
 	@-echo "Running Matrix unit test"
322 307
 	$(BUILD_TEST_DIR)/Matrix.test
323 308
 	@-echo "================================================="
@@ -344,13 +329,13 @@ TombRaider.reg_test:
344 329
 	$(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR4) > /tmp/log.tr4
345 330
 	$(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR5) > /tmp/log.tr5
346 331
 
347
-TR_FLAGS = -D__TEST_TR5_DUMP_TGA -D__TEST_32BIT_TEXTILES -DDEBUG_MEMORY
332
+TR_FLAGS = -D__TEST_TR5_DUMP_TGA -D__TEST_32BIT_TEXTILES
348 333
 
349 334
 TombRaider.test:
350 335
 	@-mkdir -p $(BUILD_TEST_DIR)
351 336
 	$(CC) $(FLAGS_ALL) $(WARNINGS) -Iinclude $(TR_FLAGS) -o $(BUILD_TEST_DIR)/TombRaiderTest.o -c test/TombRaider.cpp
352 337
 	$(MAKE) targets NAME=TombRaider.test BUILDDIR=$(BUILD_TEST_DIR) \
353
-	OBJS="$(BUILD_TEST_DIR)/TombRaiderTest.o $(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/tga.o $(BUILD_TEST_DIR)/memory_test.o" \
338
+	OBJS="$(BUILD_TEST_DIR)/TombRaiderTest.o $(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/tga.o" \
354 339
 	CFLAGS="$(BASE_CFLAGS) -g $(TR_FLAGS)" \
355 340
 	LD_FLAGS="-lz -lstdc++"
356 341
 
@@ -381,14 +366,6 @@ Math.test:
381 366
 
382 367
 #################################################################
383 368
 
384
-Memory.test:
385
-	mkdir -p $(BUILD_TEST_DIR)
386
-	$(CC) $(FLAGS_ALL) $(WARNINGS) -g -lstdc++ -Iinclude \
387
-	-DDEBUG_MEMORY -DDEBUG_MEMORY_ERROR \
388
-	src/memory_test.cpp test/memory_test.cpp -o $(BUILD_TEST_DIR)/memory_test.test
389
-
390
-#################################################################
391
-
392 369
 Network.test:
393 370
 	mkdir -p $(BUILD_TEST_DIR)
394 371
 	$(CC) $(TEST_FLAGS) $(WARNINGS) src/MatMath.cpp src/Vector3d.cpp \

+ 0
- 1
README.md Целия файл

@@ -148,7 +148,6 @@ Pressing &lt;UP&gt; will go back to last command entered (saves typing).
148 148
 | noclip              | Toggle world clipping in cycle                         |
149 149
 | hop                 | Toggle room hopping hack                               |
150 150
 | showfps BOOL        | Show FPS                                               |
151
-| mem ARG             | Prints memory report, where ARG is `usage` or `report` |
152 151
 | resize STRING       | Change resolution to `xga`, `svga` or `vga`            |
153 152
 
154 153
 #### Render

+ 0
- 4
include/List.h Целия файл

@@ -15,10 +15,6 @@
15 15
 #include <limits.h>
16 16
 #include <stdio.h>
17 17
 
18
-#ifdef DEBUG_MEMORY
19
-#include <memory_test.h>
20
-#endif
21
-
22 18
 /*!
23 19
  * \brief Template class encapsulating a single list node
24 20
  * \tparam T encapsulated data type

+ 0
- 4
include/Vector.h Целия файл

@@ -11,10 +11,6 @@
11 11
 #include <stdlib.h>
12 12
 #include <stdio.h>
13 13
 
14
-#ifdef DEBUG_MEMORY
15
-#include <memory_test.h>
16
-#endif
17
-
18 14
 /*!
19 15
  * \brief Template class for a (pretty strange) Vector
20 16
  * \tparam Object datatype the Vector can store

+ 0
- 84
include/memory_test.h Целия файл

@@ -1,84 +0,0 @@
1
-/*!
2
- * \file include/memory_test.h
3
- * Memory testing Toolkit
4
- *
5
- * \author Mongoose
6
- */
7
-
8
-#ifndef _MEMORY_TEST_H_
9
-#define _MEMORY_TEST_H_
10
-
11
-#include <cstddef>
12
-
13
-#if defined(DEBUG_MEMORY) && !defined(UNIT_TEST_MEMORY)
14
-
15
-#define DEBUG_NEW new(__FILE__, __LINE__)
16
-void *operator new(size_t size, const char *file, int line);
17
-void *operator new [](size_t size, const char *file, int line);
18
-
19
-#define DEBUG_DELETE delete_check(__FILE__, __LINE__, 0);delete
20
-void operator delete(void *p);
21
-void operator delete [](void *p);
22
-
23
-#else
24
-
25
-#define DEBUG_NEW new
26
-#define DEBUG_DELETE delete
27
-
28
-#endif
29
-
30
-#define new DEBUG_NEW
31
-#define delete DEBUG_DELETE
32
-
33
-typedef enum {
34
-    MEMORY_USED_BY_PROGRAM      = 1,
35
-    MEMORY_USED_BY_OVERHEAD     = 2,
36
-    MEMORY_USED_TOTAL           = 3,
37
-    MAX_MEMORY_USED_BY_PROGRAM  = 4,
38
-    MAX_MEMORY_USED_BY_OVERHEAD = 5
39
-} memory_query_t;
40
-
41
-void delete_check(const char *file, int line, int print);
42
-
43
-void display_memory_usage();
44
-
45
-/*!
46
- * \brief Get total memory usage
47
- * \param query what to return
48
- * \returns amount of requested memory used
49
- */
50
-long memory_used(memory_query_t query);
51
-
52
-/*!
53
- * \brief Dumps raw Tree holding memory accounting
54
- */
55
-void dump_memory_report();
56
-
57
-#ifdef DEBUG_MEMORY
58
-
59
-#define DWORD unsigned long
60
-#define ZERO_ALLOC_SLOTS 3
61
-
62
-typedef enum { RB_BLACK = 0, RB_RED = 1 } rbtree_color_t;
63
-
64
-typedef struct rbtree_s {
65
-    void *data;
66
-    DWORD key;
67
-    rbtree_color_t color;
68
-    struct rbtree_s *left;
69
-    struct rbtree_s *right;
70
-    struct rbtree_s *parent;
71
-} rbtree_t;
72
-
73
-typedef struct meminfo_filename_s {
74
-    char *filename;
75
-    char filename_len;
76
-    DWORD size;
77
-    unsigned int alloc_zero;
78
-    unsigned int alloc_zero_at_line[ZERO_ALLOC_SLOTS];
79
-    struct meminfo_filename_s *next;
80
-} meminfo_filename_t;
81
-
82
-#endif
83
-
84
-#endif

+ 0
- 5
src/Camera.cpp Целия файл

@@ -11,11 +11,6 @@
11 11
 #include <MatMath.h>
12 12
 #include <Camera.h>
13 13
 
14
-#ifdef DEBUG_MEMORY
15
-#include <memory_test.h>
16
-#endif
17
-
18
-
19 14
 unsigned int Camera::mCounter = 0;
20 15
 
21 16
 ////////////////////////////////////////////////////////////

+ 0
- 4
src/Emitter.cpp Целия файл

@@ -18,10 +18,6 @@
18 18
 
19 19
 #include <Emitter.h>
20 20
 
21
-#ifdef DEBUG_MEMORY
22
-#include <memory_test.h>
23
-#endif
24
-
25 21
 vec_t Emitter::mFrustum[6][4];
26 22
 
27 23
 int Emitter::compareParticleDist(const void *voidA, const void *voidB) {

+ 0
- 5
src/GLString.cpp Целия файл

@@ -19,11 +19,6 @@
19 19
 #include <Texture.h>
20 20
 #include <GLString.h>
21 21
 
22
-#ifdef DEBUG_MEMORY
23
-#include <memory_test.h>
24
-#endif
25
-
26
-
27 22
 GLString::GLString() {
28 23
     _num_string_max = 0;
29 24
     _num_string = 0;

+ 0
- 33
src/OpenRaider.cpp Целия файл

@@ -14,10 +14,6 @@
14 14
 #include <sys/types.h>
15 15
 #include <dirent.h>
16 16
 
17
-#ifdef DEBUG_MEMORY
18
-#include <memory_test.h>
19
-#endif
20
-
21 17
 #include <World.h>
22 18
 #include <SkeletalModel.h>
23 19
 #include <TombRaider1.h> // tmp stop-gap
@@ -77,11 +73,6 @@ void killOpenRaiderSingleton()
77 73
     //delete OpenRaider::Instance();
78 74
 #warning "Can't delete OpenRaider::Instance() without a not-allocated-free error. Something is fishy here..."
79 75
 
80
-#ifdef DEBUG_MEMORY
81
-    printf("\n[Mongoose MEMORY_DEBUG]\nMemory leak table:\n");
82
-    dump_memory_report();
83
-#endif
84
-
85 76
     printf("\nThanks for testing %s\n", VERSION);
86 77
     printf("Build date: %s @ %s\n", __DATE__, __TIME__);
87 78
     printf("Build host: %s\n", BUILD_HOST);
@@ -1166,20 +1157,11 @@ void OpenRaider::loadLevel(char *mapname)
1166 1157
     // Cache/process sound fx
1167 1158
     processPakSounds();
1168 1159
 
1169
-#ifdef DEBUG_MEMORY
1170
-    // Right before pak is cleared will be highest use or memory
1171
-    display_memory_usage();
1172
-#endif
1173
-
1174 1160
     // Mongoose 2002.01.02, Go ahead and free the TR pak
1175 1161
     m_tombraider.reset();
1176 1162
 
1177 1163
     print(true, "Level pak freed from memory, Starting game...");
1178 1164
 
1179
-#ifdef DEBUG_MEMORY
1180
-    display_memory_usage();
1181
-#endif
1182
-
1183 1165
     /*! \fixme GL call to critical section,
1184 1166
      * needs mutex really -- Mongoose 2002.01.02
1185 1167
      */
@@ -2943,21 +2925,6 @@ void OpenRaider::consoleCommand(char *cmd)
2943 2925
 
2944 2926
         print(false, "World clipping is [OFF]");
2945 2927
     }
2946
-    else if (rc_command("mem", cmd))
2947
-    {
2948
-#ifdef DEBUG_MEMORY
2949
-        if (rc_command("usage", cmd))
2950
-        {
2951
-            display_memory_usage();
2952
-        }
2953
-        else if (rc_command("report", cmd))
2954
-        {
2955
-            dump_memory_report();
2956
-        }
2957
-#else
2958
-        printf("This build isn't DEBUG_MEMORY enabled\n");
2959
-#endif
2960
-    }
2961 2928
     else if (rc_command("loadlevel", cmd))
2962 2929
     {
2963 2930
         loadLevel(cmd);

+ 0
- 5
src/Particle.cpp Целия файл

@@ -10,11 +10,6 @@
10 10
 
11 11
 #include <Particle.h>
12 12
 
13
-#ifdef DEBUG_MEMORY
14
-#include <memory_test.h>
15
-#endif
16
-
17
-
18 13
 Particle::Particle()
19 14
 {
20 15
     setActive(true);

+ 0
- 4
src/Render.cpp Целия файл

@@ -20,10 +20,6 @@
20 20
 #include <Emitter.h>
21 21
 #endif
22 22
 
23
-#ifdef DEBUG_MEMORY
24
-#include <memory_test.h>
25
-#endif
26
-
27 23
 #include <Render.h>
28 24
 
29 25
 extern entity_t *LARA;

+ 0
- 9
src/SDLSystem.cpp Целия файл

@@ -10,10 +10,6 @@
10 10
 #include <string.h>
11 11
 #include <cmath>
12 12
 
13
-#ifdef MEMORY_TEST
14
-#include <memory_test.h>
15
-#endif
16
-
17 13
 #include <SDL2/SDL_opengl.h>
18 14
 
19 15
 #include <MatMath.h>
@@ -355,11 +351,6 @@ void SDLSystem::shutdown(int i) {
355 351
     //SDL_QuitSubSystem(SDL_OPENGL);
356 352
     //SDL_Quit(); // Moved to atexit() call
357 353
 
358
-    //#ifdef DEBUG_MEMORY
359
-    //printf("[Mongoose MEMORY_DEBUG]\nUnfreed memory table:\n");
360
-    //dump_memory_report();
361
-    //#endif
362
-
363 354
     exit(i);
364 355
 }
365 356
 

+ 0
- 4
src/SkeletalModel.cpp Целия файл

@@ -7,10 +7,6 @@
7 7
 
8 8
 #include <SkeletalModel.h>
9 9
 
10
-#ifdef MEMORY_TEST
11
-#include <memory_test.h>
12
-#endif
13
-
14 10
 ////////////////////////////////////////////////////////////
15 11
 // Constructors
16 12
 ////////////////////////////////////////////////////////////

+ 0
- 6
src/Sound.cpp Целия файл

@@ -27,12 +27,6 @@
27 27
 
28 28
 #include <Sound.h>
29 29
 
30
-#ifdef DEBUG_MEMORY
31
-#include <memory_test.h>
32
-#endif
33
-
34
-
35
-
36 30
 Sound::Sound()
37 31
 {
38 32
     mSource[0] = 0;

+ 0
- 4
src/System.cpp Целия файл

@@ -28,10 +28,6 @@
28 28
 #include <sys/time.h>
29 29
 #endif
30 30
 
31
-#ifdef MEMORY_TEST
32
-#include <memory_test.h>
33
-#endif
34
-
35 31
 #include <MatMath.h>
36 32
 #include <System.h>
37 33
 

+ 0
- 4
src/Texture.cpp Целия файл

@@ -10,10 +10,6 @@
10 10
 #include <stdio.h>
11 11
 #include <stdarg.h>
12 12
 
13
-#ifdef DEBUG_MEMORY
14
-#include <memory_test.h>
15
-#endif
16
-
17 13
 #include <SDL2/SDL_ttf.h>
18 14
 
19 15
 #ifdef __APPLE__

+ 0
- 6
src/TombRaider.cpp Целия файл

@@ -58,12 +58,6 @@
58 58
 #include <TGA.h>
59 59
 #endif
60 60
 
61
-#ifdef DEBUG_MEMORY
62
-#include <memory_test.h>
63
-#endif
64
-
65
-
66
-
67 61
 TombRaider::TombRaider()
68 62
 {
69 63
     _textile8 = NULL;

+ 0
- 4
src/World.cpp Целия файл

@@ -5,10 +5,6 @@
5 5
  * \author Mongoose
6 6
  */
7 7
 
8
-#ifdef DEBUG_MEMORY
9
-#include <memory_test.h>
10
-#endif
11
-
12 8
 #include <math.h>
13 9
 
14 10
 #include <World.h>

+ 0
- 1146
src/memory_test.cpp
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 0
- 4
src/tga.cpp Целия файл

@@ -13,10 +13,6 @@
13 13
 
14 14
 #include <TGA.h>
15 15
 
16
-#ifdef DEBUG_MEMORY
17
-#include <memory_test.h>
18
-#endif
19
-
20 16
 int tga_check(FILE *f) {
21 17
     char buffer[10];
22 18
 

+ 0
- 139
test/memory_test.cpp Целия файл

@@ -1,139 +0,0 @@
1
-/*!
2
- * \file test/memory_test.cpp
3
- * Memory testing Toolkit Unit test
4
- *
5
- * \author Mongoose
6
- * \author xythobuz
7
- */
8
-
9
-#include <string.h>
10
-#include <stdio.h>
11
-#include <stdlib.h>
12
-#include "greatest.h"
13
-#include <memory_test.h>
14
-
15
-extern rbtree_t *MEMORY_INFO;
16
-bool check_red_black_tree(rbtree_t *current, bool valid, bool strict);
17
-
18
-int *i, *j, *k;
19
-float *l, *m, *n;
20
-
21
-void integerTeardown(void *) {
22
-    free(i);
23
-    free(j);
24
-    free(k);
25
-}
26
-
27
-void floatTeardown(void *) {
28
-    free(l);
29
-    free(m);
30
-    free(n);
31
-}
32
-
33
-TEST singleInteger() {
34
-    i = new int;
35
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
36
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), sizeof(int));
37
-
38
-    delete i;
39
-    i = NULL;
40
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
41
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 0);
42
-    PASS();
43
-}
44
-
45
-TEST arrayInteger() {
46
-    i = new int[3];
47
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
48
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 3 * sizeof(int));
49
-
50
-    delete [] i;
51
-    i = NULL;
52
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
53
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 0);
54
-    PASS();
55
-}
56
-
57
-TEST arrayCombinedInteger() {
58
-    i = new int[3];
59
-    j = new int;
60
-    k = new int[3];
61
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
62
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 7 * sizeof(int));
63
-
64
-    delete [] i;
65
-    delete j;
66
-    delete [] k;
67
-    i = NULL;
68
-    j = NULL;
69
-    k = NULL;
70
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
71
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 0);
72
-    PASS();
73
-}
74
-
75
-SUITE(integerSuite) {
76
-    SET_TEARDOWN(integerTeardown, NULL);
77
-    RUN_TEST(singleInteger);
78
-    RUN_TEST(arrayInteger);
79
-    RUN_TEST(arrayCombinedInteger);
80
-}
81
-
82
-TEST singleFloat() {
83
-    l = new float;
84
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
85
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), sizeof(float));
86
-
87
-    delete l;
88
-    l = NULL;
89
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
90
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 0);
91
-    PASS();
92
-}
93
-
94
-TEST arrayFloat() {
95
-    l = new float[3];
96
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
97
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 3 * sizeof(float));
98
-
99
-    delete [] l;
100
-    l = NULL;
101
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
102
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 0);
103
-    PASS();
104
-}
105
-
106
-TEST arrayCombinedFloat() {
107
-    l = new float[3];
108
-    m = new float;
109
-    n = new float[3];
110
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
111
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 7 * sizeof(float));
112
-
113
-    delete [] l;
114
-    delete m;
115
-    delete [] n;
116
-    l = NULL;
117
-    m = NULL;
118
-    n = NULL;
119
-    ASSERTm("No valid red-black tree!", check_red_black_tree(MEMORY_INFO, true, true));
120
-    ASSERT_EQm("Memory-Tracking faulty!", memory_used(MEMORY_USED_BY_PROGRAM), 0);
121
-    PASS();
122
-}
123
-
124
-SUITE(floatSuite) {
125
-    SET_TEARDOWN(floatTeardown, NULL);
126
-    RUN_TEST(singleFloat);
127
-    RUN_TEST(arrayFloat);
128
-    RUN_TEST(arrayCombinedFloat);
129
-}
130
-
131
-GREATEST_MAIN_DEFS();
132
-
133
-int main(int argc, char *argv[]) {
134
-    GREATEST_MAIN_BEGIN();
135
-    RUN_SUITE(integerSuite);
136
-    RUN_SUITE(floatSuite);
137
-    GREATEST_MAIN_END();
138
-}
139
-

Loading…
Отказ
Запис