#include #include #include "../src/piece-table.h" int main() { piece_table *pt = piece_table_create_from("0123456789", 10); char tmp[100]; 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")) return 2; piece_table_insert(pt, 4, "abcdefgh", 8); piece_table_to_string(pt, tmp, 99); if (strcmp(tmp, "0123abcdefgh456789abcdefghabcdefgh")) return 3; piece_table_destroy(pt); return 0; }