From b5ad184c1bcef78e7c2b052bcffc71f4c7381bcb Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Fri, 8 Dec 2023 09:21:32 -0700 Subject: hw8 checkpoint --- test/rand.t.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/rand.t.c (limited to 'test/rand.t.c') diff --git a/test/rand.t.c b/test/rand.t.c new file mode 100644 index 0000000..9ed2e9c --- /dev/null +++ b/test/rand.t.c @@ -0,0 +1,10 @@ +#include "lizfcm.test.h" + +UTEST(rand, rand_from) { + double min = -2.0; + double max = 5.0; + for (size_t i = 0; i < 1000; i++) { + double r = rand_from(min, max); + ASSERT_TRUE(min <= r && r <= max); + } +} -- cgit v1.2.3-70-g09d2