16 static bool check(
bool cond,
const char* msg) {
18 cerr <<
"FAIL: " << msg << endl;
23 static bool eq(
double got,
double want,
const char* msg) {
25 cerr <<
"FAIL: " << msg <<
" — got " << got <<
", want " << want << endl;
32 static const char*
argv[] = {
"global_scalar",
"-nogui",
"-nopython",
nullptr};
41 ok &=
check(
p !=
nullptr,
"NOTUSER dataptr is non-null");
42 ok &=
eq(*
p, 42.0,
"NOTUSER dataptr dereferences to 42");
49 ok &=
eq(*ac, 3.5,
"HOC reads the value written through the NOTUSER dataptr");
55 ok &=
eq(*ac, 12.0,
"USERDOUBLE dataptr round-trips through HOC");
static bool check(bool cond, const char *msg)
static bool eq(double got, double want, const char *msg)
static void nrn_init(neuron::model_sorted_token const &, NrnThread *nt, Memb_list *ml, int type)
Symbol * nrn_symbol(char const *const name)
double * nrn_symbol_dataptr(const Symbol *sym)
int nrn_hoc_call(char const *const command)