static void test_Cat(TestBatch *batch) { CharBuf *wanted = CB_newf("a%s", smiley); CharBuf *got = S_get_cb(""); CB_Cat(got, wanted); TEST_TRUE(batch, CB_Equals(wanted, (Obj*)got), "Cat"); DECREF(got); got = S_get_cb("a"); CB_Cat_Char(got, 0x263A); TEST_TRUE(batch, CB_Equals(wanted, (Obj*)got), "Cat_Char"); DECREF(got); got = S_get_cb("a"); CB_Cat_Str(got, smiley, smiley_len); TEST_TRUE(batch, CB_Equals(wanted, (Obj*)got), "Cat_Str"); DECREF(got); got = S_get_cb("a"); CB_Cat_Trusted_Str(got, smiley, smiley_len); TEST_TRUE(batch, CB_Equals(wanted, (Obj*)got), "Cat_Trusted_Str"); DECREF(got); DECREF(wanted); }
static void S_cat_seg_name(CharBuf *seg_name, u32_t seg_num) { CharBuf *base_36 = StrHelp_to_base36(seg_num); CB_Cat_Str(seg_name, "seg_", 4); CB_Cat(seg_name, base_36); DECREF(base_36); }