--- xds_test_lib.c 2002/03/17 10:25:53 1.9
+++ xds_test_lib.c 2003/02/17 12:27:51 1.10
@@ -42,9 +42,9 @@
/* Open a bunch of contextes and close them again. */
for (i = 0; i < sizeof (ctx) / sizeof (xds_t *); ++i) {
if (i % 2 == 0)
- ctx[i] = xds_init(XDS_ENCODE);
+ xds_init(&ctx[i], XDS_ENCODE);
else
- ctx[i] = xds_init(XDS_DECODE);
+ xds_init(&ctx[i], XDS_DECODE);
if (ctx[i] == 0) {
printf("Failed to initialize xds context: i = %d\n", i);
@@ -57,7 +57,7 @@
#ifdef NDEBUG
/* Check how the library deals with errorneous arguments. */
- if (xds_init((xds_mode_t) 42) != NULL || errno != EINVAL) {
+ if (xds_init(NULL, (xds_mode_t)42) != NULL || errno != EINVAL) {
printf
("Called xds_init() with invalid mode but didn't get EINVAL.\n");
return 1;
@@ -98,8 +98,7 @@
size_t i;
/* Create context. */
- xds = xds_init(XDS_ENCODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_ENCODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -199,8 +198,7 @@
size_t buffer_size;
/* Create XDS context. */
- xds = xds_init(XDS_ENCODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_ENCODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -288,8 +286,7 @@
size_t new_len;
/* Create XDS context. */
- xds = xds_init(XDS_ENCODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_ENCODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -411,8 +408,7 @@
xds_t *xds;
/* Create XDS context. */
- xds = xds_init(XDS_ENCODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_ENCODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -493,8 +489,7 @@
char buffer[] = "Hallo!Hallo!Hallo!";
/* Create XDS context. */
- xds = xds_init(XDS_DECODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_DECODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -578,8 +573,7 @@
complain if it sees the second value -- what would mean that the args
parameter was not resetted to the original value before the engine is
restarted after buffer enlargement. */
- xds = xds_init(XDS_ENCODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_ENCODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -658,8 +652,7 @@
/* Encode our copy of mystruct using our encoding callback. Then get a
the buffer and destroy the context again. */
- xds = xds_init(XDS_ENCODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_ENCODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
@@ -695,8 +688,7 @@
xds_destroy(xds);
/* Now create a decoding context and decode the whole thing again. */
- xds = xds_init(XDS_DECODE);
- if (xds == NULL) {
+ if (xds_init(&xds, XDS_DECODE) != XDS_OK) {
printf("Failed to initialize XDS context.\n");
return 1;
}
|