/*
 *  ticket-933.sli
 *
 *  This file is part of NEST.
 *
 *  Copyright (C) 2004 The NEST Initiative
 *
 *  NEST is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  NEST is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with NEST.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

/* BeginDocumentation

Name: testsuite::ticket-933 Ensure that pp_pop_psc_delta generates same results when run in small intervals

Synopsis: (ticket-933) run -> NEST exits if test fails

Description:
This ticket ensures that pp_pop_psc_delta produces the same results when run 10 times 1ms as when
run 1 time 10ms.

Author: Hans Ekkehard Plesser, 2014-11-20
 */

(unittest) run
/unittest using

M_ERROR setverbosity

/build_network
{
  /poisson_generator << /rate 1000. >> Create
  /pp_pop_psc_delta Create dup /n Set
  Connect
  n
} 
def

{
  ResetKernel
  build_network /n Set
  10 Simulate
  n [[/V_m /n_events]] get 
  dup (Results 1 x 10ms: ) =only ==
  
  ResetKernel
  build_network /n Set
  10 { 1 Simulate } repeat
  n [[/V_m /n_events]] get
  dup (Results 10 x 1ms: ) =only ==

  eq
} assert_or_die

