local map = ...

-- Passing a value that is neither sol.main, a game nor a map as the
-- context argument must not crash the engine: Solarus shows a warning
-- in the console and falls back to the sol.main context.
-- This needs -fatal-errors=no because the test harness turns
-- Debug::error() (used to print that warning) into a fatal error by
-- default, whereas real games do not.

-- Note: a string first argument is never treated as a context (it is
-- assumed to be a regular argument instead), so only non-string,
-- non-context values exercise the fallback path tested here.
--
-- get_music_channel_volume(), set_music_channel_volume() and
-- set_music_tempo() are deliberately excluded: their own first argument
-- (a channel or tempo number) is itself a non-string, non-context value,
-- so an invalid context can't be distinguished from a legitimate call
-- for them. See audio_api_tests.lua for their expected behavior instead.
assert_equal(sol.audio.get_music(42), nil)
assert_equal(sol.audio.get_music({}), nil)
assert_equal(sol.audio.get_music(true), nil)
assert_equal(sol.audio.get_music_format(42), nil)
assert_equal(sol.audio.get_music_num_channels(42), nil)
assert_equal(sol.audio.get_music_tempo(42), nil)

sol.main.exit()
