summaryrefslogtreecommitdiff
path: root/api_test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-01-03 22:08:38 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-03 22:08:38 -0800
commit60b6962db0b0488667180e11cc6cfb1cec1b41ea (patch)
tree9f3d399e48b781b5e363b47a2aa04e2b758e331c /api_test
parentcc50a3aba3e34dc58ca819a65b907871e2ea6fd9 (diff)
Revert "Change types for source map offsets (#174)"
This reverts commit 4fbe344df43ed7f60a3d3a53981088334cb709fc.
Diffstat (limited to 'api_test')
-rw-r--r--api_test/main.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/api_test/main.c b/api_test/main.c
index 61291dc..17e1582 100644
--- a/api_test/main.c
+++ b/api_test/main.c
@@ -5,7 +5,6 @@
#define CMARK_NO_SHORT_NAMES
#include "cmark.h"
#include "node.h"
-#include "parser.h"
#include "harness.h"
#include "cplusplus.h"
@@ -884,41 +883,6 @@ static void test_feed_across_line_ending(test_batch_runner *runner) {
cmark_node_free(document);
}
-static cmark_node *S_parse_with_fake_total(bufsize_t fake_total,
- const char *str,
- cmark_err_type *err) {
- cmark_parser *parser = cmark_parser_new(CMARK_OPT_DEFAULT);
- parser->total_bytes = fake_total;
- cmark_parser_feed(parser, str, strlen(str));
- cmark_node *doc = cmark_parser_finish(parser);
- *err = cmark_parser_get_error(parser);
- cmark_parser_free(parser);
- return doc;
-}
-
-static void test_bufsize_overflow(test_batch_runner *runner) {
- cmark_node *doc;
- cmark_err_type err;
-
- doc = S_parse_with_fake_total(BUFSIZE_MAX, "a", &err);
- OK(runner, doc == NULL, "parse 1 byte after BUFSIZE_MAX bytes fails");
- INT_EQ(runner, err, CMARK_ERR_INPUT_TOO_LARGE,
- "parse 1 byte after BUFSIZE_MAX bytes error code");
-
- doc = S_parse_with_fake_total(BUFSIZE_MAX - 9, "0123456789", &err);
- OK(runner, doc == NULL, "parse 10 byte after BUFSIZE_MAX-9 bytes fails");
- INT_EQ(runner, err, CMARK_ERR_INPUT_TOO_LARGE,
- "parse 10 byte after BUFSIZE_MAX-9 bytes error code");
-
- doc = S_parse_with_fake_total(BUFSIZE_MAX - 1, "a", &err);
- OK(runner, doc != NULL, "parse 1 byte after BUFSIZE_MAX-1 bytes");
- cmark_node_free(doc);
-
- doc = S_parse_with_fake_total(BUFSIZE_MAX - 10, "0123456789", &err);
- OK(runner, doc != NULL, "parse 10 byte after BUFSIZE_MAX-10 bytes");
- cmark_node_free(doc);
-}
-
int main() {
int retval;
test_batch_runner *runner = test_batch_runner_new();
@@ -944,7 +908,6 @@ int main() {
test_cplusplus(runner);
test_safe(runner);
test_feed_across_line_ending(runner);
- test_bufsize_overflow(runner);
test_print_summary(runner);
retval = test_ok(runner) ? 0 : 1;