-
Notifications
You must be signed in to change notification settings - Fork 1
/
strutil_test.c
38 lines (33 loc) · 1.07 KB
/
strutil_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "strutil.h"
#include <stdio.h>
#include <time.h>
// A little test program to verify that config file loading works.
int main(int argc, char **argv) {
buffer_reset();
buffer_append("Hello ");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World %s", "Foo Long very long long long");
buffer_append("World %s", "Foo Long very long long long");
buffer_append("World %s", "Foo Long very long long long");
buffer_append("World %s", "Foo Long very long long long");
buffer_append("World %s", "Foo Long very long long long");
buffer_append("World %s", "Foo Long very long long long");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
buffer_append("World");
for (int i = 0; i < 250000; i++) {
printf("%s\n", buffer_get());
}
// /a.out 0.13s user 0.43s system 2% cpu 24.798 total
}