From ef6d4ca473e9bac53acb5d3a5f438d08bf7a3306 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Wed, 11 Sep 2024 14:43:38 +0200 Subject: [PATCH] Move sections.c to cpp --- test/api/CMakeLists.txt | 2 +- test/api/sections.c | 51 ----------------------------------------- test/api/sections.cpp | 2 +- 3 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 test/api/sections.c diff --git a/test/api/CMakeLists.txt b/test/api/CMakeLists.txt index 2ebc7d9105..52ffa5be18 100644 --- a/test/api/CMakeLists.txt +++ b/test/api/CMakeLists.txt @@ -1,4 +1,4 @@ -foreach(api_test_file hh_sim.cpp netcon.cpp sections.c vclamp.cpp) +foreach(api_test_file hh_sim.cpp netcon.cpp sections.cpp vclamp.cpp) string(REPLACE "." "_" api_test_name "${api_test_file}") add_executable(${api_test_name} ${api_test_file}) cpp_cc_configure_sanitizers(TARGET ${api_test_name}) diff --git a/test/api/sections.c b/test/api/sections.c deleted file mode 100644 index 1571bbcc6c..0000000000 --- a/test/api/sections.c +++ /dev/null @@ -1,51 +0,0 @@ -/* NOTE: this assumes neuronapi.h is on your CPLUS_INCLUDE_PATH */ -#include "neuronapi.h" -#include -#include -#include -#include - -void modl_reg(){}; - -int main(void) { - static const char* argv[] = {"sections", "-nogui", "-nopython", NULL}; - nrn_init(3, argv); - - // topology - Section* soma = nrn_section_new("soma"); - Section* dend1 = nrn_section_new("dend1"); - Section* dend2 = nrn_section_new("dend2"); - Section* dend3 = nrn_section_new("dend3"); - Section* axon = nrn_section_new("axon"); - nrn_section_connect(dend1, 0, soma, 1); - nrn_section_connect(dend2, 0, dend1, 1); - nrn_section_connect(dend3, 0, dend1, 1); - nrn_section_connect(axon, 0, soma, 0); - nrn_nseg_set(axon, 5); - - // print out the morphology - nrn_function_call(nrn_symbol("topology"), 0); - - /* create a SectionList that is dend1 and its children */ - Object* seclist = nrn_object_new(nrn_symbol("SectionList"), 0); - nrn_section_push(dend1); - nrn_method_call(seclist, nrn_method_symbol(seclist, "subtree"), 0); - nrn_section_pop(); - - /* loop over allsec, print out */ - printf("allsec:\n"); - SectionListIterator* sli = nrn_sectionlist_iterator_new(nrn_allsec()); - while (!nrn_sectionlist_iterator_done(sli)) { - Section* sec = nrn_sectionlist_iterator_next(sli); - printf(" %s\n", nrn_secname(sec)); - } - nrn_sectionlist_iterator_free(sli); - - printf("\ndend1's subtree:\n"); - sli = nrn_sectionlist_iterator_new(nrn_sectionlist_data(seclist)); - while (!nrn_sectionlist_iterator_done(sli)) { - Section* sec = nrn_sectionlist_iterator_next(sli); - printf(" %s\n", nrn_secname(sec)); - } - nrn_sectionlist_iterator_free(sli); -} diff --git a/test/api/sections.cpp b/test/api/sections.cpp index 8ec14664ea..fbf1c4e3e8 100644 --- a/test/api/sections.cpp +++ b/test/api/sections.cpp @@ -5,7 +5,7 @@ #include #include -extern "C" void modl_reg(){/* No modl_reg */}; +extern "C" void modl_reg(){}; int main(void) { static const char* argv[] = {"sections", "-nogui", "-nopython", NULL};