File: test_mark_get_between_mark.c

package info (click to toggle)
mle 1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,508 kB
  • sloc: ansic: 9,582; sh: 383; php: 228; makefile: 82
file content (15 lines) | stat: -rw-r--r-- 390 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "test.h"

char *str = "hello\nworld";

void test(buffer_t *buf, mark_t *cur) {
    char *str;
    bint_t str_len;
    mark_t *other;
    other = buffer_add_mark(buf, NULL, 0);
    mark_move_beginning(cur);
    mark_move_end(other);
    mark_get_between_mark(cur, other, &str, &str_len);
    ASSERT("len", 11, str_len);
    ASSERT("eq", 0, strncmp(str, "hello\nworld", str_len));
}