Skip to content

Commit 95de3cf

Browse files
fix append cases
1 parent ba7ec9b commit 95de3cf

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

code/tests/cases/test_cstring.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,11 @@ FOSSIL_TEST(c_test_cstring_strip_quotes) {
337337

338338
FOSSIL_TEST(c_test_cstring_append) {
339339
cstring str = fossil_io_cstring_create("Hello");
340-
int rc = fossil_io_cstring_append(&str, ", World!");
341-
ASSUME_ITS_EQUAL_I32(0, rc);
342-
ASSUME_ITS_EQUAL_CSTR("Hello, World!", str);
340+
cstring result = fossil_io_cstring_append(str, ", World!");
341+
ASSUME_NOT_CNULL(result);
342+
ASSUME_ITS_EQUAL_CSTR("Hello, World!", result);
343343
fossil_io_cstring_free(str);
344+
fossil_io_cstring_free(result);
344345
}
345346

346347
// * * * * * * * * * * * * * * * * * * * * * * * *

code/tests/cases/test_cstring.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,11 @@ FOSSIL_TEST(cpp_test_cstring_strip_quotes) {
304304

305305
FOSSIL_TEST(cpp_test_cstring_append) {
306306
cstring str = fossil_io_cstring_create("Hello");
307-
int rc = fossil_io_cstring_append(&str, ", World!");
308-
ASSUME_ITS_EQUAL_I32(0, rc);
309-
ASSUME_ITS_EQUAL_CSTR("Hello, World!", str);
307+
cstring result = fossil_io_cstring_append(str, ", World!");
308+
ASSUME_NOT_CNULL(result);
309+
ASSUME_ITS_EQUAL_CSTR("Hello, World!", result);
310310
fossil_io_cstring_free(str);
311+
fossil_io_cstring_free(result);
311312
}
312313

313314
FOSSIL_TEST(cpp_test_cstring_stream_create_and_free) {

0 commit comments

Comments
 (0)