Yes, this is not the correct way to do it.
The unprofessional way to do it (aka my way) is to use some global temporary string:
STRING* str_tmp = "";
..
void dododo(var testnum)
{
str_cpy(str_tmp,"Test");
str_cat(str_tmp,str_for_num(NULL,testnum));
do something with str_tmp, for example "error()" it
}
Alternatively, you could create a string locally and remove it after use:
void dododo(var testnum)
{
STRING* str_tmp;
str_tmp = str_create(""); // of course you can write the "Test" content here, too
str_cpy(str_tmp,"Test");
str_cat(str_tmp,str_for_num(NULL,testnum));
do something with str_tmp, for example "error()" it
ptr_remove(str_tmp);
}
In your case specifically you can use str_printf:
str_printf(NULL,"Test%d",(int)testVar); // see manual -> digits/ format strings