tests/test_buffer.c

changeset 1007
81b2986d2b04
parent 1006
8ee818fa29f7
child 1023
989e144c912a
child 1024
8f99f6c28bd3
--- a/tests/test_buffer.c	Tue Dec 10 00:09:55 2024 +0100
+++ b/tests/test_buffer.c	Tue Dec 10 00:19:45 2024 +0100
@@ -263,7 +263,7 @@
     buf.size = 6;
     buf.pos = 3;
     CX_TEST_DO {
-        int result = cxBufferSeek(&buf, 6, SEEK_SET);
+        int result = cxBufferSeek(&buf, 7, SEEK_SET);
         CX_TEST_ASSERT(result != 0);
         CX_TEST_ASSERT(buf.pos == 3);
     }
@@ -315,7 +315,7 @@
     buf.size = 6;
     buf.pos = 3;
     CX_TEST_DO {
-        int result = cxBufferSeek(&buf, 3, SEEK_CUR);
+        int result = cxBufferSeek(&buf, 4, SEEK_CUR);
         CX_TEST_ASSERT(result != 0);
         CX_TEST_ASSERT(buf.pos == 3);
     }
@@ -342,9 +342,8 @@
     buf.pos = 3;
     CX_TEST_DO {
         int result = cxBufferSeek(&buf, 0, SEEK_END);
-        // the (past-the-)end position is always invalid
-        CX_TEST_ASSERT(result != 0);
-        CX_TEST_ASSERT(buf.pos == 3);
+        CX_TEST_ASSERT(result == 0);
+        CX_TEST_ASSERT(buf.pos == 6);
     }
     cxBufferDestroy(&buf);
 }

mercurial