Commit f6ccad98 authored by bes0030's avatar bes0030
Browse files

NEW: Added neuron_m memory leak test with storing into and reading from binary file.

parent 0b3f17c8
......@@ -354,6 +354,7 @@ module neuron_m
#endif
this%potential = 0
this%state = 0 !TODO maybe init with values from normal distribution
this%id = 1 !TODO modify - should be index in the whole set of neurons
#ifdef TIME_PROFILING
call time_profiling_stop(start_time, 'neuron_init_components_impl')
......@@ -386,7 +387,6 @@ module neuron_m
integer, intent(in) :: unit
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg
integer :: i !< Counter
#ifdef TIME_PROFILING
real :: start_time
call time_profiling_start(start_time)
......@@ -405,7 +405,6 @@ module neuron_m
integer, intent(in) :: unit
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg
integer :: i
#ifdef TIME_PROFILING
real :: start_time
call time_profiling_start(start_time)
......
program neuron_m_mem_leak_test
use neuron_m
implicit none
type(linear_neuron_t) :: ln
type(linear_neuron_t), allocatable :: ln2
ln = linear_neuron_t()
allocate(ln2)
open(123,file='neuron.test', form='unformatted')
write(123) ln
close(123)
open(123,file='neuron.test', form='unformatted')
read(123) ln2
close(123)
write(*,*) ln2%get_potential(), ln2%get_state(), ln2%get_id()
end program neuron_m_mem_leak_test
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