aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/slow_memmem.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-23 13:11:40 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-23 15:36:48 +0000
commit3002307418b9ea904a078f726ed8c13306d0f6b8 (patch)
treeab9839d84df786e66d2f5d310ac603622782f971 /tests/unit_tests/slow_memmem.cpp
parentMerge pull request #4781 (diff)
downloadmonero-3002307418b9ea904a078f726ed8c13306d0f6b8.tar.xz
tests: slow_memmem now returns size_t
Makes more sense than uint64_t for an offset, and agrees with the %zu used to print results. Found by codacy.com
Diffstat (limited to '')
-rw-r--r--tests/unit_tests/slow_memmem.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit_tests/slow_memmem.cpp b/tests/unit_tests/slow_memmem.cpp
index 1c67f5b58..436259bee 100644
--- a/tests/unit_tests/slow_memmem.cpp
+++ b/tests/unit_tests/slow_memmem.cpp
@@ -45,7 +45,7 @@
//#define VERBOSE
#ifdef TEST_ORIGINAL
-uint64_t slow_memmem_original(void* start_buff, size_t buflen,void* pat,size_t patlen)
+size_t slow_memmem_original(void* start_buff, size_t buflen,void* pat,size_t patlen)
{
void* buf = start_buff;
void* end=(char*)buf+buflen-patlen;
@@ -63,7 +63,7 @@ uint64_t slow_memmem_original(void* start_buff, size_t buflen,void* pat,size_t p
#define slow_memmem slow_memmem_original
#else
namespace cryptonote {
- uint64_t slow_memmem(const void* start_buff, size_t buflen,const void* pat,size_t patlen);
+ size_t slow_memmem(const void* start_buff, size_t buflen,const void* pat,size_t patlen);
}
using namespace cryptonote;
#endif
@@ -73,7 +73,7 @@ static const struct {
const char *buf;
size_t patlen;
const char *pat;
- uint64_t res;
+ size_t res;
} T[]={
{0,"",0,"",0},
{1,"",0,"",0},
@@ -117,7 +117,7 @@ TEST(slowmem,Success)
memcpy(buf,T[n].buf,T[n].buflen);
void *pat=malloc(T[n].patlen);
memcpy(pat,T[n].pat,T[n].patlen);
- uint64_t res=slow_memmem(buf,T[n].buflen,pat,T[n].patlen);
+ size_t res=slow_memmem(buf,T[n].buflen,pat,T[n].patlen);
free(pat);
free(buf);
ASSERT_EQ(res,T[n].res);