Commit d50cb8ee authored by Martin Mrovec's avatar Martin Mrovec
Browse files

ENH: Connection test suite uses mock neuron.

parent 30617b57
......@@ -7,13 +7,13 @@
test_suite connection_m
! Global variables declaration
type(neuron_t), target :: n1
type(neuron_t), target :: n2
type(mock_neuron_t), target :: n1
type(mock_neuron_t), target :: n2
type(neuron_t), pointer :: n1_p
type(neuron_t), pointer :: n2_p
type(mock_neuron_t), pointer :: n1_p
type(mock_neuron_t), pointer :: n2_p
type(neuron_t), pointer :: dummy_p
type(mock_neuron_t), pointer :: dummy_p
type(connection_t), pointer :: con
......@@ -24,9 +24,9 @@ setup
write(*,*) '+------------------------+'
write(*,*) '| SETUP BEFORE UNIT TEST |'
write(*,*) '+------------------------+'
write(*,*) 'Creating instances of the class neuron_t...'
n1 = neuron_t(21.3)
n2 = neuron_t(13.7)
write(*,*) 'Creating instances of the class mock_neuron_t...'
n1 = mock_neuron_t()
n2 = mock_neuron_t()
write(*,*) 'Assigning instances to pointer...'
n1_p => n1
n2_p => n2
......@@ -74,10 +74,10 @@ test input_and_output_neurons
write(*,*) '+++ Test of input and output neurons ...'
! Input neuron
dummy_p => con%get_input_neuron()
assert_real_equal(dummy_p%get_state(),21.3d+0)
assert_real_equal(dummy_p%get_state(),15.0e+0)
! Output neuron
dummy_p => con%get_output_neuron()
assert_real_equal(dummy_p%get_state(),13.7d+0)
assert_real_equal(dummy_p%get_state(),15.0e+0)
write(*,*) '... finished +++'
end test
......@@ -88,7 +88,7 @@ test pass_signal
write(*,*) '+++ Test of passing a signal ...'
dummy_p => con%get_output_neuron()
call con%pass_signal()
assert_real_equal(dummy_p%get_state(), 111.825d+0)
assert_real_equal(dummy_p%get_potential(), 78.75e+0)
write(*,*) '... finished +++'
end test
......
......@@ -321,7 +321,7 @@ module neuron_m
real :: start_time
call time_profiling_start(start_time)
#endif
return_value = 5.0
return_value = this%potential
#ifdef TIME_PROFILING
call time_profiling_stop(start_time, 'mock_get_potential_impl')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment