File: test_ppb_url_request_info.c

package info (click to toggle)
freshplayerplugin 0.3.5-1
  • links: PTS, VCS
  • area: contrib
  • in suites: stretch
  • size: 5,324 kB
  • ctags: 13,257
  • sloc: ansic: 45,542; cpp: 26,176; yacc: 1,707; lex: 910; python: 176; sh: 87; makefile: 21
file content (24 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#undef NDEBUG
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <src/ppb_url_request_info.c>

#define test_ltrim(in, out)                                         \
    do {                                                            \
        const char *s = ltrim(in);                                  \
        assert(strcmp(s, out) == 0);                                \
    } while (0)

int
main(void)
{
    test_ltrim("", "");
    test_ltrim("hello", "hello");
    test_ltrim("   hello", "hello");
    test_ltrim(" \t  hello", "hello");
    test_ltrim("\n\nhello", "hello");

    printf("pass\n");
    return 0;
}