Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
vasudeva8 committed Jan 13, 2025
1 parent d9d1922 commit 027d3a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ gcc_task:
image: gcc:latest
cpu: 2
memory: 1G
steps:
- uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true

environment:
LC_ALL: C
Expand Down
24 changes: 20 additions & 4 deletions test/test_kstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,11 @@ static int test_kinsertchar(void) {
return -1;
}
if (s.s[s.l] != '\0') {
fprintf(stderr, "No NUL termination on string from kinsert_char\n");
for (i = 0; i < s.m; ++i) {
fprintf(stderr, "%c %d ", s.s[i], s.s[i]);
}
fprintf(stderr, "length %llu/%llu\n", s.l, s.m);
fprintf(stderr, "No NUL termination on string from kinsert_char1\n");
ks_free(&s);
return -1;
}
Expand All @@ -492,7 +496,11 @@ static int test_kinsertchar(void) {
return -1;
}
if (t.s[t.l] != '\0') {
fprintf(stderr, "No NUL termination on string from kinsert_char\n");
for (i = 0; i < t.m; ++i) {
fprintf(stderr, "%c %d ", t.s[i], t.s[i]);
}
fprintf(stderr, "length %llu/%llu\n", t.l, t.m);
fprintf(stderr, "No NUL termination on string from kinsert_char2\n");
ks_free(&res); ks_free(&t);
return -1;
}
Expand Down Expand Up @@ -527,7 +535,11 @@ static int test_kinsertstr(void) {
return -1;
}
if (s.s[s.l] != '\0') {
fprintf(stderr, "No NUL termination on string from kinsert_str\n");
for (i = 0; i < s.m; ++i) {
fprintf(stderr, "%c %d ", s.s[i], s.s[i]);
}
fprintf(stderr, "length %d/%d\n", s.l, s.m);
fprintf(stderr, "No NUL termination on string from kinsert_str1\n");
return -1;
}
if (memcmp(s.s, tdata[i + 1].val, s.l + 1)) {
Expand All @@ -547,8 +559,12 @@ static int test_kinsertstr(void) {
return -1;
}
if (t.s[t.l] != '\0') {
for (i = 0; i < t.m; ++i) {
fprintf(stderr, "%c %d ", t.s[i], t.s[i]);
}
fprintf(stderr, "length %d/%d\n", t.l, t.m);
ks_free(&val); ks_free(&res);
fprintf(stderr, "No NUL termination on string from kinsert_str\n");
fprintf(stderr, "No NUL termination on string from kinsert_str2\n");
return -1;
}
if (memcmp(t.s, res.s, res.l+1)) {
Expand Down

0 comments on commit 027d3a9

Please sign in to comment.