Sha256: 8271c7c96660c0177514c071b5b5aff3b8fe8caabfe23b9b8f50a9792d939b35

Contents?: true

Size: 802 Bytes

Versions: 26

Compression:

Stored size: 802 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__)) + '/helper'

class TestUVCoords < Test::Unit::TestCase
  include Tracksperanto::UVCoordinates
  
  DELTA = 0.001
  
  def test_from_uv
    assert_in_delta 719.5, convert_from_uv(1.0, 720), DELTA
    assert_in_delta 0.5, convert_from_uv(-1.0, 720), DELTA
  end
  
  def test_from_uv_with_small_values
    assert_in_delta 0.5, convert_from_uv(-1.0, 16), DELTA
    assert_in_delta 15.5, convert_from_uv(1.0, 16), DELTA
  end
  
  def test_to_uv_with_small_values
    assert_in_delta -1.0, convert_to_uv(0.5, 16), DELTA
    assert_in_delta 1.0, convert_to_uv(15.5, 16), DELTA
  end
  
  
  def test_to_uv
    assert_in_delta 1.0, convert_to_uv(719.5, 720), DELTA
    assert_in_delta -1.0, convert_to_uv(0.5, 720), DELTA
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 test/test_uv_coords.rb
tracksperanto-3.5.8 test/test_uv_coords.rb
tracksperanto-3.5.7 test/test_uv_coords.rb
tracksperanto-3.5.6 test/test_uv_coords.rb
tracksperanto-3.5.5 test/test_uv_coords.rb
tracksperanto-3.5.4 test/test_uv_coords.rb
tracksperanto-3.5.2 test/test_uv_coords.rb
tracksperanto-3.5.1 test/test_uv_coords.rb
tracksperanto-3.5.0 test/test_uv_coords.rb
tracksperanto-3.4.1 test/test_uv_coords.rb
tracksperanto-3.4.0 test/test_uv_coords.rb
tracksperanto-3.3.13 test/test_uv_coords.rb
tracksperanto-3.3.12 test/test_uv_coords.rb
tracksperanto-3.3.11 test/test_uv_coords.rb
tracksperanto-3.3.10 test/test_uv_coords.rb
tracksperanto-3.3.9 test/test_uv_coords.rb
tracksperanto-3.3.8 test/test_uv_coords.rb
tracksperanto-3.3.7 test/test_uv_coords.rb
tracksperanto-3.3.6 test/test_uv_coords.rb
tracksperanto-3.3.0.pre test/test_uv_coords.rb