diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2017-02-22 11:58:04 +0100 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2017-02-22 11:58:04 +0100 |
commit | c609d039860f97f400d2cf0e9ca2b4e87b3fd1cc (patch) | |
tree | 6141291f6d6fbc0a90320f39c01bde49a119eadf /nest/a-path_test.c | |
parent | 62e64905b76b88da72c522eac9276a74f60c9592 (diff) | |
parent | 2be9218a3b1dfcc8e42c8d118e95f2074d9f7a7c (diff) |
Merge branch 'int-new' into nexthop-merged
Diffstat (limited to 'nest/a-path_test.c')
-rw-r--r-- | nest/a-path_test.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nest/a-path_test.c b/nest/a-path_test.c index 289b2df6..fbf0f892 100644 --- a/nest/a-path_test.c +++ b/nest/a-path_test.c @@ -85,15 +85,19 @@ t_path_format(void) bt_debug("Prepending ASN: %10u \n", i); } -#define BUFFER_SIZE 26 +#define BUFFER_SIZE 120 byte buf[BUFFER_SIZE] = {}; + + as_path_format(&empty_as_path, buf, BUFFER_SIZE); + bt_assert_msg(strcmp(buf, "") == 0, "Buffer(%zu): '%s'", strlen(buf), buf); + as_path_format(as_path, buf, BUFFER_SIZE); - bt_assert_msg(strcmp(buf, "4294967294 4294967293 ...") == 0, "Buffer(%zu): '%s'", strlen(buf), buf); + bt_assert_msg(strcmp(buf, "4294967294 4294967293 4294967292 4294967291 4294967290 4294967289 4294967288 4294967287 4294967286 4294967285") == 0, "Buffer(%zu): '%s'", strlen(buf), buf); #define SMALL_BUFFER_SIZE 25 byte buf2[SMALL_BUFFER_SIZE] = {}; as_path_format(as_path, buf2, SMALL_BUFFER_SIZE); - bt_assert_msg(strcmp(buf2, "4294967294 ...") == 0, "Small Buffer(%zu): '%s'", strlen(buf2), buf2); + bt_assert_msg(strcmp(buf2, "4294967294 42...") == 0, "Small Buffer(%zu): '%s'", strlen(buf2), buf2); rfree(lp); |