31
31
rv = apr_file_mktemp(fd, template, APR_CREATE | APR_TRUNCATE | APR_DELONCLOSE |
32
32
APR_READ | APR_WRITE | APR_EXCL, p);
33
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
33
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
35
35
if (rv != APR_SUCCESS)
38
38
rv = apr_file_puts("<?xml version=\"1.0\" ?>\n<maryx>"
39
39
"<had a=\"little\"/><lamb its='fleece "
40
40
"was white as snow' />\n", *fd);
41
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
41
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
43
43
for (i = 0; i < 5000; i++) {
44
44
rv = apr_file_puts("<hmm roast=\"lamb\" "
45
45
"for=\"dinner\">yummy</hmm>\n", *fd);
46
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
46
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
49
49
rv = apr_file_puts("</mary>\n", *fd);
50
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
50
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
52
52
rv = apr_file_seek(*fd, APR_SET, &off);
53
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
53
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
66
66
rv = apr_file_mktemp(fd, template, APR_CREATE | APR_TRUNCATE | APR_DELONCLOSE |
67
67
APR_READ | APR_WRITE | APR_EXCL, p);
68
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
68
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
70
70
if (rv != APR_SUCCESS)
73
73
rv = apr_file_puts("<?xml version=\"1.0\" ?>\n<mary>\n", *fd);
74
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
74
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
76
76
for (i = 0; i < 5000; i++) {
77
77
rv = apr_file_puts("<hmm roast=\"lamb\" "
78
78
"for=\"dinner\">yummy</hmm>\n", *fd);
79
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
79
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
82
82
rv = apr_file_puts("</mary>\n", *fd);
83
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
83
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
85
85
rv = apr_file_seek(*fd, APR_SET, &off);
86
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
86
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
97
ABTS_STR_EQUAL(tc, e->name, "mary");
97
ABTS_STR_EQUAL(tc, "mary", e->name);
99
ABTS_STR_EQUAL(tc, e->name, "hmm");
99
ABTS_STR_EQUAL(tc, "hmm", e->name);
104
104
ABTS_PTR_NOTNULL(tc, a);
105
ABTS_STR_EQUAL(tc, a->name, "for");
106
ABTS_STR_EQUAL(tc, a->value, "dinner");
105
ABTS_STR_EQUAL(tc, "for", a->name);
106
ABTS_STR_EQUAL(tc, "dinner", a->value);
108
108
ABTS_PTR_NOTNULL(tc, a);
109
ABTS_STR_EQUAL(tc, a->name, "roast");
110
ABTS_STR_EQUAL(tc, a->value, "lamb");
109
ABTS_STR_EQUAL(tc, "roast", a->name);
110
ABTS_STR_EQUAL(tc, "lamb", a->value);
112
112
if (e->first_child) {
113
113
ec = e->first_child;
128
128
rv = create_dummy_file(tc, p, &fd);
129
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
129
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
131
131
if (rv != APR_SUCCESS)
134
134
rv = apr_xml_parse_file(p, &parser, &doc, fd, 2000);
135
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
135
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
137
137
dump_xml(tc, doc->root, 0);
139
139
rv = apr_file_close(fd);
140
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
140
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
142
142
rv = create_dummy_file_error(tc, p, &fd);
143
ABTS_INT_EQUAL(tc, rv, APR_SUCCESS);
143
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
145
145
if (rv != APR_SUCCESS)