tracksperanto 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +1 -0
- data/lib/import/flame_stabilizer.rb +6 -4
- data/lib/import/match_mover.rb +6 -3
- data/lib/middleware/lint.rb +5 -2
- data/lib/tracksperanto.rb +1 -1
- data/lib/tracksperanto/buffering_reader.rb +1 -2
- data/lib/tracksperanto/keyframe.rb +4 -0
- data/test/import/samples/match_mover/NonSequentialMatchmoverPoints.rz2 +93306 -0
- data/test/import/test_match_mover_import.rb +10 -1
- data/test/middleware/test_lint_middleware.rb +15 -1
- data/test/test_bufferingreader.rb +2 -2
- data/test/test_cli.rb +10 -0
- data/test/test_keyframe.rb +6 -0
- metadata +21 -18
@@ -4,6 +4,7 @@ class MatchMoverImportTest < Test::Unit::TestCase
|
|
4
4
|
DELTA = 0.01
|
5
5
|
|
6
6
|
P = File.dirname(__FILE__) + '/samples/match_mover/kipPointsMatchmover.rz2'
|
7
|
+
P2 = File.dirname(__FILE__) + '/samples/match_mover/NonSequentialMatchmoverPoints.rz2'
|
7
8
|
|
8
9
|
def test_introspects_properly
|
9
10
|
i = Tracksperanto::Import::MatchMover
|
@@ -11,10 +12,18 @@ class MatchMoverImportTest < Test::Unit::TestCase
|
|
11
12
|
assert i.autodetects_size?
|
12
13
|
end
|
13
14
|
|
15
|
+
def test_parsing_with_non_sequential_keyframes
|
16
|
+
fixture = File.open(P2)
|
17
|
+
|
18
|
+
parser = Tracksperanto::Import::MatchMover.new(:io => fixture)
|
19
|
+
trackers = parser.to_a
|
20
|
+
assert_equal 0, trackers[0][0].frame, "Should have offset the first frame to 0"
|
21
|
+
end
|
22
|
+
|
14
23
|
def test_parsing_from_matchmover
|
15
24
|
fixture = File.open(P)
|
16
25
|
|
17
|
-
parser = Tracksperanto::Import::MatchMover.new(:io => fixture
|
26
|
+
parser = Tracksperanto::Import::MatchMover.new(:io => fixture)
|
18
27
|
trackers = parser.to_a
|
19
28
|
|
20
29
|
assert_equal 2560, parser.width
|
@@ -42,7 +42,21 @@ class LintMiddlewareTest < Test::Unit::TestCase
|
|
42
42
|
ex.export_point(1, 123.3, 456.0, 0.0)
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
|
+
|
47
|
+
def test_exporting_in_sequence_starting_on_frame_minus_one
|
48
|
+
m = flexmock
|
49
|
+
m.should_receive(:start_export).once
|
50
|
+
m.should_receive(:start_tracker_segment).once
|
51
|
+
m.should_receive(:export_point).twice
|
52
|
+
|
53
|
+
ex = Tracksperanto::Middleware::Lint.new(m)
|
54
|
+
ex.start_export(100, 100)
|
55
|
+
ex.start_tracker_segment("Foo")
|
56
|
+
ex.export_point(-1, 123.3, 456.0, 0.0)
|
57
|
+
ex.export_point(0, 123.3, 456.0, 0.0)
|
58
|
+
end
|
59
|
+
|
46
60
|
def test_exporting_with_two_starts_raises
|
47
61
|
m = flexmock
|
48
62
|
m.should_receive(:start_export).once
|
@@ -17,9 +17,9 @@ class TestBufferingReader < Test::Unit::TestCase
|
|
17
17
|
reader.read_one_byte
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def test_reads_in_64kb_chunks_by_default
|
21
21
|
s = StringIO.new("abcd")
|
22
|
-
flexmock(s).should_receive(:read).with(
|
22
|
+
flexmock(s).should_receive(:read).with(64 * 1024).once.and_return("abcd")
|
23
23
|
reader = Tracksperanto::BufferingReader.new(s)
|
24
24
|
reader.read_one_byte
|
25
25
|
end
|
data/test/test_cli.rb
CHANGED
@@ -44,6 +44,16 @@ class CliTest < Test::Unit::TestCase
|
|
44
44
|
assert_same_set fs, Dir.entries(TEMP_DIR)
|
45
45
|
end
|
46
46
|
|
47
|
+
def test_cli_with_error_on_nonsequentials_matchmover_to_pftrack5
|
48
|
+
FileUtils.cp(File.dirname(__FILE__) + "/import/samples/match_mover/NonSequentialMatchmoverPoints.rz2", TEMP_DIR + "/mm.rz2")
|
49
|
+
status, o, e = cli(TEMP_DIR + "/mm.rz2 --only pftrack5")
|
50
|
+
assert_equal "", e
|
51
|
+
assert_equal 0, status, "Should exit with a normal status"
|
52
|
+
|
53
|
+
fs = %w(. .. flm.stabilizer mm.rz2 mm_pftrack_v5.2dt )
|
54
|
+
assert_same_set fs, Dir.entries(TEMP_DIR)
|
55
|
+
end
|
56
|
+
|
47
57
|
def test_cli_with_nonexisting_only_exporter_prints_proper_error_message
|
48
58
|
status, o, e = cli("--only microsoftfuckingword " + TEMP_DIR + "/flm.stabilizer")
|
49
59
|
assert_equal 2, status, "Should exit with abnormal state"
|
data/test/test_keyframe.rb
CHANGED
@@ -13,6 +13,12 @@ class KeyframeTest < Test::Unit::TestCase
|
|
13
13
|
assert_equal 12.5, keyframe.abs_y
|
14
14
|
end
|
15
15
|
|
16
|
+
def test_sorts_on_frame
|
17
|
+
kf = Tracksperanto::Keyframe.new(:frame => 4, :abs_x => 10, :abs_y => 12.0)
|
18
|
+
kf2 = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0)
|
19
|
+
assert_equal [kf2, kf], [kf, kf2].sort
|
20
|
+
end
|
21
|
+
|
16
22
|
def test_inspect
|
17
23
|
kf = Tracksperanto::Keyframe.new(:frame => 0, :abs_x => 10, :abs_y => 12.0)
|
18
24
|
assert_equal "#< 10.0x12.0 @0 ~0.00) >", kf.inspect
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracksperanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: obuf
|
16
|
-
requirement: &
|
16
|
+
requirement: &10419920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10419920
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: progressive_io
|
27
|
-
requirement: &
|
27
|
+
requirement: &10419700 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *10419700
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: flame_channel_parser
|
38
|
-
requirement: &
|
38
|
+
requirement: &10419490 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *10419490
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: progressbar
|
49
|
-
requirement: &
|
49
|
+
requirement: &10419280 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0.9'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *10419280
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: update_hints
|
60
|
-
requirement: &
|
60
|
+
requirement: &10419070 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '1.0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *10419070
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: flexmock
|
71
|
-
requirement: &
|
71
|
+
requirement: &10418860 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0.8'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *10418860
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: cli_test
|
82
|
-
requirement: &
|
82
|
+
requirement: &10418650 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '1.0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *10418650
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: hoe
|
93
|
-
requirement: &
|
93
|
+
requirement: &10418440 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '2.12'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *10418440
|
102
102
|
description: !binary |-
|
103
103
|
VHJhY2tzcGVyYW50byBpcyBhIHVuaXZlcnNhbCAyRC10cmFjayB0cmFuc2xh
|
104
104
|
dG9yIGJldHdlZW4gbWFueSBhcHBzLg==
|
@@ -351,6 +351,9 @@ files:
|
|
351
351
|
- !binary |-
|
352
352
|
dGVzdC9pbXBvcnQvc2FtcGxlcy9mbGFtZV9zdGFiaWxpemVyL21lZ2FUcmFj
|
353
353
|
ay5hY3Rpb24uM2R0cmFjay5zdGFiaWxpemVy
|
354
|
+
- !binary |-
|
355
|
+
dGVzdC9pbXBvcnQvc2FtcGxlcy9tYXRjaF9tb3Zlci9Ob25TZXF1ZW50aWFs
|
356
|
+
TWF0Y2htb3ZlclBvaW50cy5yejI=
|
354
357
|
- !binary |-
|
355
358
|
dGVzdC9pbXBvcnQvc2FtcGxlcy9tYXRjaF9tb3Zlci9raXBQb2ludHNNYXRj
|
356
359
|
aG1vdmVyLnJ6Mg==
|