Added code to increment counters accordingly in test_verify. Added test_verify_int.
This commit was SVN r552.
Этот коммит содержится в:
родитель
988d1806c2
Коммит
14588b8390
@ -60,22 +60,48 @@ int test_verify(char *expected_result, char *test_result){
|
|||||||
size_t len_expect,len_result;
|
size_t len_expect,len_result;
|
||||||
int return_value;
|
int return_value;
|
||||||
|
|
||||||
return_value=1;
|
return_value = 1;
|
||||||
len_expect=strlen(expected_result);
|
len_expect = strlen(expected_result);
|
||||||
len_result=strlen(test_result);
|
len_result = strlen(test_result);
|
||||||
|
|
||||||
if( (!(len_expect == len_result)) ||
|
if( (!(len_expect == len_result)) ||
|
||||||
( 0 != strcmp(expected_result,test_result)) ) {
|
( 0 != strcmp(expected_result,test_result)) ) {
|
||||||
fprintf(stderr," Comparison failure: \n");
|
test_failure("Comparison failure");
|
||||||
fprintf(stderr," Expected result: %s \n",expected_result);
|
fprintf(stderr," Expected result: %s \n", expected_result);
|
||||||
fprintf(stderr," Test result: %s \n",test_result);
|
fprintf(stderr," Test result: %s \n", test_result);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
return_value=0;
|
return_value = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
test_success();
|
||||||
}
|
}
|
||||||
|
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int test_verify_int(int expected_result, int test_result)
|
||||||
|
{
|
||||||
|
/* local variables */
|
||||||
|
int return_value;
|
||||||
|
|
||||||
|
return_value = 1;
|
||||||
|
if( expected_result != test_result )
|
||||||
|
{
|
||||||
|
test_failure("Comparison failure");
|
||||||
|
fprintf(stderr," Expected result: %d \n", expected_result);
|
||||||
|
fprintf(stderr," Test result: %d \n", test_result);
|
||||||
|
fflush(stderr);
|
||||||
|
return_value = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
test_success();
|
||||||
|
}
|
||||||
|
|
||||||
|
return return_value;
|
||||||
|
}
|
||||||
|
|
||||||
int test_finalize(void)
|
int test_finalize(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ void test_init(char *a);
|
|||||||
void test_success(void);
|
void test_success(void);
|
||||||
void test_failure(char *a);
|
void test_failure(char *a);
|
||||||
int test_verify(char *expected_result, char *test_result);
|
int test_verify(char *expected_result, char *test_result);
|
||||||
|
int test_verify_int(int expected_result, int test_result);
|
||||||
int test_finalize(void);
|
int test_finalize(void);
|
||||||
|
|
||||||
#endif /* LAM_SUPPORT_H */
|
#endif /* LAM_SUPPORT_H */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user