summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/piece-table-delete.c44
-rw-r--r--tests/piece-table-insert.c22
2 files changed, 33 insertions, 33 deletions
diff --git a/tests/piece-table-delete.c b/tests/piece-table-delete.c
index bcc4fce..af0017b 100644
--- a/tests/piece-table-delete.c
+++ b/tests/piece-table-delete.c
@@ -3,38 +3,38 @@
#include "../src/piece-table-internals.h"
int
-main()
+main ()
{
- piece_table *pt = piece_table_create_from_str("0123456789", 10);
+ piece_table *pt = piece_table_create_from_str ("0123456789", 10);
char tmp[100];
- piece_table_delete(pt, 0, 10);
- piece_table_to_string(pt, tmp, 99);
- if (strcmp(tmp, ""))
+ piece_table_delete (pt, 0, 10);
+ piece_table_to_string (pt, tmp, 99);
+ if (strcmp (tmp, ""))
return 1;
- piece_table_destroy(pt);
+ piece_table_destroy (pt);
- pt = piece_table_create_from_str("0123456789", 10);
- piece_table_delete(pt, 0, 1);
- piece_table_to_string(pt, tmp, 99);
- if (strcmp(tmp, "123456789"))
+ pt = piece_table_create_from_str ("0123456789", 10);
+ piece_table_delete (pt, 0, 1);
+ piece_table_to_string (pt, tmp, 99);
+ if (strcmp (tmp, "123456789"))
return 2;
- piece_table_destroy(pt);
+ piece_table_destroy (pt);
- pt = piece_table_create_from_str("0123456789", 10);
- piece_table_delete(pt, 9, 1);
- piece_table_to_string(pt, tmp, 99);
- if (strcmp(tmp, "012345678"))
+ pt = piece_table_create_from_str ("0123456789", 10);
+ piece_table_delete (pt, 9, 1);
+ piece_table_to_string (pt, tmp, 99);
+ if (strcmp (tmp, "012345678"))
return 3;
- piece_table_destroy(pt);
+ piece_table_destroy (pt);
- pt = piece_table_create_from_str("0123456789", 10);
- piece_table_delete(pt, 7, 1);
- piece_table_delete(pt, 0, 1);
- piece_table_to_string(pt, tmp, 99);
- if (strcmp(tmp, "12345689"))
+ pt = piece_table_create_from_str ("0123456789", 10);
+ piece_table_delete (pt, 7, 1);
+ piece_table_delete (pt, 0, 1);
+ piece_table_to_string (pt, tmp, 99);
+ if (strcmp (tmp, "12345689"))
return 4;
- piece_table_destroy(pt);
+ piece_table_destroy (pt);
return 0;
}
diff --git a/tests/piece-table-insert.c b/tests/piece-table-insert.c
index 8a21435..2f2ef38 100644
--- a/tests/piece-table-insert.c
+++ b/tests/piece-table-insert.c
@@ -5,24 +5,24 @@
int
main()
{
- piece_table *pt = piece_table_create_from_str("0123456789", 10);
+ piece_table *pt = piece_table_create_from_str ("0123456789", 10);
char tmp[100];
- piece_table_insert(pt, 10, "abcdefgh", 8);
- piece_table_to_string(pt, tmp, 99);
- if (strcmp(tmp, "0123456789abcdefgh"))
+ piece_table_insert (pt, 10, "abcdefgh", 8);
+ 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, 99);
- if (strcmp(tmp, "0123456789abcdefghabcdefgh"))
+ piece_table_insert (pt, 18, "abcdefgh", 8);
+ 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, 99);
- if (strcmp(tmp, "0123abcdefgh456789abcdefghabcdefgh"))
+ piece_table_insert (pt, 4, "abcdefgh", 8);
+ piece_table_to_string (pt, tmp, 99);
+ if (strcmp (tmp, "0123abcdefgh456789abcdefghabcdefgh"))
return 3;
- piece_table_destroy(pt);
+ piece_table_destroy (pt);
return 0;
}