~nickpapior/siesta/tddft-work

« back to all changes in this revision

Viewing changes to Src/fdict/test/tst_dict_a1.F90

  • Committer: Rafi Ullah
  • Date: 2017-08-30 14:09:10 UTC
  • mfrom: (611.1.19 trunk)
  • Revision ID: rraffiu@gmail.com-20170830140910-bhu0osuh4d59wn8e
Merged with trunk-630

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
program tests
 
2
 
 
3
  use tst_utils
 
4
 
 
5
  implicit none
 
6
 
 
7
  character(len=1), target:: a(20), b(20)
 
8
  character(len=1), pointer :: d(:) => null()
 
9
  character(len=20) :: c
 
10
  type(dict) :: da
 
11
 
 
12
  a = ' '
 
13
  b = ' '
 
14
  c = 'Hello world3'
 
15
  a(1:12) = cpack('Hello world1')
 
16
  b(1:12) = cpack('Hello world2')
 
17
  da = ('Hello1'.kv.a) // ('Hello2'.kvp.b) // ('Hello3'.kv.c)
 
18
  call print(da)
 
19
 
 
20
  a = ' '
 
21
  call assign(a, da, 'Hello1')
 
22
  c = cunpack(a)
 
23
  if ( c /= 'Hello world1' ) stop 9
 
24
 
 
25
  b(1:12) = cpack('World hello2')
 
26
  call assign(a, da, 'Hello2')
 
27
  c = cunpack(a)
 
28
  if ( c /= 'World hello2' ) stop 10
 
29
 
 
30
  call associate(d, da, 'Hello3')
 
31
  d(1) = 'U'
 
32
  nullify(d)
 
33
  call associate(d, da, 'Hello3')
 
34
  c = cunpack(d)
 
35
  if ( c /= 'Uello world3' ) stop 11
 
36
 
 
37
  call nullify(da, 'Hello2')
 
38
  call delete(da)
 
39
 
 
40
  print *,'SUCCESS'
 
41
 
 
42
end program tests