From c44028b6076a021c0f23e761add8067b3cd22567 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Tue, 12 Aug 2025 14:20:08 +0200 Subject: piece-table: `piece-table-to-string` add size arg --- tests/piece-table-delete.c | 8 ++++---- tests/piece-table-insert.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/piece-table-delete.c b/tests/piece-table-delete.c index dc54ccc..4a99b79 100644 --- a/tests/piece-table-delete.c +++ b/tests/piece-table-delete.c @@ -9,21 +9,21 @@ main() char tmp[100]; piece_table_delete(pt, 0, 10); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "")) return 1; piece_table_destroy(pt); pt = piece_table_create("0123456789"); piece_table_delete(pt, 0, 1); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "123456789")) return 2; piece_table_destroy(pt); pt = piece_table_create("0123456789"); piece_table_delete(pt, 9, 1); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "012345678")) return 3; piece_table_destroy(pt); @@ -31,7 +31,7 @@ main() pt = piece_table_create("0123456789"); piece_table_delete(pt, 7, 1); piece_table_delete(pt, 0, 1); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "12345689")) return 4; piece_table_destroy(pt); diff --git a/tests/piece-table-insert.c b/tests/piece-table-insert.c index bcf6dc5..54ff842 100644 --- a/tests/piece-table-insert.c +++ b/tests/piece-table-insert.c @@ -9,17 +9,17 @@ main() char tmp[100]; piece_table_insert(pt, 10, "abcdefgh", 8); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "0123456789abcdefgh")) return 1; piece_table_insert(pt, 18, "abcdefgh", 8); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "0123456789abcdefghabcdefgh")) return 2; piece_table_insert(pt, 4, "abcdefgh", 8); - piece_table_to_string(pt, tmp); + piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "0123abcdefgh456789abcdefghabcdefgh")) return 3; -- cgit v1.2.3