summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 19:27:04 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 19:39:46 +0100
commit0e22f14ed642af94db5f0dd7461920274be3361a (patch)
tree9330d305d9138437634c84721e30671aa4ecd9db /lib
parentbff22f7317a39605d53cf142e2c0f5c424d9c12c (diff)
tests|lib: remove assert.h includes
Only the igt core and non-test tools should have asserts to catch internal errors, tests and helper libraries should all user igt_asert instead. Fix things up where assert instead of igt_assert was used. One tiny step towards header sanity. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/drmtest.c2
-rw-r--r--lib/drmtest.h1
-rw-r--r--lib/igt_core.c1
-rw-r--r--lib/igt_kms.c6
-rw-r--r--lib/intel_batchbuffer.h10
-rw-r--r--lib/ioctl_wrappers.c2
-rw-r--r--lib/media_fill.h1
7 files changed, 11 insertions, 12 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 78b9999d..c2751e75 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -396,7 +396,7 @@ void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr)
num_trash_bos = gem_mappable_aperture_size() / (1024*1024);
trash_bos = malloc(num_trash_bos * sizeof(drm_intel_bo *));
- assert(trash_bos);
+ igt_assert(trash_bos);
for (i = 0; i < num_trash_bos; i++)
trash_bos[i] = drm_intel_bo_alloc(bufmgr, "trash bo", 1024*1024, 4096);
diff --git a/lib/drmtest.h b/lib/drmtest.h
index ed6040f7..d048ee09 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -31,7 +31,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include <setjmp.h>
diff --git a/lib/igt_core.c b/lib/igt_core.c
index dbfcd74f..3ff7efa7 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -32,6 +32,7 @@
#include <libgen.h>
#endif
#include <stdio.h>
+#include <assert.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d5d9e022..ac27d7ae 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -146,7 +146,7 @@ int kmstest_cairo_printf_line(cairo_t *cr, enum kmstest_text_align align,
va_start(ap, fmt);
ret = vasprintf(&text, fmt, ap);
- assert(ret >= 0);
+ igt_assert(ret >= 0);
va_end(ap);
cairo_text_extents(cr, text, &extents);
@@ -221,7 +221,7 @@ void kmstest_paint_test_pattern(cairo_t *cr, int width, int height)
paint_marker(cr, 0, height);
paint_marker(cr, width, height);
- assert(!cairo_status(cr));
+ igt_assert(!cairo_status(cr));
}
void kmstest_paint_image(cairo_t *cr, const char *filename,
@@ -232,7 +232,7 @@ void kmstest_paint_image(cairo_t *cr, const char *filename,
double scale_x, scale_y;
image = cairo_image_surface_create_from_png(filename);
- assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
+ igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
img_width = cairo_image_surface_get_width(image);
img_height = cairo_image_surface_get_height(image);
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index b3e4b8ff..77640642 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -1,9 +1,9 @@
#ifndef INTEL_BATCHBUFFER_H
#define INTEL_BATCHBUFFER_H
-#include <assert.h>
#include <stdint.h>
#include "intel_bufmgr.h"
+#include "igt_core.h"
#define BATCH_SZ 4096
#define BATCH_RESERVED 16
@@ -58,7 +58,7 @@ intel_batchbuffer_space(struct intel_batchbuffer *batch)
static inline void
intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, uint32_t dword)
{
- assert(intel_batchbuffer_space(batch) >= 4);
+ igt_assert(intel_batchbuffer_space(batch) >= 4);
*(uint32_t *) (batch->ptr) = dword;
batch->ptr += 4;
}
@@ -67,7 +67,7 @@ static inline void
intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
unsigned int sz)
{
- assert(sz < BATCH_SZ - BATCH_RESERVED);
+ igt_assert(sz < BATCH_SZ - BATCH_RESERVED);
if (intel_batchbuffer_space(batch) < sz)
intel_batchbuffer_flush(batch);
}
@@ -110,7 +110,7 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
* scope.
*/
#define OUT_RELOC_FENCED(buf, read_domains, write_domain, delta) do { \
- assert((delta) >= 0); \
+ igt_assert((delta) >= 0); \
intel_batchbuffer_emit_reloc(batch, buf, delta, \
read_domains, write_domain, 1); \
} while (0)
@@ -128,7 +128,7 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
* scope.
*/
#define OUT_RELOC(buf, read_domains, write_domain, delta) do { \
- assert((delta) >= 0); \
+ igt_assert((delta) >= 0); \
intel_batchbuffer_emit_reloc(batch, buf, delta, \
read_domains, write_domain, 0); \
} while (0)
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 37569306..febfc8b7 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -808,7 +808,7 @@ void gem_require_ring(int fd, int ring_id)
return;
#endif
default:
- assert(0);
+ igt_assert(0);
return;
}
}
diff --git a/lib/media_fill.h b/lib/media_fill.h
index 2e1af325..3568cf60 100644
--- a/lib/media_fill.h
+++ b/lib/media_fill.h
@@ -5,7 +5,6 @@
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>