summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/code/ads/ll/lltest.c
diff options
context:
space:
mode:
Diffstat (limited to 'comp/lucas-standen-NEA/code/ads/ll/lltest.c')
-rw-r--r--comp/lucas-standen-NEA/code/ads/ll/lltest.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code/ads/ll/lltest.c b/comp/lucas-standen-NEA/code/ads/ll/lltest.c
new file mode 100644
index 0000000..454acdf
--- /dev/null
+++ b/comp/lucas-standen-NEA/code/ads/ll/lltest.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+#include "ll.h"
+
+int main(){
+ ll_t *head = llalloc();
+ llsetdata(head, "hello");
+
+ for (int i = 0; i < 3; i++){
+ ll_t *node = llalloc();
+ llsetdata(node, "hi");
+ llsetnext(head, node);
+ }
+ for (int i = 0; i < 4; i++)
+ printf("%s\n", (char *)llgetat(head, i));
+ printf("%s\n", llgetendnode(head)->data);
+
+ llfreeall(head);
+}