File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ SUBROUTINE INITCB
2+ DOUBLE PRECISION LONG
3+ CHARACTER STRING
4+ INTEGER OK
5+
6+ COMMON / BLOCK/ LONG, STRING, OK
7+ LONG = 1.0
8+ STRING = ' 2'
9+ OK = 3
10+ RETURN
11+ END
Original file line number Diff line number Diff line change 1+ from __future__ import division , absolute_import , print_function
2+
3+ import os
4+
5+ from numpy .testing import run_module_suite , assert_array_equal , dec
6+ import numpy as np
7+ import util
8+
9+
10+ def _path (* a ):
11+ return os .path .join (* ((os .path .dirname (__file__ ),) + a ))
12+
13+ class TestCommonBlock (util .F2PyTest ):
14+ sources = [_path ('src' , 'common' , 'block.f' )]
15+
16+ def test_common_block (self ):
17+ self .module .initcb ()
18+ assert_array_equal (self .module .block .long_bn ,
19+ np .array (1.0 , dtype = np .float64 ))
20+ assert_array_equal (self .module .block .string_bn ,
21+ np .array ('2' , dtype = '|S1' ))
22+ assert_array_equal (self .module .block .ok ,
23+ np .array (3 , dtype = np .int32 ))
24+
25+ if __name__ == "__main__" :
26+ run_module_suite ()
You can’t perform that action at this time.
0 commit comments