add unit tests for scan_ldap*

add return 0 to unit tests for scan_asn1*
This commit is contained in:
leitner
2023-09-16 09:19:19 +00:00
parent b75c256e32
commit 41df4dbaeb
22 changed files with 305 additions and 31 deletions

View File

@@ -3,3 +3,24 @@
size_t scan_ldapstring(const char* src,const char* max,struct string* s) {
return scan_asn1STRING(src,max,&s->s,&s->l);
}
#ifdef UNITTEST
#include <assert.h>
#undef UNITTEST
#include "scan_asn1STRING.c"
#include "scan_asn1tag.c"
#include "scan_asn1tagint.c"
#include "scan_asn1length.c"
#include "scan_asn1string.c"
/* scan_asn1string already has 100% coverage */
int main() {
static char buf[]="\x04\x05""fnord";
struct string s = { 0 };
assert(scan_ldapstring(buf,buf+7,&s)==7 && s.l==5 && s.s==buf+2);
// we only care for 100% coverage of this file, the others have their own unit tests */
return 0;
}
#endif