20 printed = vsnprintf(buffer, maxlen+1, templat, parg);
22 printed = vsprintf(buffer, templat, parg);
42 #define EXPECT_CONTENT(expected) TEST_EXPECT_EQUAL(buf.get_data(), expected)
43 #define EXPECT_CONTENT__BROKEN(expected,got) TEST_EXPECT_EQUAL__BROKEN(buf.get_data(), expected, got)
45 void TEST_GBS_strstruct() {
58 buf.
nput(
'b', 3); EXPECT_CONTENT(
"bbb");
59 buf.
putlong(17); EXPECT_CONTENT(
"bbb17");
60 buf.
put(
'_'); EXPECT_CONTENT(
"bbb17_");
61 buf.
putfloat(3.5); EXPECT_CONTENT(
"bbb17_3.500000");
65 buf.
cut_tail(13); EXPECT_CONTENT(
"b");
66 buf.
cat(
"utter"); EXPECT_CONTENT(
"butter");
67 buf.
ncat(
"flying", 3); EXPECT_CONTENT(
"butterfly");
69 buf.
cut(4, 2); EXPECT_CONTENT(
"buttfly");
71 buf.
cat(
"er"); EXPECT_CONTENT(
"buttflyer");
73 buf.
cut(99, 99); EXPECT_CONTENT(
"buttflyer");
74 buf.
cut(0, 0); EXPECT_CONTENT(
"buttflyer");
75 buf.
cut(4, 0); EXPECT_CONTENT(
"buttflyer");
76 buf.
cut(0, 4); EXPECT_CONTENT(
"flyer");
77 buf.
cut(3, 2); EXPECT_CONTENT(
"fly");
78 buf.
cut(3, 99); EXPECT_CONTENT(
"fly");
79 buf.
cut(4, 99); EXPECT_CONTENT(
"fly");
80 buf.
cut(2, 1); EXPECT_CONTENT(
"fl");
81 buf.
cut(1, 99); EXPECT_CONTENT(
"f");
91 EXPECT_CONTENT(
"xxxxxxxxxxxxxxxxxxxx");
void cut_tail(size_t byte_count)
void cut(const size_t at, const size_t byte_count)
void vnprintf(size_t maxlen, const char *templat, va_list &parg) __ATTR__VFORMAT_MEMBER(2)
void nput(char c, size_t count)
void cat(const char *from)
char buffer[MESSAGE_BUFFERSIZE]
size_t get_buffer_size() const
void ncat(const char *from, size_t count)
#define assert_or_exit(cond)
void nprintf(size_t maxlen, const char *templat,...) __ATTR__FORMAT_MEMBER(2)
#define TEST_EXPECT_DIFFERENT(expr, want)
#define TEST_EXPECT_EQUAL(expr, want)
size_t get_position() const