diff --git a/testsuite/unittests/test_spike_detector.sli b/testsuite/unittests/test_spike_detector.sli index 20f0784ae2..ffbaaa1c61 100644 --- a/testsuite/unittests/test_spike_detector.sli +++ b/testsuite/unittests/test_spike_detector.sli @@ -29,8 +29,12 @@ Description: - FirstVersion: Jan 2008 + First Version: Jan 2008 Author: Diesmann, Eppler + + Second Version: Aug 2016 + Description: added more tests + Author: Sepehr Mahmoudian */ (unittest) run @@ -74,9 +78,34 @@ true exch {and} Fold % all equal ? assert_or_die +% Test the setting of the /precision value absent precise models +% 1 Checking the default value and changing it + + ResetKernel + /spike_detector Create /sd Set + + % is the default correctly set to 3? + sd GetStatus /precision get dup /p_val Set 3 eq assert_or_die + + % is the precision still the same after simulating for some time? + 10 Simulate + sd GetStatus /precision get p_val eq assert_or_die + +% 2. Setting Precision + + ResetKernel + /spike_detector Create /sd Set + + % can the precision be correctly set? + sd << /precision 17 >> SetStatus + sd GetStatus /precision get 17 eq assert_or_die + + % Is the precision the same after simulating? + 10 Simulate + sd GetStatus /precision get 17 eq assert_or_die % Test the behavior of the /precise_times flag -% 1. if the user does not set it +% 3. if the user does not set it ResetKernel /spike_detector Create /sd Set @@ -85,7 +114,7 @@ assert_or_die sd GetStatus /precise_times get dup /pt_flag Set false eq assert_or_die % is the flag still the same after simulating for some time? - 100 Simulate + 10 Simulate sd GetStatus /precise_times get pt_flag eq assert_or_die % is the flag still the same after the creation of a precise neuron? @@ -93,23 +122,41 @@ assert_or_die sd GetStatus /precise_times get pt_flag eq assert_or_die % does the flag change to true if simulating with a precise neuron around? - 100 Simulate + 10 Simulate sd GetStatus /precise_times get true eq assert_or_die -% 2.a if the user sets the flag to false + % check if precision correctly increased to 15. + sd GetStatus /precision get 15 eq assert_or_die + +% 4.a if the user sets the flag to false ResetKernel /spike_detector Create /sd Set sd << /precise_times false >> SetStatus /iaf_psc_exp_ps Create ; - 100 Simulate + 10 Simulate sd GetStatus /precise_times get false eq assert_or_die -% 2.b if the user sets the flag to true +% 4.b if the user sets the flag to true ResetKernel /spike_detector Create /sd Set sd << /precise_times true >> SetStatus /iaf_psc_exp_ps Create ; - 100 Simulate + 10 Simulate sd GetStatus /precise_times get true eq assert_or_die + +% 5. Can precision be set correctly when precise models exist? + + ResetKernel + /spike_detector Create /sd Set + + % If user does not set precise_times, it will be set to true + /iaf_psc_exp_ps Create ; + sd << /precision 17 >> SetStatus + sd GetStatus /precision get 17 eq assert_or_die + + % does it remain the same after simulation? + 10 Simulate + sd GetStatus /precision get 17 eq assert_or_die +