summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/blob_test.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-03-10 11:30:01 +1100
committerTimothy Arceri <[email protected]>2017-03-13 09:50:19 +1100
commitdf1d5fc442188343ae885c89b8601476a9988bba (patch)
treede371f43cb58f48868f6b74b3f9ecf36a4c45481 /src/compiler/glsl/tests/blob_test.c
parentca76a2ba1b83ca837a198dc58ef3962d1ca71c68 (diff)
glsl: don't use ralloc for blob creation
There is no need to use ralloc here. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests/blob_test.c')
-rw-r--r--src/compiler/glsl/tests/blob_test.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/compiler/glsl/tests/blob_test.c b/src/compiler/glsl/tests/blob_test.c
index 09114b144ad..01b5ef0b2f0 100644
--- a/src/compiler/glsl/tests/blob_test.c
+++ b/src/compiler/glsl/tests/blob_test.c
@@ -118,14 +118,13 @@ expect_equal_bytes(uint8_t *expected, uint8_t *actual,
static void
test_write_and_read_functions (void)
{
- void *ctx = ralloc_context(NULL);
struct blob *blob;
struct blob_reader reader;
uint8_t *reserved;
size_t str_offset, uint_offset;
uint8_t reserve_buf[sizeof(reserve_test_str)];
- blob = blob_create(ctx);
+ blob = blob_create();
/*** Test blob by writing one of every possible kind of value. */
@@ -185,20 +184,19 @@ test_write_and_read_functions (void)
"read_consumes_all_bytes");
expect_equal(false, reader.overrun, "read_does_not_overrun");
- ralloc_free(ctx);
+ free(blob);
}
/* Test that data values are written and read with proper alignment. */
static void
test_alignment(void)
{
- void *ctx = ralloc_context(NULL);
struct blob *blob;
struct blob_reader reader;
uint8_t bytes[] = "ABCDEFGHIJKLMNOP";
size_t delta, last, num_bytes;
- blob = blob_create(ctx);
+ blob = blob_create();
/* First, write an intptr value to the blob and capture that size. This is
* the expected offset between any pair of intptr values (if written with
@@ -244,19 +242,18 @@ test_alignment(void)
"aligned read of intptr_t");
}
- ralloc_free(ctx);
+ free(blob);
}
/* Test that we detect overrun. */
static void
test_overrun(void)
{
- void *ctx =ralloc_context(NULL);
struct blob *blob;
struct blob_reader reader;
uint32_t value = 0xdeadbeef;
- blob = blob_create(ctx);
+ blob = blob_create();
blob_write_uint32(blob, value);
@@ -267,7 +264,7 @@ test_overrun(void)
expect_equal(0, blob_read_uint32(&reader), "read at overrun");
expect_equal(true, reader.overrun, "overrun flag set");
- ralloc_free(ctx);
+ free(blob);
}
/* Test that we can read and write some large objects, (exercising the code in
@@ -284,7 +281,7 @@ test_big_objects(void)
size_t i;
char *buf;
- blob = blob_create(ctx);
+ blob = blob_create();
/* Initialize our buffer. */
buf = ralloc_size(ctx, size);
@@ -311,6 +308,7 @@ test_big_objects(void)
expect_equal(false, reader.overrun,
"overrun flag not set reading large objects");
+ free(blob);
ralloc_free(ctx);
}