Commit a9afb575 authored by Gonzalez, Miguel's avatar Gonzalez, Miguel

Issue 33: Added a test for IN5

parent 094936c0
......@@ -995,6 +995,60 @@ pro unittest_reading_salsa, P_to_DATA, fails_count, failed_tests, user_directory
end
pro unittest_reading_in5, P_to_DATA, fails_count, failed_tests, user_directory, u
;+
;** ******************************************
;** Tests for IN5
;-
@lamp.cbk
rdset, inst='IN5'
TEST_directory = P_to_DATA + 'data_in5' + lamp_dvd
cd, TEST_directory
;Vanadium (17 July 2019)
message, /reset
st = 'IN5: Vanadium (July 2019)'
rdset, /raw
W = RDOPR('178100', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [3, 384, 241, 512, 4, 47382528])]
utest = [utest, unittest_check_axis([X60[[0, 200, 511]]], [134.81723, 58.098026, -11.917543])]
utest = [utest, unittest_check_axis([Y60[[0, 121, 383]]], [-146.88797, 1.2240664, 146.88797])]
utest = [utest, unittest_check_string([Z60[[0, 255, 511]]], [1., 256., 512.])]
utest = [utest, unittest_check_axis([N60[0], N60[-1]], [2., 2.])]
utest = [utest, unittest_check_axis([P60[[3, 6, 9, 11, 21]]], [597476.0, 5024032.0, 270.0, 3.6071, 5.5])]
utest = [utest, unittest_check_total(W60, 5013518.0)]
utest = [utest, unittest_check_total(E60, 0.0)]
utest = [utest, unittest_check_total(N60, 597476.0)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN5: Vanadium (July 2019, no raw)'
rdset, /noraw
W = RDOPR('178100', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 512, 362, 4, 185344])]
utest = [utest, unittest_check_axis([X60[[0, 200, 511]]], [1., 201., 512.])]
utest = [utest, unittest_check_axis([Y60[[0, 180, 361]]], [0.372, 67.409, 134.817])]
utest = [utest, unittest_check_string([Z60[0], Z60[-1]], [1., 512.])]
utest = [utest, unittest_check_axis([N60[0]], [1000.0])]
utest = [utest, unittest_check_axis([P60[[3, 6, 9, 11, 21]]], [597476.0, 5024032.0, 271.35553, 3.6071, 5.5])]
utest = [utest, unittest_check_total(W60, 8344.5459)]
utest = [utest, unittest_check_total(E60, 549.77899)]
utest = [utest, unittest_check_total(N60, 1000.0)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
end
pro lamp_reading_unit_test, inst=inst
;+
;** ***************************
......@@ -1030,6 +1084,8 @@ if inst eq 'ALL' or inst eq 'IN16' then unittest_reading_in16, P_to_DATA, fails_
if inst eq 'ALL' or inst eq 'SALSA' then unittest_reading_salsa, P_to_DATA, fails_count, failed_tests, user_directory, u
if inst eq 'ALL' or inst eq 'IN5' then unittest_reading_in5, P_to_DATA, fails_count, failed_tests, user_directory, u
cd, user_directory
printf, u, '' & printf,u, '*********** ' & printf, u, 'End of test: ', fails_count, ' error(s)'
print, '' & print, '*********** ' & print, 'End of test: ', fails_count, ' error(s)'
......
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