@@ -10,12 +10,25 @@ function testConnection(testCase)
1010 testCase .CONN_INFO .password ,' ' ,true ).isConnected);
1111 end
1212 function testConnectionExists(testCase )
13- % testConnectionExists tests that will not fail if connection open.
13+ % testConnectionExists tests that will not fail if connection open
14+ % to the same host.
1415 % Fix https://github.com/datajoint/datajoint-matlab/issues/160
1516 st = dbstack ;
1617 disp([' ---------------' st(1 ).name ' ---------------' ]);
1718 dj .conn(testCase .CONN_INFO .host , ' ' , ' ' , ' ' , ' ' , true )
1819 dj .conn(testCase .CONN_INFO .host , ' ' , ' ' , ' ' , ' ' , true )
1920 end
21+ function testConnectionDiffHost(testCase )
22+ % testConnectionDiffHost tests that will fail if connection open
23+ % to a different host.
24+ % Fix https://github.com/datajoint/datajoint-matlab/issues/160
25+ st = dbstack ;
26+ disp([' ---------------' st(1 ).name ' ---------------' ]);
27+ dj .conn(testCase .CONN_INFO .host , ' ' , ' ' , ' ' , ' ' , true )
28+
29+ testCase .verifyError(@() dj .conn(...
30+ ' anything' , ' ' , ' ' , ' ' , ' ' , true ), ...
31+ ' DataJoint:Connection:AlreadyInstantiated' );
32+ end
2033 end
2134end
0 commit comments