1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

lcov exclusions

This commit is contained in:
Frank Denis 2019-05-06 11:13:31 +02:00
parent 3d379746ee
commit ed4e053fb0

View File

@ -181,7 +181,7 @@ _randombytes_getentropy(void * const buf, const size_t size)
{ {
assert(size <= 256U); assert(size <= 256U);
if (getentropy(buf, size) != 0) { if (getentropy(buf, size) != 0) {
return -1; return -1; /* LCOV_EXCL_LINE */
} }
return 0; return 0;
} }
@ -198,7 +198,7 @@ randombytes_getentropy(void * const buf_, size_t size)
assert(chunk_size > (size_t) 0U); assert(chunk_size > (size_t) 0U);
} }
if (_randombytes_getentropy(buf, chunk_size) != 0) { if (_randombytes_getentropy(buf, chunk_size) != 0) {
return -1; return -1; /* LCOV_EXCL_LINE */
} }
size -= chunk_size; size -= chunk_size;
buf += chunk_size; buf += chunk_size;
@ -273,10 +273,10 @@ randombytes_block_on_dev_random(void)
} }
# endif # endif
/* LCOV_EXCL_START */
static int static int
randombytes_internal_random_random_dev_open(void) randombytes_internal_random_random_dev_open(void)
{ {
/* LCOV_EXCL_START */
struct stat st; struct stat st;
static const char *devices[] = { static const char *devices[] = {
# ifndef USE_BLOCKING_RANDOM # ifndef USE_BLOCKING_RANDOM
@ -310,8 +310,8 @@ randombytes_internal_random_random_dev_open(void)
errno = EIO; errno = EIO;
return -1; return -1;
/* LCOV_EXCL_STOP */
} }
/* LCOV_EXCL_STOP */
static ssize_t static ssize_t
safe_read(const int fd, void * const buf_, size_t size) safe_read(const int fd, void * const buf_, size_t size)
@ -369,6 +369,7 @@ randombytes_internal_random_init(void)
} }
} }
# endif # endif
/* LCOV_EXCL_START */
# if !defined(NONEXISTENT_DEV_RANDOM) # if !defined(NONEXISTENT_DEV_RANDOM)
assert((global.getentropy_available | global.getrandom_available) == 0); assert((global.getentropy_available | global.getrandom_available) == 0);
if ((global.random_data_source_fd = if ((global.random_data_source_fd =
@ -378,6 +379,7 @@ randombytes_internal_random_init(void)
errno = errno_save; errno = errno_save;
return; return;
# endif # endif
/* LCOV_EXCL_STOP */
# ifndef HAVE_SAFE_ARC4RANDOM # ifndef HAVE_SAFE_ARC4RANDOM
sodium_misuse(); sodium_misuse();
# endif # endif