dtas.git  about / heads / tags
duct tape audio suite for *nix
blob b16438cdf5ef7aba6793d9005920e2014477abcc 788 bytes (raw)
$ git show 0.12.x-stable:test/test_rg_state.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
# Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require './test/helper'
require 'dtas/rg_state'

class TestRGState < Testcase

  def test_rg_state
    rg = DTAS::RGState.new
    assert_equal({}, rg.to_hsh)
    rg.preamp = 0.1
    assert_equal({"preamp" => 0.1}, rg.to_hsh)
    rg.preamp = 0
    assert_equal({}, rg.to_hsh)
  end

  def test_load
    rg = DTAS::RGState.load("preamp" => 0.666)
    assert_equal({"preamp" => 0.666}, rg.to_hsh)
  end

  def test_mode_set
    rg = DTAS::RGState.new
    orig = rg.mode
    assert_equal DTAS::RGState::RG_DEFAULT["mode"], orig
    %w(album_gain track_gain album_peak track_peak).each do |t|
      rg.mode = t
      assert_equal t, rg.mode
    end
  end
end

git clone git://80x24.org/dtas.git
git clone https://80x24.org/dtas.git