summaryrefslogtreecommitdiff
path: root/nest/a-path_test.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-01-22 16:32:42 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-01-22 16:32:42 +0100
commit5509e17d0c1b4e75d5911864f75ba119769e5725 (patch)
tree3ae4a63f807f3740611bb40f01524742fe9bf1f3 /nest/a-path_test.c
parentf8aad5d5b7601d0500841e57bafa5796cc3156ab (diff)
BGP: Support for AS confederations (RFC 5065)
Diffstat (limited to 'nest/a-path_test.c')
-rw-r--r--nest/a-path_test.c10
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);