From 2176169257505d22021fc9a739c9f2090c514cb4 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 16 Oct 2025 17:47:13 +0300 Subject: check iteration on empty vectors --- tests/vec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/vec.c') diff --git a/tests/vec.c b/tests/vec.c index 1ed5f72..af36b5c 100644 --- a/tests/vec.c +++ b/tests/vec.c @@ -28,6 +28,10 @@ int main() #endif struct ints ints = ints_create(0); + foreach(ints, iter, &ints) { + assert(false && "iterating empty vec"); + } + for (int i = 0; i < 1000000; ++i) { if (!ints_append(&ints, i)) { fprintf(stderr, "failed appending %d to vec\n", i); -- cgit v1.2.3