feat(ltm): add file data support
This commit is contained in:
parent
c26c8cf18a
commit
f37cfc30af
7 changed files with 86 additions and 4 deletions
|
|
@ -18,10 +18,21 @@ void test_single_placeholder() {
|
|||
TEST_CHECK(ltm_instance_size(instance) == 13);
|
||||
|
||||
char buf[13];
|
||||
|
||||
size_t written = 0;
|
||||
TEST_CHECK(ltm_instance_write(&written, buf, 13, instance) == ltm_err_done);
|
||||
TEST_CHECK(written == 13);
|
||||
TEST_CHECK(ltm_instance_write(&written, buf, 5, instance) == ltm_err_ok);
|
||||
TEST_CHECK(written == 5);
|
||||
|
||||
written = 0;
|
||||
TEST_CHECK(ltm_instance_write(&written, buf + 5, 5, instance) == ltm_err_ok);
|
||||
TEST_CHECK(written == 5);
|
||||
|
||||
written = 0;
|
||||
TEST_CHECK(ltm_instance_write(&written, buf + 10, 5, instance) == ltm_err_done);
|
||||
TEST_CHECK(written == 3);
|
||||
|
||||
TEST_CHECK(strncmp(buf, "Hello, World!", 13) == 0);
|
||||
TEST_DUMP("buf", buf, 13);
|
||||
|
||||
ltm_instance_free(instance);
|
||||
ltm_template_free(template);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue