commit 02caba3d3510df36651bbe0ca65a6ce3b2246a5a
parent dce2ae66e2431d02c439824cfd9acd4077c8a2fa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 29 Nov 2016 11:01:12 +0100
Remove duplicated code in the solstice-core-test library
Diffstat:
6 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/src/core/test_core_device.c b/src/core/test_core_device.c
@@ -15,6 +15,7 @@
#include "solstice_core.h"
#include "test_core_utils.h"
+#include "test_solstice_utils.h"
#include <rsys/logger.h>
diff --git a/src/core/test_core_node.c b/src/core/test_core_node.c
@@ -15,6 +15,7 @@
#include "solstice_core.h"
#include "test_core_utils.h"
+#include "test_solstice_utils.h"
#include <solstice/ssol.h>
#include <solstice/sanim.h>
diff --git a/src/core/test_core_scene.c b/src/core/test_core_scene.c
@@ -15,6 +15,7 @@
#include "solstice_core.h"
#include "test_core_utils.h"
+#include "test_solstice_utils.h"
#include <solstice/ssol.h>
#include <solstice/sanim.h>
diff --git a/src/core/test_core_solve1.c b/src/core/test_core_solve1.c
@@ -15,6 +15,7 @@
#include "solstice_core.h"
#include "test_core_utils.h"
+#include "test_solstice_utils.h"
#include <solstice/ssol.h>
#include <solstice/sanim.h>
diff --git a/src/core/test_core_utils.c b/src/core/test_core_utils.c
@@ -26,22 +26,13 @@
#include <string.h>
void
-log_stream(const char* msg, void* ctx) {
+log_stream(const char* msg, void* ctx)
+{
ASSERT(msg);
(void) msg, (void) ctx;
printf("%s\n", msg);
}
-void
-check_memory_allocator(struct mem_allocator* allocator) {
- if (MEM_ALLOCATED_SIZE(allocator)) {
- char dump[512];
- MEM_DUMP(allocator, dump, sizeof(dump) / sizeof(char));
- fprintf(stderr, "%s\n", dump);
- FATAL("Memory leaks\n");
- }
-}
-
const float VERTICES__ [] = {
-1, -1, 0.f,
1, -1, 0.f,
diff --git a/src/core/test_core_utils.h b/src/core/test_core_utils.h
@@ -25,17 +25,14 @@ struct mem_allocator;
struct ssol_device;
/*******************************************************************************
-* Utilities
-******************************************************************************/
+ * Utilities
+ ******************************************************************************/
void
log_stream(const char* msg, void* ctx);
-void
-check_memory_allocator(struct mem_allocator* allocator);
-
/*******************************************************************************
-* Mesh stuff
-******************************************************************************/
+ * Mesh stuff
+ ******************************************************************************/
struct desc {
const float* vertices;
const unsigned* indices;