summaryrefslogtreecommitdiffstats
path: root/test/eviction.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-10-04 14:54:52 +0200
committerLouis Burda <quent.burda@gmail.com>2022-10-04 14:54:52 +0200
commit8b1535789509812763de132f877b596d01861714 (patch)
tree5d2d91f5d5c5320f8e26e39f865ef3d8cd15497a /test/eviction.c
parent2305b5cbd8d75f8e01a1298f9490d2270d740d1d (diff)
downloadcachepc-8b1535789509812763de132f877b596d01861714.tar.gz
cachepc-8b1535789509812763de132f877b596d01861714.zip
Small test fixes
Diffstat (limited to 'test/eviction.c')
-rwxr-xr-xtest/eviction.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/eviction.c b/test/eviction.c
index 7cdb665..e68132b 100755
--- a/test/eviction.c
+++ b/test/eviction.c
@@ -18,15 +18,17 @@ main(int argc, const char **argv)
int fd, ret;
fd = open("/proc/cachepc", O_RDONLY);
+ if (fd < 0) err(1, "open");
arg = 48;
if (argc == 2) arg = atoi(argv[1]);
ret = ioctl(fd, CACHEPC_IOCTL_TEST_EVICTION, &arg);
- if (ret == -1) err(1, "ioctl fail");
+ if (ret == -1) err(1, "ioctl");
len = read(fd, counts, sizeof(counts));
- assert(len == sizeof(counts));
+ if (len != sizeof(counts))
+ errx(1, "invalid count read");
for (i = 0; i < 64; i++) {
if (i % 16 == 0 && i)