1 #define CATCH_CONFIG_RUNNER
3 #include <catch2/catch.hpp>
29 const char* argv_nompi[] = {
"NEURON",
"-nogui",
nullptr};
42 SCENARIO(
"Test fast_imem calculation",
"[Neuron][fast_imem]") {
46 WHEN(
"fast_imem and cachevec is allocated") {
50 THEN(
"nrn_fast_imem should not be nullptr") {
58 WHEN(
"fast_imem is created") {
61 "cvode = new CVode()\n"
62 "cvode.use_fast_imem(1)\n");
63 WHEN(
"iinitialize and run nrn_calc_fast_imem") {
64 hoc_oc(
"finitialize(-65)\n");
68 THEN(
"The current in this section is 0") {
70 for (
int i = 0;
i < nt->end; ++
i) {
71 REQUIRE(nt->_nrn_fast_imem->_nrn_sav_rhs[
i] == 0.0);
78 hoc_oc(
"delete_section()");
82 TEST_CASE(
"Test return code of execerror",
"[NEURON][execerror]") {
83 REQUIRE(
hoc_oc(
"execerror(\"test error\")") > 0);
88 #ifndef NRN_ASAN_ENABLED
89 TEST_CASE(
"Test nrn_mallinfo returns non-zero",
"[NEURON][nrn_mallinfo]") {
93 "if (nrn_mallinfo(0) <= 0) { execerror(\"nrn_mallinfo returned <= 0 in HOC\") }") ==
void nrn_calc_fast_imem(NrnThread *_nt)
size_t nrn_mallinfo(int item)
int hoc_oc(const char *buf)
void nrn_fast_imem_alloc()
Represent main neuron object computed by single thread.
_nrn_Fast_Imem * _nrn_fast_imem
TEST_CASE("Test return code of execerror", "[NEURON][execerror]")
int main(int argc, char *argv[])
void modl_reg()
Needed for compilation.
SCENARIO("Test fast_imem calculation", "[Neuron][fast_imem]")
void nrn_threads_create(int, int)
int ivocmain_session(int, const char **, const char **, int)
This used to be ivocmain, the main entrypoint to the HOC interpreter.