/*
 *  test_getnodes.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::test_getnodes - sli script to test if GetGlobalNodes works as expected

   Synopsis: (test_getnodes) run

   Description:

   This test generates 10 iaf_neurons, 1 iaf_psc_alpha neuron and 10
   iaf_psc_delta_neurons. It then uses GetGlobalNodes to retrieve these
   different sets of neurons from the network.

   FirstVersion: January 2012
   Author: Marc-Oliver Gewaltig
 */

(unittest) run
/unittest using

/iaf_neuron 10 Create /n1 Set
/iaf_psc_alpha 10 Create /n2 Set
/iaf_psc_delta 10 Create /n3 Set

/set1 [n1 ] Range def
/set2 [n1 1 add n2 ] Range def
/set3 [n2 1 add n3 ] Range def

0 << /model /iaf_neuron >> GetGlobalNodes
set1 eq assert_or_die

0 << /model /iaf_psc_alpha >> GetGlobalNodes
set2 eq assert_or_die

0 << /model /iaf_psc_delta >> GetGlobalNodes
set3 eq assert_or_die

endusing
