Skip to content

Commit

Permalink
Add missing tests for a closed module.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Sep 1, 2018
1 parent de13033 commit cabc81d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/openmpt_module_test.rb
Expand Up @@ -13,13 +13,15 @@ def test_create_and_destroy
refute_equal mod, 0
assert_equal mod.sample_rate, 48_000
mod.close
assert mod.closed?
end

def test_create_with_sample_rate
mod = ::FFI::OpenMPT::Module.new(MOD_LAST_SUN, 44_100)
refute_equal mod, 0
assert_equal mod.sample_rate, 44_100
mod.close
assert mod.closed?
end

def test_open
Expand All @@ -38,14 +40,15 @@ def test_open_bad
end

def test_open_block
::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
m = ::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
refute_equal mod, 0
assert_equal mod.sample_rate, 48_000
end
assert m.closed?
end

def test_open_block_and_change_sample_rate
::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
m = ::FFI::OpenMPT::Module.open(MOD_LAST_SUN) do |mod|
refute_equal mod, 0
assert_equal mod.sample_rate, 48_000

Expand All @@ -64,6 +67,7 @@ def test_open_block_and_change_sample_rate
mod.sample_rate = 192_000
assert_equal mod.sample_rate, 192_000
end
assert m.closed?
end

def test_informational_calls
Expand Down

0 comments on commit cabc81d

Please sign in to comment.