File tree Expand file tree Collapse file tree 5 files changed +49
-0
lines changed
Expand file tree Collapse file tree 5 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ target_sources(scratchcpp
1414 list .cpp
1515 list_p.cpp
1616 list_p.h
17+ list_functions.cpp
18+ list_functions.h
1719 block.cpp
1820 block_p.cpp
1921 block_p.h
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+
3+ #include < scratchcpp/list.h>
4+
5+ #include " list_functions.h"
6+
7+ using namespace libscratchcpp ;
8+
9+ extern " C"
10+ {
11+ void list_clear (List *list)
12+ {
13+ list->clear ();
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+
3+ #pragma once
4+
5+ namespace libscratchcpp
6+ {
7+
8+ class List ;
9+
10+ extern " C"
11+ {
12+ void list_clear (List *list);
13+ }
14+
15+ } // namespace libscratchcpp
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ gtest_discover_tests(blockprototype_test)
1616add_executable (
1717 list_test
1818 list_test.cpp
19+ list_functions_test.cpp
1920)
2021
2122target_link_libraries (
Original file line number Diff line number Diff line change 1+ #include < scratchcpp/list.h>
2+ #include < scratch/list_functions.h>
3+
4+ #include " ../common.h"
5+
6+ using namespace libscratchcpp ;
7+
8+ TEST (ListFunctionsTest, Clear)
9+ {
10+ List list (" " , " " );
11+ list.append (1 );
12+ list.append (2 );
13+ list.append (3 );
14+
15+ list_clear (&list);
16+ }
You can’t perform that action at this time.
0 commit comments