summaryrefslogtreecommitdiff
path: root/tests/fuzz_parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fuzz_parse.cpp')
-rw-r--r--tests/fuzz_parse.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/fuzz_parse.cpp b/tests/fuzz_parse.cpp
new file mode 100644
index 0000000..e758196
--- /dev/null
+++ b/tests/fuzz_parse.cpp
@@ -0,0 +1,16 @@
+#include "../src/pugixml.hpp"
+#include "allocator.hpp"
+
+int main(int argc, const char** argv)
+{
+ pugi::set_memory_management_functions(memory_allocate, memory_deallocate);
+
+ pugi::xml_document doc;
+
+ for (int i = 1; i < argc; ++i)
+ {
+ doc.load_file(argv[i]);
+ doc.load_file(argv[i], pugi::parse_minimal);
+ doc.load_file(argv[i], pugi::parse_full);
+ }
+}