37 #include "gtest/gtest.h" 40 #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && \ 41 !defined(__DragonFly__) 49 size_t slow_memmem_original(
void* start_buff,
size_t buflen,
void*
pat,
size_t patlen)
51 void*
buf = start_buff;
58 return (
char*)
buf - (
char*)start_buff;
64 #define slow_memmem slow_memmem_original 90 {4,
"abcd",4,
"abcd",0},
97 {7,
"aaaabab",2,
"ab",3},
98 {7,
"aaaabab",3,
"abc",0},
102 {3,
"a\0b",2,
"\0b",1},
103 {8,
"xxxxxxab",3,
"xyz",0},
104 {8,
"xxxxxxab",6,
"abcdef",0},
105 {9,
"\0xxxxxab",3,
"ab",6},
106 {4,
"\0\0a",3,
"\0a",1},
112 for (n=0;n<
sizeof(
T)/
sizeof(
T[0]);++n) {
126 if (
res!=
T[n].
res) printf(
"failed (got %zu, expected %zu)",
res,
T[n].
res);
else printf(
"ok");
Holds cryptonote related classes and helpers.
#define ASSERT_EQ(val1, val2)
size_t slow_memmem(const void *start_buff, size_t buflen, const void *pat, size_t patlen)
void * memcpy(void *a, const void *b, size_t c)