add unit tests to bstr* functions

This commit is contained in:
leitner
2024-02-01 13:54:57 +00:00
parent e7d7f4e336
commit a6eddb5364
6 changed files with 104 additions and 3 deletions

View File

@@ -4,3 +4,13 @@
const char* bstrfirst(const char* a) {
if (*a) return a; else return a+5;
}
#ifdef UNITTEST
#include <assert.h>
int main() {
const char* s;
s="foo"; assert(bstrfirst(s) == s);
s="\x00\x03\x00\x00\x00""foo"; assert(bstrfirst(s) == s+5);
}
#endif