tracksperanto 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,4 +70,25 @@ class PFTrackImportTest < Test::Unit::TestCase
70
70
  assert_equal 37, trackers[1].length
71
71
  end
72
72
 
73
+ def test_stereoscopy
74
+ fixture = File.open(File.dirname(__FILE__) + '/samples/pftrack5/stereo.2dt')
75
+ parser = Tracksperanto::Import::PFTrack.new(:io => fixture, :width => 1920, :height => 1080)
76
+ acc = Tracksperanto::Accumulator.new
77
+ parser.each{|t| acc << t }
78
+
79
+ assert_equal 1690, acc.size, "Should have recovered 1690 trackers"
80
+ assert_equal "Auto_00001_Primary", acc[0].name
81
+ assert_equal "Auto_00001_Secondary", acc[1].name
82
+
83
+ assert_equal "Auto_00016_Primary", acc[18].name
84
+ assert_equal 34, acc[18].length
85
+ assert_in_delta 1331.017, acc[18][0].abs_x, DELTA
86
+
87
+ assert_equal "Auto_00016_Secondary", acc[19].name
88
+ assert_equal 34, acc[19].length
89
+ assert_in_delta 1335.609, acc[19][0].abs_x, DELTA
90
+
91
+ assert_equal "Auto_00021_Primary", acc[20].name
92
+ assert_equal 0, acc[20].length
93
+ end
73
94
  end
@@ -1,4 +1,5 @@
1
1
  require File.expand_path(File.dirname(__FILE__)) + '/helper'
2
+ require "set"
2
3
 
3
4
  class CliTest < Test::Unit::TestCase
4
5
  TEMP_DIR = File.expand_path(File.dirname(__FILE__) + "/tmp")
@@ -53,14 +54,14 @@ class CliTest < Test::Unit::TestCase
53
54
  flm_pftrack_v5.2dt flm_shake_trackers.txt flm_syntheyes_2dt.txt
54
55
  )
55
56
 
56
- assert_equal fs, Dir.entries(TEMP_DIR)
57
+ assert_same_set fs, Dir.entries(TEMP_DIR)
57
58
  end
58
59
 
59
60
  def test_cli_with_only_option
60
61
  FileUtils.cp(File.dirname(__FILE__) + "/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer", TEMP_DIR + "/flm.stabilizer")
61
62
  cli("#{BIN_P} --only syntheyes #{TEMP_DIR}/flm.stabilizer")
62
63
  fs = %w(. .. flm.stabilizer flm_syntheyes_2dt.txt )
63
- assert_equal fs, Dir.entries(TEMP_DIR)
64
+ assert_same_set fs, Dir.entries(TEMP_DIR)
64
65
  end
65
66
 
66
67
  def test_cli_reformat
@@ -72,4 +73,10 @@ class CliTest < Test::Unit::TestCase
72
73
  assert_equal 1204, p.width, "The width of the converted setup should be that"
73
74
  assert_equal 340, p.height, "The height of the converted setup should be that"
74
75
  end
76
+
77
+ # We use this instead of assert_equals for arrays since different filesystems
78
+ # return files in different order
79
+ def assert_same_set(expected_enum, enum, message = "Should be the same set")
80
+ assert_equal Set.new(expected_enum), Set.new(enum), message
81
+ end
75
82
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracksperanto
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 2
10
- version: 2.3.2
9
+ - 3
10
+ version: 2.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julik Tarkhanov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-10 00:00:00 +02:00
18
+ date: 2011-05-13 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -191,6 +191,7 @@ files:
191
191
  - test/import/samples/pftrack5/apft.2dt
192
192
  - test/import/samples/pftrack5/empty_trackers.2dt
193
193
  - test/import/samples/pftrack5/garage.2dt
194
+ - test/import/samples/pftrack5/stereo.2dt
194
195
  - test/import/samples/shake_script/REDACTED_shake_file.shk
195
196
  - test/import/samples/shake_script/comments_inline_with_args.shk
196
197
  - test/import/samples/shake_script/designated_global_range_starting_at_negative_frame.shk