Working with lists #107
KenBarclay
started this conversation in
General
Replies: 1 comment
-
My fault! I had misinterpreted _get as a list indexing operator. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Its really great to see a modern container library for C.
Thank you for your contribution.
I am new to STC (but not C). I have no experience of the STL,
so to find my way around STC I am running tests on the operations
supported by the containers that are of use to me.
The following test (from a suite of tests):
#include <stdio.h>
#include "ctest.h"
#define i_TYPE Ints, int // Container type (name, element type)
#define i_eq(a, b) (*a == *b)
#include "stc/list.h" // "instantiate" the desired container type
CTEST(vectest, insertAtOperation) {
Ints nums10 = c_init(Ints, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
} // isEmptyOperation
produces the error:
TEST 5/6 vectest:insertAtOperation nums10: 0 1 2 99 3 4 5 6 7 8 9[FAIL]
ERR: listtests.c:81 assertion failed, 3 == 99
on the third (and fourth) ASSERT_EQ.
Can you explain what I have misunderstood?
Thanks, Ken
Beta Was this translation helpful? Give feedback.
All reactions