]> git.ozlabs.org Git - petitboot/blobdiff - test/parser/utils.c
test/parser: Allow tests to provide pre-loaded config data
[petitboot] / test / parser / utils.c
index 16c415a1ebd7477f27baa2fcfbd96cf5362fab0a..a1d0ad24b590d9938dcdd12ed00b3548137d1e97 100644 (file)
@@ -85,6 +85,13 @@ void test_fini(struct parser_test *test)
        talloc_free(test);
 }
 
+void __test_read_conf_data(struct parser_test *test,
+               const char *buf, size_t len)
+{
+       test->conf.size = len;
+       test->conf.buf = talloc_memdup(test, buf, len);
+}
+
 void test_read_conf_file(struct parser_test *test, const char *filename)
 {
        struct stat stat;