summaryrefslogtreecommitdiffstats
path: root/src/util/support
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-02-10 00:20:48 +0000
committerGreg Hudson <ghudson@mit.edu>2009-02-10 00:20:48 +0000
commit73a6de998ac9cc42b34004a61fcc81a3a4186098 (patch)
tree628feaa5e325a2aec629211a4a4c45e4c017a351 /src/util/support
parent5b80063aebdb3eb2a330a47648137369661e5716 (diff)
downloadkrb5-73a6de998ac9cc42b34004a61fcc81a3a4186098.tar.gz
krb5-73a6de998ac9cc42b34004a61fcc81a3a4186098.tar.xz
krb5-73a6de998ac9cc42b34004a61fcc81a3a4186098.zip
Update t_k5buf.c for the renamed buffer type constants
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21939 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/support')
-rw-r--r--src/util/support/t_k5buf.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/util/support/t_k5buf.c b/src/util/support/t_k5buf.c
index 68916b3605..b0ae2807ba 100644
--- a/src/util/support/t_k5buf.c
+++ b/src/util/support/t_k5buf.c
@@ -43,9 +43,9 @@ static void fail_if(int condition, const char *name)
/* Test the invariants of a buffer. */
static void check_buf(struct k5buf *buf, const char *name)
{
- fail_if(buf->buftype != FIXED && buf->buftype != DYNAMIC
- && buf->buftype != ERROR, name);
- if (buf->buftype == ERROR)
+ fail_if(buf->buftype != BUFTYPE_FIXED && buf->buftype != BUFTYPE_DYNAMIC
+ && buf->buftype != BUFTYPE_ERROR, name);
+ if (buf->buftype == BUFTYPE_ERROR)
return;
fail_if(buf->space == 0, name);
fail_if(buf->space > SPACE_MAX, name);
@@ -135,7 +135,8 @@ static void test_realloc()
check_buf(&buf, "realloc 5");
s = krb5int_buf_data(&buf);
len = krb5int_buf_len(&buf);
- fail_if(buf.buftype != ERROR || s != NULL || len != -1, "realloc 5");
+ fail_if(buf.buftype != BUFTYPE_ERROR || s != NULL || len != -1,
+ "realloc 5");
krb5int_free_buf(&buf);
/* Cause a reallocation to fail by integer overflow. */
@@ -145,7 +146,8 @@ static void test_realloc()
check_buf(&buf, "realloc 6");
s = krb5int_buf_data(&buf);
len = krb5int_buf_len(&buf);
- fail_if(buf.buftype != ERROR || s != NULL || len != -1, "realloc 6");
+ fail_if(buf.buftype != BUFTYPE_ERROR || s != NULL || len != -1,
+ "realloc 6");
krb5int_free_buf(&buf);
}
@@ -162,7 +164,8 @@ static void test_overflow()
check_buf(&buf, "overflow 1");
s = krb5int_buf_data(&buf);
len = krb5int_buf_len(&buf);
- fail_if(buf.buftype != ERROR || s != NULL || len != -1, "overflow 1");
+ fail_if(buf.buftype != BUFTYPE_ERROR || s != NULL || len != -1,
+ "overflow 1");
/* Cause a fixed-sized buffer overflow with integer overflow. */
krb5int_buf_init_fixed(&buf, storage, sizeof(storage));
@@ -171,7 +174,8 @@ static void test_overflow()
check_buf(&buf, "overflow 2");
s = krb5int_buf_data(&buf);
len = krb5int_buf_len(&buf);
- fail_if(buf.buftype != ERROR || s != NULL || len != -1, "overflow 2");
+ fail_if(buf.buftype != BUFTYPE_ERROR || s != NULL || len != -1,
+ "overflow 2");
}
static void test_error()
@@ -182,7 +186,7 @@ static void test_error()
/* Cause an overflow and then perform actions afterwards. */
krb5int_buf_init_fixed(&buf, storage, sizeof(storage));
krb5int_buf_add(&buf, "1");
- fail_if(buf.buftype != ERROR, "error");
+ fail_if(buf.buftype != BUFTYPE_ERROR, "error");
check_buf(&buf, "error");
krb5int_buf_add(&buf, "test");
check_buf(&buf, "error");
@@ -190,7 +194,7 @@ static void test_error()
check_buf(&buf, "error");
krb5int_buf_truncate(&buf, 3);
check_buf(&buf, "error");
- fail_if(buf.buftype != ERROR, "error");
+ fail_if(buf.buftype != BUFTYPE_ERROR, "error");
}
static void test_truncate()
@@ -253,7 +257,7 @@ static void test_fmt()
check_buf(&buf, "fmt 2");
s = krb5int_buf_data(&buf);
len = krb5int_buf_len(&buf);
- fail_if(buf.buftype != ERROR || s != NULL || len != -1, "fmt 2");
+ fail_if(buf.buftype != BUFTYPE_ERROR || s != NULL || len != -1, "fmt 2");
/* Format some text into a non-empty dynamic buffer. */
krb5int_buf_init_dynamic(&buf);