PageRenderTime 32ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/other_authors/netcdf/mexnc_common/tests/test_put_var_bad_param_datatype.m

http://m--pack.googlecode.com/
MATLAB | 2461 lines | 1310 code | 725 blank | 426 comment | 146 complexity | 0e2eb26013846ecf87c78b21b586a938 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. function test_put_var_bad_datatype ( ncfile )
  2. % TEST_PUT_VAR_BAD_DATATYPE:
  3. %
  4. % Test 1: PUT_VAR1_DOUBLE: non numeric ncid
  5. % Test 2: PUT_VAR1_FLOAT: non numeric ncid
  6. % Test 3: PUT_VAR1_INT: non numeric ncid
  7. % Test 4: PUT_VAR1_SHORT: non numeric ncid
  8. % Test 5: PUT_VAR1_SCHAR: non numeric ncid
  9. % Test 6: PUT_VAR1_UCHAR: non numeric ncid
  10. % Test 7: PUT_VAR1_TEXT: non numeric ncid
  11. % Test 8: PUT_VAR1_DOUBLE: non numeric varid
  12. % Test 9: PUT_VAR1_FLOAT: non numeric varid
  13. % Test 10: PUT_VAR1_INT: non numeric varid
  14. % Test 11: PUT_VAR1_SHORT: non numeric varid
  15. % Test 12: PUT_VAR1_SCHAR: non numeric varid
  16. % Test 13: PUT_VAR1_UCHAR: non numeric varid
  17. % Test 14: PUT_VAR1_TEXT: non numeric varid
  18. % Test 15: PUT_VAR1_DOUBLE: non numeric start index
  19. % Test 16: PUT_VAR1_FLOAT: non numeric start index
  20. % Test 17: PUT_VAR1_INT: non numeric start index
  21. % Test 18: PUT_VAR1_SHORT: non numeric start index
  22. % Test 19: PUT_VAR1_SCHAR: non numeric start index
  23. % Test 20: PUT_VAR1_UCHAR: non numeric start index
  24. % Test 21: PUT_VAR1_TEXT: non numeric start index
  25. % Test 22: PUT_VARA_DOUBLE: non numeric ncid
  26. % Test 23: PUT_VARA_FLOAT: non numeric ncid
  27. % Test 24: PUT_VARA_INT: non numeric ncid
  28. % Test 25: PUT_VARA_SHORT: non numeric ncid
  29. % Test 26: PUT_VARA_SCHAR: non numeric ncid
  30. % Test 27: PUT_VARA_UCHAR: non numeric ncid
  31. % Test 28: PUT_VARA_TEXT: non numeric ncid
  32. % Test 29: PUT_VARA_DOUBLE: non numeric varid
  33. % Test 30: PUT_VARA_FLOAT: non numeric varid
  34. % Test 31: PUT_VARA_INT: non numeric varid
  35. % Test 32: PUT_VARA_SHORT: non numeric varid
  36. % Test 33: PUT_VARA_SCHAR: non numeric varid
  37. % Test 34: PUT_VARA_UCHAR: non numeric varid
  38. % Test 35: PUT_VARA_TEXT: non numeric varid
  39. % Test 36: PUT_VARA_DOUBLE: non numeric start index
  40. % Test 37: PUT_VARA_FLOAT: non numeric start index
  41. % Test 38: PUT_VARA_INT: non numeric start index
  42. % Test 39: PUT_VARA_SHORT: non numeric start index
  43. % Test 40: PUT_VARA_SCHAR: non numeric start index
  44. % Test 41: PUT_VARA_UCHAR: non numeric start index
  45. % Test 42: PUT_VARA_TEXT: non numeric start index
  46. % Test 43: PUT_VARA_DOUBLE: non numeric count index
  47. % Test 44: PUT_VARA_FLOAT: non numeric count index
  48. % Test 45: PUT_VARA_INT: non numeric count index
  49. % Test 46: PUT_VARA_SHORT: non numeric count index
  50. % Test 47: PUT_VARA_SCHAR: non numeric count index
  51. % Test 48: PUT_VARA_UCHAR: non numeric count index
  52. % Test 49: PUT_VARA_TEXT: non numeric count index
  53. % Test 201: PUT_VARS_DOUBLE: non numeric ncid
  54. % Test 202: PUT_VARS_FLOAT: non numeric ncid
  55. % Test 203: PUT_VARS_INT: non numeric ncid
  56. % Test 204: PUT_VARS_SHORT: non numeric ncid
  57. % Test 205: PUT_VARS_SCHAR: non numeric ncid
  58. % Test 206: PUT_VARS_UCHAR: non numeric ncid
  59. % Test 207: PUT_VARS_TEXT: non numeric ncid
  60. % Test 208: PUT_VARS_DOUBLE: non numeric varid
  61. % Test 209: PUT_VARS_FLOAT: non numeric varid
  62. % Test 210: PUT_VARS_INT: non numeric varid
  63. % Test 211: PUT_VARS_SHORT: non numeric varid
  64. % Test 212: PUT_VARS_SCHAR: non numeric varid
  65. % Test 213: PUT_VARS_UCHAR: non numeric varid
  66. % Test 214: PUT_VARS_TEXT: non numeric varid
  67. % Test 215: PUT_VARS_DOUBLE: non numeric start index
  68. % Test 216: PUT_VARS_FLOAT: non numeric start index
  69. % Test 217: PUT_VARS_INT: non numeric start index
  70. % Test 218: PUT_VARS_SHORT: non numeric start index
  71. % Test 219: PUT_VARS_SCHAR: non numeric start index
  72. % Test 220: PUT_VARS_UCHAR: non numeric start index
  73. % Test 221: PUT_VARS_TEXT: non numeric start index
  74. % Test 222: PUT_VARS_DOUBLE: non numeric count index
  75. % Test 223: PUT_VARS_FLOAT: non numeric count index
  76. % Test 224: PUT_VARS_INT: non numeric count index
  77. % Test 225: PUT_VARS_SHORT: non numeric count index
  78. % Test 226: PUT_VARS_SCHAR: non numeric count index
  79. % Test 227: PUT_VARS_UCHAR: non numeric count index
  80. % Test 228: PUT_VARS_TEXT: non numeric count index
  81. % Test 229: PUT_VARS_DOUBLE: non numeric stride index
  82. % Test 230: PUT_VARS_FLOAT: non numeric stride index
  83. % Test 231: PUT_VARS_INT: non numeric stride index
  84. % Test 232: PUT_VARS_SHORT: non numeric stride index
  85. % Test 233: PUT_VARS_SCHAR: non numeric stride index
  86. % Test 234: PUT_VARS_UCHAR: non numeric stride index
  87. % Test 235: PUT_VARS_TEXT: non numeric stride index
  88. % Test 301: PUT_VARM_DOUBLE: non numeric ncid
  89. % Test 302: PUT_VARM_FLOAT: non numeric ncid
  90. % Test 303: PUT_VARM_INT: non numeric ncid
  91. % Test 304: PUT_VARM_SHORT: non numeric ncid
  92. % Test 305: PUT_VARM_SCHAR: non numeric ncid
  93. % Test 306: PUT_VARM_UCHAR: non numeric ncid
  94. % Test 307: PUT_VARM_TEXT: non numeric ncid
  95. % Test 308: PUT_VARM_DOUBLE: non numeric varid
  96. % Test 309: PUT_VARM_FLOAT: non numeric varid
  97. % Test 310: PUT_VARM_INT: non numeric varid
  98. % Test 311: PUT_VARM_SHORT: non numeric varid
  99. % Test 312: PUT_VARM_SCHAR: non numeric varid
  100. % Test 313: PUT_VARM_UCHAR: non numeric varid
  101. % Test 314: PUT_VARM_TEXT: non numeric varid
  102. % Test 315: PUT_VARM_DOUBLE: non numeric start index
  103. % Test 316: PUT_VARM_FLOAT: non numeric start index
  104. % Test 317: PUT_VARM_INT: non numeric start index
  105. % Test 318: PUT_VARM_SHORT: non numeric start index
  106. % Test 319: PUT_VARM_SCHAR: non numeric start index
  107. % Test 320: PUT_VARM_UCHAR: non numeric start index
  108. % Test 321: PUT_VARM_TEXT: non numeric start index
  109. % Test 322: PUT_VARM_DOUBLE: non numeric count index
  110. % Test 323: PUT_VARM_FLOAT: non numeric count index
  111. % Test 324: PUT_VARM_INT: non numeric count index
  112. % Test 325: PUT_VARM_SHORT: non numeric count index
  113. % Test 326: PUT_VARM_SCHAR: non numeric count index
  114. % Test 327: PUT_VARM_UCHAR: non numeric count index
  115. % Test 328: PUT_VARM_TEXT: non numeric count index
  116. % Test 329: PUT_VARM_DOUBLE: non numeric stride index
  117. % Test 330: PUT_VARM_FLOAT: non numeric stride index
  118. % Test 331: PUT_VARM_INT: non numeric stride index
  119. % Test 332: PUT_VARM_SHORT: non numeric stride index
  120. % Test 333: PUT_VARM_SCHAR: non numeric stride index
  121. % Test 334: PUT_VARM_UCHAR: non numeric stride index
  122. % Test 335: PUT_VARM_TEXT: non numeric stride index
  123. % Test 336: PUT_VARM_DOUBLE: non numeric imap index
  124. % Test 337: PUT_VARM_FLOAT: non numeric imap index
  125. % Test 338: PUT_VARM_INT: non numeric imap index
  126. % Test 339: PUT_VARM_SHORT: non numeric imap index
  127. % Test 340: PUT_VARM_SCHAR: non numeric imap index
  128. % Test 341: PUT_VARM_UCHAR: non numeric imap index
  129. % Test 342: PUT_VARM_TEXT: non numeric imap index
  130. % Test 401: PUT_VAR_DOUBLE: non numeric ncid
  131. % Test 402: PUT_VAR_FLOAT: non numeric ncid
  132. % Test 403: PUT_VAR_INT: non numeric ncid
  133. % Test 404: PUT_VAR_SHORT: non numeric ncid
  134. % Test 405: PUT_VAR_SCHAR: non numeric ncid
  135. % Test 406: PUT_VAR_UCHAR: non numeric ncid
  136. % Test 407: PUT_VAR_TEXT: non numeric ncid
  137. % Test 408: PUT_VAR_DOUBLE: non numeric varid
  138. % Test 409: PUT_VAR_FLOAT: non numeric varid
  139. % Test 410: PUT_VAR_INT: non numeric varid
  140. % Test 411: PUT_VAR_SHORT: non numeric varid
  141. % Test 412: PUT_VAR_SCHAR: non numeric varid
  142. % Test 413: PUT_VAR_UCHAR: non numeric varid
  143. % Test 414: PUT_VAR_TEXT: non numeric varid
  144. error_condition = 0;
  145. %
  146. % ok, first create this baby.
  147. [ncid, status] = mexnc ( 'create', ncfile, nc_clobber_mode );
  148. if ( status ~= 0 )
  149. ncerr_msg = mexnc ( 'strerror', status );
  150. msg = sprintf ( '%s: ''create'' failed on %s, error message '' %s ''\n', mfilename, ncfile, ncerr_msg );
  151. error ( msg );
  152. end
  153. %
  154. % Create the fixed dimension.
  155. len_x = 4;
  156. [xdimid, status] = mexnc ( 'def_dim', ncid, 'x', len_x );
  157. if ( status ~= 0 )
  158. ncerr_msg = mexnc ( 'strerror', status );
  159. msg = sprintf ( '%s: ''def_dim'' failed on dim x, file %s, error message '' %s ''\n', mfilename, ncfile, ncerr_msg );
  160. error ( msg );
  161. end
  162. len_y = 6;
  163. [ydimid, status] = mexnc ( 'def_dim', ncid, 'y', len_y );
  164. if ( status ~= 0 )
  165. ncerr_msg = mexnc ( 'strerror', status );
  166. msg = sprintf ( '%s: ''def_dim'' failed on dim y, file %s, error message '' %s ''\n', mfilename, ncfile, ncerr_msg );
  167. error ( msg );
  168. end
  169. [varid, status] = mexnc ( 'def_var', ncid, 'z_double', 'NC_DOUBLE', 2, [ydimid xdimid] );
  170. if ( status ~= 0 )
  171. ncerr_msg = mexnc ( 'strerror', status );
  172. msg = sprintf ( '%s: ''def_var'' failed on var x_short, file %s, error message '' %s ''\n', mfilename, ncfile, ncerr_msg );
  173. error ( msg );
  174. end
  175. [status] = mexnc ( 'enddef', ncid );
  176. if ( status ~= 0 )
  177. ncerr_msg = mexnc ( 'strerror', status );
  178. msg = sprintf ( '%s: ''enddef'' failed, file %s, error message '' %s ''\n', mfilename, ncfile, ncerr_msg );
  179. error ( msg );
  180. end
  181. input_data = [1:1:len_y*len_x];
  182. input_data = reshape ( input_data, len_y, len_x );
  183. status = mexnc ( 'put_var_double', ncid, varid, input_data' );
  184. if ( status ~= 0 )
  185. ncerr = mexnc ( 'strerror', status );
  186. err_msg = sprintf ( '%s: ''%s''\n', mfilename, ncerr );
  187. error ( err_msg );
  188. end
  189. %
  190. % Test 1: PUT_VAR1_DOUBLE: non numeric ncid
  191. testid = 'Test 1';
  192. try
  193. [status] = mexnc ( 'put_var1_double', 'ncid', varid, [0 0], input_data' );
  194. error_condition = 1;
  195. end
  196. if error_condition
  197. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  198. error ( err_msg );
  199. end
  200. %
  201. % Test 2: PUT_VAR1_FLOAT: non numeric ncid
  202. testid = 'Test 2';
  203. try
  204. [status] = mexnc ( 'put_var1_float', 'ncid', varid, [0 0], input_data' );
  205. error_condition = 1;
  206. end
  207. if error_condition
  208. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  209. error ( err_msg );
  210. end
  211. %
  212. % Test 3: PUT_VAR1_INT: non numeric ncid
  213. testid = 'Test 3';
  214. try
  215. [status] = mexnc ( 'put_var1_int', 'ncid', varid, [0 0], input_data' );
  216. error_condition = 1;
  217. end
  218. if error_condition
  219. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  220. error ( err_msg );
  221. end
  222. %
  223. % Test 4: PUT_VAR1_SHORT: non numeric ncid
  224. testid = 'Test 4';
  225. try
  226. [status] = mexnc ( 'put_var1_short', 'ncid', varid, [0 0], input_data' );
  227. error_condition = 1;
  228. end
  229. if error_condition
  230. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  231. error ( err_msg );
  232. end
  233. %
  234. % Test 5: PUT_VAR1_SCHAR: non numeric ncid
  235. testid = 'Test 5';
  236. try
  237. [status] = mexnc ( 'put_var1_schar', 'ncid', varid, [0 0], input_data' );
  238. error_condition = 1;
  239. end
  240. if error_condition
  241. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  242. error ( err_msg );
  243. end
  244. %
  245. % Test 6: PUT_VAR1_UCHAR: non numeric ncid
  246. testid = 'Test 6';
  247. try
  248. [status] = mexnc ( 'put_var1_uchar', 'ncid', varid, [0 0], input_data' );
  249. error_condition = 1;
  250. end
  251. if error_condition
  252. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  253. error ( err_msg );
  254. end
  255. %
  256. % Test 7: PUT_VAR1_TEXT: non numeric ncid
  257. testid = 'Test 7';
  258. try
  259. [status] = mexnc ( 'put_var1_text', 'ncid', varid, [0 0], input_data' );
  260. error_condition = 1;
  261. end
  262. if error_condition
  263. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  264. error ( err_msg );
  265. end
  266. %
  267. % Test 8: PUT_VAR1_DOUBLE: non numeric varid
  268. testid = 'Test 8';
  269. try
  270. [status] = mexnc ( 'put_var1_double', ncid, 'varid', [0 0], input_data' );
  271. error_condition = 1;
  272. end
  273. if error_condition
  274. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  275. error ( err_msg );
  276. end
  277. %
  278. % Test 9: PUT_VAR1_FLOAT: non numeric varid
  279. testid = 'Test 9';
  280. try
  281. [status] = mexnc ( 'put_var1_float', ncid, 'varid', [0 0], input_data' );
  282. error_condition = 1;
  283. end
  284. if error_condition
  285. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  286. error ( err_msg );
  287. end
  288. %
  289. % Test 10: PUT_VAR1_INT: non numeric varid
  290. testid = 'Test 10';
  291. try
  292. [status] = mexnc ( 'put_var1_int', ncid, 'varid', [0 0], input_data' );
  293. error_condition = 1;
  294. end
  295. if error_condition
  296. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  297. error ( err_msg );
  298. end
  299. %
  300. % Test 11: PUT_VAR1_SHORT: non numeric varid
  301. testid = 'Test 11';
  302. try
  303. [status] = mexnc ( 'put_var1_short', ncid, 'varid', [0 0], input_data' );
  304. error_condition = 1;
  305. end
  306. if error_condition
  307. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  308. error ( err_msg );
  309. end
  310. %
  311. % Test 12: PUT_VAR1_SCHAR: non numeric varid
  312. testid = 'Test 12';
  313. try
  314. [status] = mexnc ( 'put_var1_schar', ncid, 'varid', [0 0], input_data' );
  315. error_condition = 1;
  316. end
  317. if error_condition
  318. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  319. error ( err_msg );
  320. end
  321. %
  322. % Test 13: PUT_VAR1_UCHAR: non numeric varid
  323. testid = 'Test 13';
  324. try
  325. [status] = mexnc ( 'put_var1_uchar', ncid, 'varid', [0 0], input_data' );
  326. error_condition = 1;
  327. end
  328. if error_condition
  329. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  330. error ( err_msg );
  331. end
  332. %
  333. % Test 14: PUT_VAR1_TEXT: non numeric varid
  334. testid = 'Test 14';
  335. try
  336. [status] = mexnc ( 'put_var1_text', ncid, 'varid', [0 0], input_data' );
  337. error_condition = 1;
  338. end
  339. if error_condition
  340. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  341. error ( err_msg );
  342. end
  343. %
  344. % Test 15: PUT_VAR1_DOUBLE: non numeric start index
  345. testid = 'Test 15';
  346. try
  347. [status] = mexnc ( 'put_var1_double', ncid, varid, 'blah', input_data' );
  348. error_condition = 1;
  349. end
  350. if error_condition
  351. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  352. error ( err_msg );
  353. end
  354. %
  355. % Test 16: PUT_VAR1_FLOAT: non numeric start index
  356. testid = 'Test 16';
  357. try
  358. [status] = mexnc ( 'put_var1_float', ncid, varid, 'blah', input_data' );
  359. error_condition = 1;
  360. end
  361. if error_condition
  362. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  363. error ( err_msg );
  364. end
  365. %
  366. % Test 17: PUT_VAR1_INT: non numeric start index
  367. testid = 'Test 17';
  368. try
  369. [status] = mexnc ( 'put_var1_int', ncid, varid, 'blah', input_data' );
  370. error_condition = 1;
  371. end
  372. if error_condition
  373. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  374. error ( err_msg );
  375. end
  376. %
  377. % Test 18: PUT_VAR1_SHORT: non numeric start index
  378. testid = 'Test 18';
  379. try
  380. [status] = mexnc ( 'put_var1_short', ncid, varid, 'blah', input_data' );
  381. error_condition = 1;
  382. end
  383. if error_condition
  384. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  385. error ( err_msg );
  386. end
  387. %
  388. % Test 19: PUT_VAR1_SCHAR: non numeric start index
  389. testid = 'Test 19';
  390. try
  391. [status] = mexnc ( 'put_var1_schar', ncid, varid, 'blah', input_data' );
  392. error_condition = 1;
  393. end
  394. if error_condition
  395. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  396. error ( err_msg );
  397. end
  398. %
  399. % Test 20: PUT_VAR1_UCHAR: non numeric start index
  400. testid = 'Test 20';
  401. try
  402. [status] = mexnc ( 'put_var1_uchar', ncid, varid, 'blah', input_data' );
  403. error_condition = 1;
  404. end
  405. if error_condition
  406. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  407. error ( err_msg );
  408. end
  409. %
  410. % Test 21: PUT_VAR1_TEXT: non numeric start index
  411. testid = 'Test 21';
  412. try
  413. [status] = mexnc ( 'put_var1_text', ncid, varid, 'blah', input_data' );
  414. error_condition = 1;
  415. end
  416. if error_condition
  417. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  418. error ( err_msg );
  419. end
  420. %
  421. % Test 22: PUT_VARA_DOUBLE: non numeric ncid
  422. testid = 'Test 22';
  423. try
  424. [status] = mexnc ( 'put_vara_double', 'ncid', varid, [0 0], [4 5], input_data' );
  425. error_condition = 1;
  426. end
  427. if error_condition
  428. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  429. error ( err_msg );
  430. end
  431. %
  432. % Test 23: PUT_VARA_FLOAT: non numeric ncid
  433. testid = 'Test 23';
  434. try
  435. [status] = mexnc ( 'put_vara_float', 'ncid', varid, [0 0], [4 5], input_data' );
  436. error_condition = 1;
  437. end
  438. if error_condition
  439. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  440. error ( err_msg );
  441. end
  442. %
  443. % Test 24: PUT_VARA_INT: non numeric ncid
  444. testid = 'Test 24';
  445. try
  446. [status] = mexnc ( 'put_vara_int', 'ncid', varid, [0 0], [4 5], input_data' );
  447. error_condition = 1;
  448. end
  449. if error_condition
  450. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  451. error ( err_msg );
  452. end
  453. %
  454. % Test 25: PUT_VARA_SHORT: non numeric ncid
  455. testid = 'Test 25';
  456. try
  457. [status] = mexnc ( 'put_vara_short', 'ncid', varid, [0 0], [4 5], input_data' );
  458. error_condition = 1;
  459. end
  460. if error_condition
  461. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  462. error ( err_msg );
  463. end
  464. %
  465. % Test 26: PUT_VARA_SCHAR: non numeric ncid
  466. testid = 'Test 26';
  467. try
  468. [status] = mexnc ( 'put_vara_schar', 'ncid', varid, [0 0], [4 5], input_data' );
  469. error_condition = 1;
  470. end
  471. if error_condition
  472. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  473. error ( err_msg );
  474. end
  475. %
  476. % Test 27: PUT_VARA_UCHAR: non numeric ncid
  477. testid = 'Test 27';
  478. try
  479. [status] = mexnc ( 'put_vara_uchar', 'ncid', varid, [0 0], [4 5], input_data' );
  480. error_condition = 1;
  481. end
  482. if error_condition
  483. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  484. error ( err_msg );
  485. end
  486. %
  487. % Test 28: PUT_VARA_TEXT: non numeric ncid
  488. testid = 'Test 28';
  489. try
  490. [status] = mexnc ( 'put_vara_text', 'ncid', varid, [0 0], [4 5], input_data' );
  491. error_condition = 1;
  492. end
  493. if error_condition
  494. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  495. error ( err_msg );
  496. end
  497. %
  498. % Test 29: PUT_VARA_DOUBLE: non numeric varid
  499. testid = 'Test 29';
  500. try
  501. [status] = mexnc ( 'put_vara_double', ncid, 'varid', [0 0], [4 5], input_data' );
  502. error_condition = 1;
  503. end
  504. if error_condition
  505. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  506. error ( err_msg );
  507. end
  508. %
  509. % Test 30: PUT_VARA_FLOAT: non numeric varid
  510. testid = 'Test 30';
  511. try
  512. [status] = mexnc ( 'put_vara_float', ncid, 'varid', [0 0], [4 5], input_data' );
  513. error_condition = 1;
  514. end
  515. if error_condition
  516. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  517. error ( err_msg );
  518. end
  519. %
  520. % Test 31: PUT_VARA_INT: non numeric varid
  521. testid = 'Test 31';
  522. try
  523. [status] = mexnc ( 'put_vara_int', ncid, 'varid', [0 0], [4 5], input_data' );
  524. error_condition = 1;
  525. end
  526. if error_condition
  527. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  528. error ( err_msg );
  529. end
  530. %
  531. % Test 32: PUT_VARA_SHORT: non numeric varid
  532. testid = 'Test 32';
  533. try
  534. [status] = mexnc ( 'put_vara_short', ncid, 'varid', [0 0], [4 5], input_data' );
  535. error_condition = 1;
  536. end
  537. if error_condition
  538. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  539. error ( err_msg );
  540. end
  541. %
  542. % Test 33: PUT_VARA_SCHAR: non numeric varid
  543. testid = 'Test 33';
  544. try
  545. [status] = mexnc ( 'put_vara_schar', ncid, 'varid', [0 0], [4 5], input_data' );
  546. error_condition = 1;
  547. end
  548. if error_condition
  549. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  550. error ( err_msg );
  551. end
  552. %
  553. % Test 34: PUT_VARA_UCHAR: non numeric varid
  554. testid = 'Test 34';
  555. try
  556. [status] = mexnc ( 'put_vara_uchar', ncid, 'varid', [0 0], [4 5], input_data' );
  557. error_condition = 1;
  558. end
  559. if error_condition
  560. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  561. error ( err_msg );
  562. end
  563. %
  564. % Test 35: PUT_VARA_TEXT: non numeric varid
  565. testid = 'Test 35';
  566. try
  567. [status] = mexnc ( 'put_vara_text', ncid, 'varid', [0 0], [4 5], input_data' );
  568. error_condition = 1;
  569. end
  570. if error_condition
  571. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  572. error ( err_msg );
  573. end
  574. %
  575. % Test 36: PUT_VARA_DOUBLE: non numeric start index
  576. testid = 'Test 36';
  577. try
  578. [status] = mexnc ( 'put_vara_double', ncid, varid, 'blah', [4 5], input_data' );
  579. error_condition = 1;
  580. end
  581. if error_condition
  582. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  583. error ( err_msg );
  584. end
  585. %
  586. % Test 37: PUT_VARA_FLOAT: non numeric start index
  587. testid = 'Test 37';
  588. try
  589. [status] = mexnc ( 'put_vara_float', ncid, varid, 'blah', [4 5], input_data' );
  590. error_condition = 1;
  591. end
  592. if error_condition
  593. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  594. error ( err_msg );
  595. end
  596. %
  597. % Test 38: PUT_VARA_INT: non numeric start index
  598. testid = 'Test 38';
  599. try
  600. [status] = mexnc ( 'put_vara_int', ncid, varid, 'blah', [4 5], input_data' );
  601. error_condition = 1;
  602. end
  603. if error_condition
  604. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  605. error ( err_msg );
  606. end
  607. %
  608. % Test 39: PUT_VARA_SHORT: non numeric start index
  609. testid = 'Test 39';
  610. try
  611. [status] = mexnc ( 'put_vara_short', ncid, varid, 'blah', [4 5], input_data' );
  612. error_condition = 1;
  613. end
  614. if error_condition
  615. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  616. error ( err_msg );
  617. end
  618. %
  619. % Test 40: PUT_VARA_SCHAR: non numeric start index
  620. testid = 'Test 40';
  621. try
  622. [status] = mexnc ( 'put_vara_schar', ncid, varid, 'blah', [4 5], input_data' );
  623. error_condition = 1;
  624. end
  625. if error_condition
  626. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  627. error ( err_msg );
  628. end
  629. %
  630. % Test 41: PUT_VARA_UCHAR: non numeric start index
  631. testid = 'Test 41';
  632. try
  633. [status] = mexnc ( 'put_vara_uchar', ncid, varid, 'blah', [4 5], input_data' );
  634. error_condition = 1;
  635. end
  636. if error_condition
  637. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  638. error ( err_msg );
  639. end
  640. %
  641. % Test 42: PUT_VARA_TEXT: non numeric start index
  642. testid = 'Test 42';
  643. try
  644. [status] = mexnc ( 'put_vara_text', ncid, varid, 'blah', [4 5], input_data' );
  645. error_condition = 1;
  646. end
  647. if error_condition
  648. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  649. error ( err_msg );
  650. end
  651. %
  652. % Test 43: PUT_VARA_DOUBLE: non numeric count index
  653. testid = 'Test 43';
  654. try
  655. [status] = mexnc ( 'put_vara_double', ncid, varid, [0 0], 'blah', input_data' );
  656. error_condition = 1;
  657. end
  658. if error_condition
  659. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  660. error ( err_msg );
  661. end
  662. %
  663. % Test 44: PUT_VARA_FLOAT: non numeric count index
  664. testid = 'Test 44';
  665. try
  666. [status] = mexnc ( 'put_vara_float', ncid, varid, [0 0], 'blah', input_data' );
  667. error_condition = 1;
  668. end
  669. if error_condition
  670. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  671. error ( err_msg );
  672. end
  673. %
  674. % Test 45: PUT_VARA_INT: non numeric count index
  675. testid = 'Test 45';
  676. try
  677. [status] = mexnc ( 'put_vara_int', ncid, varid, [0 0], 'blah', input_data' );
  678. error_condition = 1;
  679. end
  680. if error_condition
  681. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  682. error ( err_msg );
  683. end
  684. %
  685. % Test 46: PUT_VARA_SHORT: non numeric count index
  686. testid = 'Test 46';
  687. try
  688. [status] = mexnc ( 'put_vara_short', ncid, varid, [0 0], 'blah', input_data' );
  689. error_condition = 1;
  690. end
  691. if error_condition
  692. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  693. error ( err_msg );
  694. end
  695. %
  696. % Test 47: PUT_VARA_SCHAR: non numeric count index
  697. testid = 'Test 47';
  698. try
  699. [status] = mexnc ( 'put_vara_schar', ncid, varid, [0 0], 'blah', input_data' );
  700. error_condition = 1;
  701. end
  702. if error_condition
  703. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  704. error ( err_msg );
  705. end
  706. %
  707. % Test 48: PUT_VARA_UCHAR: non numeric count index
  708. testid = 'Test 48';
  709. try
  710. [status] = mexnc ( 'put_vara_uchar', ncid, varid, [0 0], 'blah', input_data' );
  711. error_condition = 1;
  712. end
  713. if error_condition
  714. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  715. error ( err_msg );
  716. end
  717. %
  718. % Test 49: PUT_VARA_TEXT: non numeric count index
  719. testid = 'Test 49';
  720. try
  721. [status] = mexnc ( 'put_vara_text', ncid, varid, [0 0], 'blah', input_data' );
  722. error_condition = 1;
  723. end
  724. if error_condition
  725. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  726. error ( err_msg );
  727. end
  728. %
  729. % Test 201: PUT_VARS_DOUBLE: non numeric ncid
  730. testid = 'Test 201';
  731. try
  732. [status] = mexnc ( 'put_vars_double', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  733. error_condition = 1;
  734. end
  735. if error_condition
  736. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  737. error ( err_msg );
  738. end
  739. %
  740. % Test 202: PUT_VARS_FLOAT: non numeric ncid
  741. testid = 'Test 202';
  742. try
  743. [status] = mexnc ( 'put_vars_float', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  744. error_condition = 1;
  745. end
  746. if error_condition
  747. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  748. error ( err_msg );
  749. end
  750. %
  751. % Test 203: PUT_VARS_INT: non numeric ncid
  752. testid = 'Test 203';
  753. try
  754. [status] = mexnc ( 'put_vars_int', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  755. error_condition = 1;
  756. end
  757. if error_condition
  758. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  759. error ( err_msg );
  760. end
  761. %
  762. % Test 204: PUT_VARS_SHORT: non numeric ncid
  763. testid = 'Test 204';
  764. try
  765. [status] = mexnc ( 'put_vars_short', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  766. error_condition = 1;
  767. end
  768. if error_condition
  769. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  770. error ( err_msg );
  771. end
  772. %
  773. % Test 205: PUT_VARS_SCHAR: non numeric ncid
  774. testid = 'Test 205';
  775. try
  776. [status] = mexnc ( 'put_vars_schar', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  777. error_condition = 1;
  778. end
  779. if error_condition
  780. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  781. error ( err_msg );
  782. end
  783. %
  784. % Test 206: PUT_VARS_UCHAR: non numeric ncid
  785. testid = 'Test 206';
  786. try
  787. [status] = mexnc ( 'put_vars_uchar', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  788. error_condition = 1;
  789. end
  790. if error_condition
  791. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  792. error ( err_msg );
  793. end
  794. %
  795. % Test 207: PUT_VARS_TEXT: non numeric ncid
  796. testid = 'Test 207';
  797. try
  798. [status] = mexnc ( 'put_vars_text', 'ncid', varid, [0 0], [4 5], [2 2], input_data' );
  799. error_condition = 1;
  800. end
  801. if error_condition
  802. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  803. error ( err_msg );
  804. end
  805. %
  806. % Test 208: PUT_VARS_DOUBLE: non numeric varid
  807. testid = 'Test 208';
  808. try
  809. [status] = mexnc ( 'put_vars_double', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  810. error_condition = 1;
  811. end
  812. if error_condition
  813. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  814. error ( err_msg );
  815. end
  816. %
  817. % Test 209: PUT_VARS_FLOAT: non numeric varid
  818. testid = 'Test 209';
  819. try
  820. [status] = mexnc ( 'put_vars_float', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  821. error_condition = 1;
  822. end
  823. if error_condition
  824. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  825. error ( err_msg );
  826. end
  827. %
  828. % Test 210: PUT_VARS_INT: non numeric varid
  829. testid = 'Test 210';
  830. try
  831. [status] = mexnc ( 'put_vars_int', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  832. error_condition = 1;
  833. end
  834. if error_condition
  835. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  836. error ( err_msg );
  837. end
  838. %
  839. % Test 211: PUT_VARS_SHORT: non numeric varid
  840. testid = 'Test 211';
  841. try
  842. [status] = mexnc ( 'put_vars_short', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  843. error_condition = 1;
  844. end
  845. if error_condition
  846. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  847. error ( err_msg );
  848. end
  849. %
  850. % Test 212: PUT_VARS_SCHAR: non numeric varid
  851. testid = 'Test 212';
  852. try
  853. [status] = mexnc ( 'put_vars_schar', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  854. error_condition = 1;
  855. end
  856. if error_condition
  857. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  858. error ( err_msg );
  859. end
  860. %
  861. % Test 213: PUT_VARS_UCHAR: non numeric varid
  862. testid = 'Test 213';
  863. try
  864. [status] = mexnc ( 'put_vars_uchar', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  865. error_condition = 1;
  866. end
  867. if error_condition
  868. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  869. error ( err_msg );
  870. end
  871. %
  872. % Test 214: PUT_VARS_TEXT: non numeric varid
  873. testid = 'Test 214';
  874. try
  875. [status] = mexnc ( 'put_vars_text', ncid, 'varid', [0 0], [4 5], [2 2], input_data' );
  876. error_condition = 1;
  877. end
  878. if error_condition
  879. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  880. error ( err_msg );
  881. end
  882. %
  883. % Test 215: PUT_VARS_DOUBLE: non numeric start index
  884. testid = 'Test 215';
  885. try
  886. [status] = mexnc ( 'put_vars_double', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  887. error_condition = 1;
  888. end
  889. if error_condition
  890. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  891. error ( err_msg );
  892. end
  893. %
  894. % Test 216: PUT_VARS_FLOAT: non numeric start index
  895. testid = 'Test 216';
  896. try
  897. [status] = mexnc ( 'put_vars_float', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  898. error_condition = 1;
  899. end
  900. if error_condition
  901. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  902. error ( err_msg );
  903. end
  904. %
  905. % Test 217: PUT_VARS_INT: non numeric start index
  906. testid = 'Test 217';
  907. try
  908. [status] = mexnc ( 'put_vars_int', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  909. error_condition = 1;
  910. end
  911. if error_condition
  912. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  913. error ( err_msg );
  914. end
  915. %
  916. % Test 218: PUT_VARS_SHORT: non numeric start index
  917. testid = 'Test 218';
  918. try
  919. [status] = mexnc ( 'put_vars_short', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  920. error_condition = 1;
  921. end
  922. if error_condition
  923. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  924. error ( err_msg );
  925. end
  926. %
  927. % Test 219: PUT_VARS_SCHAR: non numeric start index
  928. testid = 'Test 219';
  929. try
  930. [status] = mexnc ( 'put_vars_schar', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  931. error_condition = 1;
  932. end
  933. if error_condition
  934. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  935. error ( err_msg );
  936. end
  937. %
  938. % Test 220: PUT_VARS_UCHAR: non numeric start index
  939. testid = 'Test 220';
  940. try
  941. [status] = mexnc ( 'put_vars_uchar', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  942. error_condition = 1;
  943. end
  944. if error_condition
  945. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  946. error ( err_msg );
  947. end
  948. %
  949. % Test 221: PUT_VARS_TEXT: non numeric start index
  950. testid = 'Test 221';
  951. try
  952. [status] = mexnc ( 'put_vars_text', ncid, varid, 'blah', [4 5], [2 2], input_data' );
  953. error_condition = 1;
  954. end
  955. if error_condition
  956. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  957. error ( err_msg );
  958. end
  959. %
  960. % Test 222: PUT_VARS_DOUBLE: non numeric count index
  961. testid = 'Test 222';
  962. try
  963. [status] = mexnc ( 'put_vars_double', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  964. error_condition = 1;
  965. end
  966. if error_condition
  967. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  968. error ( err_msg );
  969. end
  970. %
  971. % Test 223: PUT_VARS_FLOAT: non numeric count index
  972. testid = 'Test 223';
  973. try
  974. [status] = mexnc ( 'put_vars_float', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  975. error_condition = 1;
  976. end
  977. if error_condition
  978. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  979. error ( err_msg );
  980. end
  981. %
  982. % Test 224: PUT_VARS_INT: non numeric count index
  983. testid = 'Test 224';
  984. try
  985. [status] = mexnc ( 'put_vars_int', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  986. error_condition = 1;
  987. end
  988. if error_condition
  989. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  990. error ( err_msg );
  991. end
  992. %
  993. % Test 225: PUT_VARS_SHORT: non numeric count index
  994. testid = 'Test 225';
  995. try
  996. [status] = mexnc ( 'put_vars_short', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  997. error_condition = 1;
  998. end
  999. if error_condition
  1000. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1001. error ( err_msg );
  1002. end
  1003. %
  1004. % Test 226: PUT_VARS_SCHAR: non numeric count index
  1005. testid = 'Test 226';
  1006. try
  1007. [status] = mexnc ( 'put_vars_schar', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  1008. error_condition = 1;
  1009. end
  1010. if error_condition
  1011. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1012. error ( err_msg );
  1013. end
  1014. %
  1015. % Test 227: PUT_VARS_UCHAR: non numeric count index
  1016. testid = 'Test 227';
  1017. try
  1018. [status] = mexnc ( 'put_vars_uchar', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  1019. error_condition = 1;
  1020. end
  1021. if error_condition
  1022. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1023. error ( err_msg );
  1024. end
  1025. %
  1026. % Test 228: PUT_VARS_TEXT: non numeric count index
  1027. testid = 'Test 228';
  1028. try
  1029. [status] = mexnc ( 'put_vars_text', ncid, varid, [0 0], 'blah', [2 2], input_data' );
  1030. error_condition = 1;
  1031. end
  1032. if error_condition
  1033. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1034. error ( err_msg );
  1035. end
  1036. %
  1037. % Test 229: PUT_VARS_DOUBLE: non numeric stride argument
  1038. testid = 'Test 229';
  1039. try
  1040. [status] = mexnc ( 'put_vars_double', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1041. error_condition = 1;
  1042. end
  1043. if error_condition
  1044. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1045. error ( err_msg );
  1046. end
  1047. %
  1048. % Test 230: PUT_VARS_FLOAT: non numeric stride argument
  1049. testid = 'Test 230';
  1050. try
  1051. [status] = mexnc ( 'put_vars_float', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1052. error_condition = 1;
  1053. end
  1054. if error_condition
  1055. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1056. error ( err_msg );
  1057. end
  1058. %
  1059. % Test 231: PUT_VARS_INT: non numeric stride argument
  1060. testid = 'Test 231';
  1061. try
  1062. [status] = mexnc ( 'put_vars_int', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1063. error_condition = 1;
  1064. end
  1065. if error_condition
  1066. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1067. error ( err_msg );
  1068. end
  1069. %
  1070. % Test 232: PUT_VARS_SHORT: non numeric stride argument
  1071. testid = 'Test 232';
  1072. try
  1073. [status] = mexnc ( 'put_vars_short', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1074. error_condition = 1;
  1075. end
  1076. if error_condition
  1077. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1078. error ( err_msg );
  1079. end
  1080. %
  1081. % Test 233: PUT_VARS_SCHAR: non numeric stride argument
  1082. testid = 'Test 233';
  1083. try
  1084. [status] = mexnc ( 'put_vars_schar', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1085. error_condition = 1;
  1086. end
  1087. if error_condition
  1088. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1089. error ( err_msg );
  1090. end
  1091. %
  1092. % Test 234: PUT_VARS_UCHAR: non numeric stride argument
  1093. testid = 'Test 234';
  1094. try
  1095. [status] = mexnc ( 'put_vars_uchar', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1096. error_condition = 1;
  1097. end
  1098. if error_condition
  1099. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1100. error ( err_msg );
  1101. end
  1102. %
  1103. % Test 235: PUT_VARS_TEXT: non numeric stride argument
  1104. testid = 'Test 235';
  1105. try
  1106. [status] = mexnc ( 'put_vars_text', ncid, varid, [0 0], [2 3], 'blah', input_data' );
  1107. error_condition = 1;
  1108. end
  1109. if error_condition
  1110. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1111. error ( err_msg );
  1112. end
  1113. %
  1114. % Test 301: PUT_VARM_DOUBLE: non numeric ncid
  1115. testid = 'Test 301';
  1116. try
  1117. [status] = mexnc ( 'put_varm_double', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1118. error_condition = 1;
  1119. end
  1120. if error_condition
  1121. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1122. error ( err_msg );
  1123. end
  1124. %
  1125. % Test 302: PUT_VARM_FLOAT: non numeric ncid
  1126. testid = 'Test 302';
  1127. try
  1128. [status] = mexnc ( 'put_varm_float', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1129. error_condition = 1;
  1130. end
  1131. if error_condition
  1132. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1133. error ( err_msg );
  1134. end
  1135. %
  1136. % Test 303: PUT_VARM_INT: non numeric ncid
  1137. testid = 'Test 303';
  1138. try
  1139. [status] = mexnc ( 'put_varm_int', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1140. error_condition = 1;
  1141. end
  1142. if error_condition
  1143. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1144. error ( err_msg );
  1145. end
  1146. %
  1147. % Test 304: PUT_VARM_SHORT: non numeric ncid
  1148. testid = 'Test 304';
  1149. try
  1150. [status] = mexnc ( 'put_varm_short', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1151. error_condition = 1;
  1152. end
  1153. if error_condition
  1154. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1155. error ( err_msg );
  1156. end
  1157. %
  1158. % Test 305: PUT_VARM_SCHAR: non numeric ncid
  1159. testid = 'Test 305';
  1160. try
  1161. [status] = mexnc ( 'put_varm_schar', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1162. error_condition = 1;
  1163. end
  1164. if error_condition
  1165. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1166. error ( err_msg );
  1167. end
  1168. %
  1169. % Test 306: PUT_VARM_UCHAR: non numeric ncid
  1170. testid = 'Test 306';
  1171. try
  1172. [status] = mexnc ( 'put_varm_uchar', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1173. error_condition = 1;
  1174. end
  1175. if error_condition
  1176. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1177. error ( err_msg );
  1178. end
  1179. %
  1180. % Test 307: PUT_VARM_TEXT: non numeric ncid
  1181. testid = 'Test 307';
  1182. try
  1183. [status] = mexnc ( 'put_varm_text', 'ncid', varid, [0 0], [6 4], [1 1], [1 6], input_data' );
  1184. error_condition = 1;
  1185. end
  1186. if error_condition
  1187. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1188. error ( err_msg );
  1189. end
  1190. %
  1191. % Test 308: PUT_VARM_DOUBLE: non numeric varid
  1192. testid = 'Test 308';
  1193. try
  1194. [status] = mexnc ( 'put_varm_double', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1195. error_condition = 1;
  1196. end
  1197. if error_condition
  1198. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1199. error ( err_msg );
  1200. end
  1201. %
  1202. % Test 309: PUT_VARM_FLOAT: non numeric varid
  1203. testid = 'Test 309';
  1204. try
  1205. [status] = mexnc ( 'put_varm_float', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1206. error_condition = 1;
  1207. end
  1208. if error_condition
  1209. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1210. error ( err_msg );
  1211. end
  1212. %
  1213. % Test 310: PUT_VARM_INT: non numeric varid
  1214. testid = 'Test 310';
  1215. try
  1216. [status] = mexnc ( 'put_varm_int', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1217. error_condition = 1;
  1218. end
  1219. if error_condition
  1220. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1221. error ( err_msg );
  1222. end
  1223. %
  1224. % Test 311: PUT_VARM_SHORT: non numeric varid
  1225. testid = 'Test 311';
  1226. try
  1227. [status] = mexnc ( 'put_varm_short', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1228. error_condition = 1;
  1229. end
  1230. if error_condition
  1231. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1232. error ( err_msg );
  1233. end
  1234. %
  1235. % Test 312: PUT_VARM_SCHAR: non numeric varid
  1236. testid = 'Test 312';
  1237. try
  1238. [status] = mexnc ( 'put_varm_schar', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1239. error_condition = 1;
  1240. end
  1241. if error_condition
  1242. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1243. error ( err_msg );
  1244. end
  1245. %
  1246. % Test 313: PUT_VARM_UCHAR: non numeric varid
  1247. testid = 'Test 313';
  1248. try
  1249. [status] = mexnc ( 'put_varm_uchar', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1250. error_condition = 1;
  1251. end
  1252. if error_condition
  1253. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1254. error ( err_msg );
  1255. end
  1256. %
  1257. % Test 314: PUT_VARM_TEXT: non numeric varid
  1258. testid = 'Test 314';
  1259. try
  1260. [status] = mexnc ( 'put_varm_text', ncid, 'varid', [0 0], [6 4], [1 1], [1 6], input_data' );
  1261. error_condition = 1;
  1262. end
  1263. if error_condition
  1264. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1265. error ( err_msg );
  1266. end
  1267. %
  1268. % Test 315: PUT_VARM_DOUBLE: non numeric start index
  1269. testid = 'Test 315';
  1270. try
  1271. [status] = mexnc ( 'put_varm_double', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1272. error_condition = 1;
  1273. end
  1274. if error_condition
  1275. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1276. error ( err_msg );
  1277. end
  1278. %
  1279. % Test 316: PUT_VARM_FLOAT: non numeric start index
  1280. testid = 'Test 316';
  1281. try
  1282. [status] = mexnc ( 'put_varm_float', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1283. error_condition = 1;
  1284. end
  1285. if error_condition
  1286. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1287. error ( err_msg );
  1288. end
  1289. %
  1290. % Test 317: PUT_VARM_INT: non numeric start index
  1291. testid = 'Test 317';
  1292. try
  1293. [status] = mexnc ( 'put_varm_int', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1294. error_condition = 1;
  1295. end
  1296. if error_condition
  1297. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1298. error ( err_msg );
  1299. end
  1300. %
  1301. % Test 318: PUT_VARM_SHORT: non numeric start index
  1302. testid = 'Test 318';
  1303. try
  1304. [status] = mexnc ( 'put_varm_short', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1305. error_condition = 1;
  1306. end
  1307. if error_condition
  1308. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1309. error ( err_msg );
  1310. end
  1311. %
  1312. % Test 319: PUT_VARM_SCHAR: non numeric start index
  1313. testid = 'Test 319';
  1314. try
  1315. [status] = mexnc ( 'put_varm_schar', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1316. error_condition = 1;
  1317. end
  1318. if error_condition
  1319. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1320. error ( err_msg );
  1321. end
  1322. %
  1323. % Test 320: PUT_VARM_UCHAR: non numeric start index
  1324. testid = 'Test 320';
  1325. try
  1326. [status] = mexnc ( 'put_varm_uchar', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1327. error_condition = 1;
  1328. end
  1329. if error_condition
  1330. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1331. error ( err_msg );
  1332. end
  1333. %
  1334. % Test 321: PUT_VARM_TEXT: non numeric start index
  1335. testid = 'Test 321';
  1336. try
  1337. [status] = mexnc ( 'put_varm_text', ncid, varid, 'blah', [6 4], [1 1], [1 6], input_data' );
  1338. error_condition = 1;
  1339. end
  1340. if error_condition
  1341. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1342. error ( err_msg );
  1343. end
  1344. %
  1345. % Test 322: PUT_VARM_DOUBLE: non numeric count index
  1346. testid = 'Test 322';
  1347. try
  1348. [status] = mexnc ( 'put_varm_double', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1349. error_condition = 1;
  1350. end
  1351. if error_condition
  1352. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1353. error ( err_msg );
  1354. end
  1355. %
  1356. % Test 323: PUT_VARM_FLOAT: non numeric count index
  1357. testid = 'Test 323';
  1358. try
  1359. [status] = mexnc ( 'put_varm_float', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1360. error_condition = 1;
  1361. end
  1362. if error_condition
  1363. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1364. error ( err_msg );
  1365. end
  1366. %
  1367. % Test 324: PUT_VARM_INT: non numeric count index
  1368. testid = 'Test 324';
  1369. try
  1370. [status] = mexnc ( 'put_varm_int', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1371. error_condition = 1;
  1372. end
  1373. if error_condition
  1374. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1375. error ( err_msg );
  1376. end
  1377. %
  1378. % Test 325: PUT_VARM_SHORT: non numeric count index
  1379. testid = 'Test 325';
  1380. try
  1381. [status] = mexnc ( 'put_varm_short', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1382. error_condition = 1;
  1383. end
  1384. if error_condition
  1385. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1386. error ( err_msg );
  1387. end
  1388. %
  1389. % Test 326: PUT_VARM_SCHAR: non numeric count index
  1390. testid = 'Test 326';
  1391. try
  1392. [status] = mexnc ( 'put_varm_schar', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1393. error_condition = 1;
  1394. end
  1395. if error_condition
  1396. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1397. error ( err_msg );
  1398. end
  1399. %
  1400. % Test 327: PUT_VARM_UCHAR: non numeric count index
  1401. testid = 'Test 327';
  1402. try
  1403. [status] = mexnc ( 'put_varm_uchar', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1404. error_condition = 1;
  1405. end
  1406. if error_condition
  1407. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1408. error ( err_msg );
  1409. end
  1410. %
  1411. % Test 328: PUT_VARM_TEXT: non numeric count index
  1412. testid = 'Test 328';
  1413. try
  1414. [status] = mexnc ( 'put_varm_text', ncid, varid, [0 0], 'blah', [1 1], [1 6], input_data' );
  1415. error_condition = 1;
  1416. end
  1417. if error_condition
  1418. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1419. error ( err_msg );
  1420. end
  1421. %
  1422. % Test 329: PUT_VARM_DOUBLE: non numeric stride argument
  1423. testid = 'Test 329';
  1424. try
  1425. [status] = mexnc ( 'put_varm_double', ncid, varid, [0 0], [2 3], 'blah' , [1 6], input_data' );
  1426. error_condition = 1;
  1427. end
  1428. if error_condition
  1429. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1430. error ( err_msg );
  1431. end
  1432. %
  1433. % Test 330: PUT_VARM_FLOAT: non numeric stride argument
  1434. testid = 'Test 330';
  1435. try
  1436. [status] = mexnc ( 'put_varm_float', ncid, varid, [0 0], [2 3], 'blah', [1 6], input_data' );
  1437. error_condition = 1;
  1438. end
  1439. if error_condition
  1440. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1441. error ( err_msg );
  1442. end
  1443. %
  1444. % Test 331: PUT_VARM_INT: non numeric stride argument
  1445. testid = 'Test 331';
  1446. try
  1447. [status] = mexnc ( 'put_varm_int', ncid, varid, [0 0], [2 3], 'blah', [1 6], input_data' );
  1448. error_condition = 1;
  1449. end
  1450. if error_condition
  1451. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1452. error ( err_msg );
  1453. end
  1454. %
  1455. % Test 332: PUT_VARM_SHORT: non numeric stride argument
  1456. testid = 'Test 332';
  1457. try
  1458. [status] = mexnc ( 'put_varm_short', ncid, varid, [0 0], [2 3], 'blah', [1 6], input_data' );
  1459. error_condition = 1;
  1460. end
  1461. if error_condition
  1462. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1463. error ( err_msg );
  1464. end
  1465. %
  1466. % Test 333: PUT_VARM_SCHAR: non numeric stride argument
  1467. testid = 'Test 333';
  1468. try
  1469. [status] = mexnc ( 'put_varm_schar', ncid, varid, [0 0], [2 3], 'blah', [1 6] , input_data' );
  1470. error_condition = 1;
  1471. end
  1472. if error_condition
  1473. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1474. error ( err_msg );
  1475. end
  1476. %
  1477. % Test 334: PUT_VARM_UCHAR: non numeric stride argument
  1478. testid = 'Test 334';
  1479. try
  1480. [status] = mexnc ( 'put_varm_uchar', ncid, varid, [0 0], [2 3], 'blah', [1 6], input_data' );
  1481. error_condition = 1;
  1482. end
  1483. if error_condition
  1484. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1485. error ( err_msg );
  1486. end
  1487. %
  1488. % Test 335: PUT_VARM_TEXT: non numeric stride argument
  1489. testid = 'Test 335';
  1490. try
  1491. [status] = mexnc ( 'put_varm_text', ncid, varid, [0 0], [2 3], 'blah', [1 6], input_data' );
  1492. error_condition = 1;
  1493. end
  1494. if error_condition
  1495. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1496. error ( err_msg );
  1497. end
  1498. %
  1499. % Test 336: PUT_VARM_DOUBLE: non numeric imap argument
  1500. testid = 'Test 336';
  1501. try
  1502. [status] = mexnc ( 'put_varm_double', ncid, varid, [0 0], [2 3], 'blah' , [1 6], input_data' );
  1503. error_condition = 1;
  1504. end
  1505. if error_condition
  1506. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1507. error ( err_msg );
  1508. end
  1509. %
  1510. % Test 337: PUT_VARM_FLOAT: non numeric imap argument
  1511. testid = 'Test 337';
  1512. try
  1513. [status] = mexnc ( 'put_varm_float', ncid, varid, [0 0], [2 3], [1 1], 'blah', input_data' );
  1514. error_condition = 1;
  1515. end
  1516. if error_condition
  1517. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1518. error ( err_msg );
  1519. end
  1520. %
  1521. % Test 338: PUT_VARM_INT: non numeric imap argument
  1522. testid = 'Test 338';
  1523. try
  1524. [status] = mexnc ( 'put_varm_int', ncid, varid, [0 0], [2 3], [1 1], 'blah', input_data' );
  1525. error_condition = 1;
  1526. end
  1527. if error_condition
  1528. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1529. error ( err_msg );
  1530. end
  1531. %
  1532. % Test 339: PUT_VARM_SHORT: non numeric imap argument
  1533. testid = 'Test 339';
  1534. try
  1535. [status] = mexnc ( 'put_varm_short', ncid, varid, [0 0], [2 3], [1 1], 'blah' , input_data' );
  1536. error_condition = 1;
  1537. end
  1538. if error_condition
  1539. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1540. error ( err_msg );
  1541. end
  1542. %
  1543. % Test 340: PUT_VARM_SCHAR: non numeric imap argument
  1544. testid = 'Test 340';
  1545. try
  1546. [status] = mexnc ( 'put_varm_schar', ncid, varid, [0 0], [2 3], [1 1], 'blah', input_data' );
  1547. error_condition = 1;
  1548. end
  1549. if error_condition
  1550. err_msg = sprintf ( '%s: %s: succeeded when it should have failed\n', mfilename, testid);
  1551. error ( err_msg );
  1552. end
  1553. %
  1554. % Test 341: PUT_VARM_UCHAR: non numeric imap argument
  1555. testid = 'Test 341';
  1556. try
  1557. [status] = mexnc ( 'put_varm_uchar', ncid, varid, [0 0], [2 3], [1 1], 'blah', input_data

Large files files are truncated, but you can click here to view the full file