Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
magic-lantern
magic-lantern
Commits
28372a89e39d
Commit
830055af
authored
May 04, 2016
by
alex@thinkpad
Browse files
api_test.lua: tests for half-shutter events
--HG-- branch : lua_fix
parent
8dc99bb16f87
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/api_test.lua
View file @
28372a89
...
...
@@ -182,6 +182,25 @@ function test_io()
append_test
(
"tmp.txt"
)
end
function
test_keys
()
printf
(
"Testing half-shutter...\n"
)
-- open Canon menu
key
.
press
(
KEY
.
MENU
)
msleep
(
1000
)
-- fixme: expose things like QR_MODE, PLAY_MODE, enter_play_mode...
assert
(
camera
.
state
==
1
)
key
.
press
(
KEY
.
HALFSHUTTER
)
assert
(
key
.
last
==
KEY
.
HALFSHUTTER
)
msleep
(
1000
)
-- half-shutter should close Canon menu
assert
(
camera
.
state
==
0
)
key
.
press
(
KEY
.
UNPRESS_HALFSHUTTER
)
assert
(
key
.
last
==
KEY
.
UNPRESS_HALFSHUTTER
)
printf
(
"Half-shutter test OK.\n"
)
-- todo: test other key codes? press/unpress events?
end
function
test_camera_exposure
()
printf
(
"Testing exposure settings, module 'camera'...\n"
)
printf
(
"Camera : %s (%s) %s\n"
,
camera
.
model
,
camera
.
model_short
,
camera
.
firmware
)
...
...
@@ -681,6 +700,7 @@ function api_tests()
printf
(
"Module tests...\n"
)
test_io
()
test_keys
()
test_camera_exposure
()
test_camera_take_pics
()
test_lv
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment