[868] in Kerberos-V5-bugs
Make check in tests/asn.1 always 'succeed'
daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Tue Oct 18 09:49:30 1994
From: epeisach@MIT.EDU
Date: Tue, 18 Oct 1994 09:49:25 -0400
To: krb5-bugs@MIT.EDU
make check will never bomb out as the decode test never returns with a
non-zero exit status. It may be me, but I prefer a make check to run
until something is wrong and then stop there.
(BTW: On osf 1.3, using the cc compiler, ccopts=-O will break asn.1.
ccopts-O1 will not.).
The following patch will make the tests die after noticing an error.
(actually after running all tests). I do not know what the other test
programs do.... I suspect the results are mixed...
Ezra
===================================================================
RCS file: /mit/krb5/.cvsroot/src/tests/asn.1/debug.h,v
retrieving revision 1.1
diff -c -r1.1 debug.h
*** 1.1 1994/08/04 06:14:00
--- debug.h 1994/10/18 13:39:08
***************
*** 12,20 ****
#include <stdio.h>
#define assert(pred,message)\
if(pred) printf("OK: ");\
! else printf("ERROR: ");\
printf(message);
#endif
--- 12,22 ----
#include <stdio.h>
+ extern int error_count;
+
#define assert(pred,message)\
if(pred) printf("OK: ");\
! else { printf("ERROR: "); error_count++;} \
printf(message);
#endif
===================================================================
RCS file: /mit/krb5/.cvsroot/src/tests/asn.1/krb5_decode_test.c,v
retrieving revision 1.3
diff -c -r1.3 krb5_decode_test.c
*** 1.3 1994/10/04 19:35:36
--- krb5_decode_test.c 1994/10/18 13:39:25
***************
*** 10,15 ****
--- 10,17 ----
/* See krb5_encode_test.c for explanation. */
/*#define ISODE_SUCKS*/
+ int error_count = 0;
+
void main()
{
krb5_data code;
***************
*** 352,356 ****
decode_run("PasswdData","","30 3D A0 03 02 01 02 A1 36 30 34 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61",decode_krb5_pwd_data,ktest_equal_krb5_pwd_data);
}
! exit(0);
}
--- 354,358 ----
decode_run("PasswdData","","30 3D A0 03 02 01 02 A1 36 30 34 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61 30 18 A0 0A 04 08 6B 72 62 35 64 61 74 61 A1 0A 04 08 6B 72 62 35 64 61 74 61",decode_krb5_pwd_data,ktest_equal_krb5_pwd_data);
}
! exit(error_count);
}
===================================================================
RCS file: /mit/krb5/.cvsroot/src/tests/asn.1/krb5_encode_test.c,v
retrieving revision 1.3
diff -c -r1.3 krb5_encode_test.c
*** 1.3 1994/10/04 19:35:43
--- krb5_encode_test.c 1994/10/18 13:39:53
***************
*** 15,20 ****
--- 15,22 ----
is probably no longer needed. */
/*#define ISODE_SUCKS*/
+ int error_count = 0;
+
void main()
{
krb5_data *code;
***************
*** 380,384 ****
encode_run(pd,krb5_pwd_data,"pwd_data","",encode_krb5_pwd_data);
}
! exit(0);
}
--- 382,386 ----
encode_run(pd,krb5_pwd_data,"pwd_data","",encode_krb5_pwd_data);
}
! exit(error_count);
}