#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <stdarg.h>
#include <cmocka.h>
#include <amxc/amxc_lstack.h>
#include "test_amxc_lstack.h"
#include <amxc/amxc_macros.h>
Go to the source code of this file.
◆ amxc_lstack_init_clean_check()
void amxc_lstack_init_clean_check |
( |
UNUSED void ** |
state | ) |
|
Definition at line 85 of file test_amxc_lstack.c.
AMXC_INLINE void amxc_lstack_clean(amxc_lstack_t *const lstack, amxc_lstack_it_delete_t func)
Removes all items from the linked stack.
AMXC_INLINE int amxc_lstack_init(amxc_lstack_t *const lstack)
Initializes a linked stack.
The linked list structure.
◆ amxc_lstack_init_clean_null_check()
void amxc_lstack_init_clean_null_check |
( |
UNUSED void ** |
state | ) |
|
◆ amxc_lstack_new_delete_check()
void amxc_lstack_new_delete_check |
( |
UNUSED void ** |
state | ) |
|
Definition at line 72 of file test_amxc_lstack.c.
76 assert_ptr_equal(lstack, NULL);
AMXC_INLINE int amxc_lstack_new(amxc_lstack_t **lstack)
Allocates a linked stack.
AMXC_INLINE void amxc_lstack_delete(amxc_lstack_t **lstack, amxc_lstack_it_delete_t func)
Frees the previously allocated linked stack.
◆ amxc_lstack_new_delete_null_check()
void amxc_lstack_new_delete_null_check |
( |
UNUSED void ** |
state | ) |
|
◆ amxc_lstack_pop_check()
void amxc_lstack_pop_check |
( |
UNUSED void ** |
state | ) |
|
Definition at line 128 of file test_amxc_lstack.c.
144 assert_ptr_equal(
it3.
next, NULL);
145 assert_ptr_equal(
it3.
prev, NULL);
147 assert_ptr_equal(
it2.
next, NULL);
148 assert_ptr_equal(
it2.
prev, NULL);
150 assert_ptr_equal(
it1.
next, NULL);
151 assert_ptr_equal(
it1.
prev, NULL);
AMXC_INLINE int amxc_lstack_push(amxc_lstack_t *const lstack, amxc_lstack_it_t *const it)
Adds an item to the linked stack.
AMXC_INLINE amxc_lstack_it_t * amxc_lstack_pop(amxc_lstack_t *const lstack)
Removes the last added item from the stack.
AMXC_INLINE int amxc_lstack_it_init(amxc_lstack_it_t *const it)
Initializes a linked stack iterator.
The linked list iterator structure.
struct _amxc_llist_it * next
struct _amxc_llist_it * prev
static amxc_llist_it_t it3
static amxc_llist_it_t it2
static amxc_llist_it_t it1
◆ amxc_lstack_push_check()
void amxc_lstack_push_check |
( |
UNUSED void ** |
state | ) |
|
Definition at line 92 of file test_amxc_lstack.c.
104 assert_ptr_equal(
it1.
next, NULL);
105 assert_ptr_equal(
it1.
prev, NULL);
108 assert_ptr_equal(
it1.
prev, NULL);
109 assert_ptr_equal(
it2.
next, NULL);
113 assert_ptr_equal(
it1.
prev, NULL);
116 assert_ptr_equal(
it3.
next, NULL);
120 assert_ptr_equal(
it1.
next, NULL);
121 assert_ptr_equal(
it1.
prev, NULL);
122 assert_ptr_equal(
it2.
next, NULL);
123 assert_ptr_equal(
it2.
prev, NULL);
124 assert_ptr_equal(
it3.
next, NULL);
125 assert_ptr_equal(
it3.
prev, NULL);