Exemplo n.º 1
0
void testMY_STRRFIND(void){
    if(temp_file != NULL){
        char* ch;
        ch = my_strrfind("testing", 't');
        CU_ASSERT_STRING_EQUAL(ch, "ting");
        ch = my_strrfind("testing", 'q');
        CU_ASSERT(ch == NULL);
        ch = my_strrfind(NULL, 'g');
        CU_ASSERT(ch == NULL);
    }
}
Exemplo n.º 2
0
bool is_unit_expression(char* exp)
{
	
	int pos = my_strfind(exp,'(');
	int rpos= my_strrfind(exp,')');
	if((pos==-1) && (rpos==-1))
		return true;
	else
		return false;
}