Sha256: 0747fe21213c8850e8d893fee8291eceb9b489ddd4838eca4122d24b3c90ed98

Contents?: true

Size: 1.31 KB

Versions: 33

Compression:

Stored size: 1.31 KB

Contents

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

class EqualizerImportTest < Test::Unit::TestCase
  DELTA = 0.001
  
  def test_introspects_properly
    i = Tracksperanto::Import::Equalizer4
    assert_equal "3DE v4 point export file", i.human_name
    assert !i.autodetects_size?
  end
  
  
  def test_parsing_from_importable
    fixture = File.open(File.dirname(__FILE__) + '/samples/3de_v4/3de_export_cube.txt')
    
    parser = Tracksperanto::Import::Equalizer4.new(:io => fixture, :width => 1024, :height => 512)
    trackers = parser.to_a
    assert_equal 8, trackers.length
    
    first_t = trackers[0]
    assert_equal "01", first_t.name
    assert_equal 61, first_t.length
    
    first_kf = first_t[0]
    assert_in_delta 407.384758225105315, first_kf.abs_x, DELTA
    assert_in_delta 232.449011732690479, first_kf.abs_y, DELTA
    assert_equal 39, first_kf.frame
  end
  
  def test_parsing_from_another_fixture
    fixture = File.open(File.dirname(__FILE__) + '/samples/3de_v4/FB1880_man_v05.txt')
    
    parser = Tracksperanto::Import::Equalizer4.new(:io => fixture, :width => 1024, :height => 512)
    trackers = parser.to_a
    assert_equal 27, trackers.length
    
    first_t = trackers[0]
    assert_equal "01", first_t.name
    assert_equal 115, first_t.length
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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