summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-06-30 15:56:17 -0400
committerJakob Kaivo <jkk@ung.org>2020-06-30 15:56:17 -0400
commit30779981519a03506e515851a760a1f1f5a98a23 (patch)
tree4c7726e6b1e988aa04a351da99d93dd53c138f67 /test
parent9a1d1230d08dd16ce49ce8b5253693bfe711fd5b (diff)
use consistent MA_ prefix
Diffstat (limited to 'test')
-rw-r--r--test/double-free.c6
-rw-r--r--test/overflow.c2
-rw-r--r--test/realloc.c6
-rw-r--r--test/underflow.c2
-rw-r--r--test/use-after-free.c4
-rw-r--r--test/zero.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/test/double-free.c b/test/double-free.c
index 73ceff5..6771dee 100644
--- a/test/double-free.c
+++ b/test/double-free.c
@@ -8,12 +8,12 @@ int main(void)
{
const char buf[] = "THIS IS A CONSTANT STRING";
- char *ptr = map_malloc(sizeof(buf));
+ char *ptr = MA_malloc(sizeof(buf));
memcpy(ptr, buf, sizeof(buf));
printf("%p: %s\n", ptr, ptr);
- map_free(ptr);
+ MA_free(ptr);
printf("freed\n");
- map_free(ptr);
+ MA_free(ptr);
printf("freed again\n");
}
diff --git a/test/overflow.c b/test/overflow.c
index 8bb1681..67da24a 100644
--- a/test/overflow.c
+++ b/test/overflow.c
@@ -5,7 +5,7 @@
int main(void)
{
- char *ptr = map_malloc(1);
+ char *ptr = MA_malloc(1);
long pagesize = sysconf(_SC_PAGESIZE);
printf("ptr: %p, pagesize %ld\n", ptr, pagesize);
ptr[pagesize] = '\0';
diff --git a/test/realloc.c b/test/realloc.c
index 8106b1f..f7b33ff 100644
--- a/test/realloc.c
+++ b/test/realloc.c
@@ -8,15 +8,15 @@ int main(void)
{
const char buf[] = "THIS IS A CONSTANT STRING";
- char *ptr = map_realloc(NULL, sizeof(buf));
+ char *ptr = MA_realloc(NULL, sizeof(buf));
memcpy(ptr, buf, sizeof(buf));
printf("%p: %s\n", ptr, ptr);
- ptr = map_realloc(ptr, sizeof(buf) * 2);
+ ptr = MA_realloc(ptr, sizeof(buf) * 2);
memcpy(ptr + sizeof(buf) - 1, buf, sizeof(buf));
printf("%p: %s\n", ptr, ptr);
- ptr = map_realloc(ptr, sizeof(buf) * sysconf(_SC_PAGESIZE));
+ ptr = MA_realloc(ptr, sizeof(buf) * sysconf(_SC_PAGESIZE));
memcpy(ptr + (2 * sizeof(buf)) - 2, buf, sizeof(buf));
printf("%p: %s\n", ptr, ptr);
}
diff --git a/test/underflow.c b/test/underflow.c
index f23aa6d..e8cadf5 100644
--- a/test/underflow.c
+++ b/test/underflow.c
@@ -5,7 +5,7 @@
int main(void)
{
- char *ptr = map_malloc(1);
+ char *ptr = MA_malloc(1);
long pagesize = sysconf(_SC_PAGESIZE);
printf("ptr: %p, pagesize %ld\n", ptr, pagesize);
ptr[-1] = '\0';
diff --git a/test/use-after-free.c b/test/use-after-free.c
index 4338ed5..c7ae9cb 100644
--- a/test/use-after-free.c
+++ b/test/use-after-free.c
@@ -8,11 +8,11 @@ int main(void)
{
const char buf[] = "THIS IS A CONSTANT STRING";
- char *ptr = map_malloc(sizeof(buf));
+ char *ptr = MA_malloc(sizeof(buf));
memcpy(ptr, buf, sizeof(buf));
printf("%p: %s\n", ptr, ptr);
- map_free(ptr);
+ MA_free(ptr);
printf("freed\n");
printf("%p: %s\n", ptr, ptr);
}
diff --git a/test/zero.c b/test/zero.c
index 7be3ad2..15c0890 100644
--- a/test/zero.c
+++ b/test/zero.c
@@ -5,7 +5,7 @@
int main(void)
{
- char *ptr = map_malloc(0);
+ char *ptr = MA_malloc(0);
long pagesize = sysconf(_SC_PAGESIZE);
printf("ptr: %p, pagesize %ld\n", ptr, pagesize);
ptr[0] = '\0';