Beispiel #1
0
int main() {
	char s[] = "toto";
	printf("%d\n", mon_strlen(s));
	
	char s1[20] = "abce";
	char s2[] = "abcd";
	printf("%d\n", mon_strcmp(s1, s2));
	printf("%d\n", mon_strncmp(s1, s2, 3));
	printf("%s + %s = %s \n", s1, s2, mon_strcat(s1, s2));
	printf("%c\n", *mon_strchr(s, 'o'));
	
	char str[] = "abcdef";
	char substr[] = "cd";
	printf("%s\n", mon_strstr(str, substr));
	
	return 0;
}
Beispiel #2
0
MU_TEST(mon_strcmp, mon_strcmp_a_greater_than_b_vide) {
    MU_ASSERT_GREATER(mon_strcmp("AZE",""), 0) ;
}
Beispiel #3
0
MU_TEST(mon_strcmp, mon_strcmp_a_greater_than_b) {
    MU_ASSERT_GREATER(mon_strcmp("KCD","EF"), 0) ;
}
Beispiel #4
0
MU_TEST(mon_strcmp, mon_strcmp_a_left_factor_of_b) {
    MU_ASSERT_LESS(mon_strcmp("BCD","BCDYU"), 0) ;
}
Beispiel #5
0
MU_TEST(mon_strcmp, mon_strcmp_a_less_than_b) {
    MU_ASSERT_LESS(mon_strcmp("BCD","EF"), 0) ;
}
Beispiel #6
0
MU_TEST(mon_strcmp, mon_strcmp_a_equals_b_non_vide) {
    MU_ASSERT_EQUAL(mon_strcmp("UIO","UIO"), 0) ;
}
Beispiel #7
0
MU_TEST(mon_strcmp, mon_strcmp_a_equals_b_vide) {
    MU_ASSERT_EQUAL(mon_strcmp("",""), 0) ;
}