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); } }
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; }