rbcdio 0.03 → 0.04
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.
- data/COPYING +623 -289
- data/ChangeLog +342 -219
- data/INSTALL +35 -26
- data/Makefile.am +2 -3
- data/Makefile.in +61 -45
- data/NEWS +7 -3
- data/README +8 -9
- data/THANKS +1 -0
- data/VERSION +1 -1
- data/config.guess +21 -11
- data/config.sub +38 -6
- data/configure +1195 -1031
- data/configure.ac +1 -1
- data/example/README +5 -3
- data/example/audio.rb +0 -0
- data/example/cd-read.rb +0 -0
- data/example/cdchange.rb +0 -0
- data/example/cdtext.rb +70 -0
- data/example/device.rb +0 -0
- data/example/drives.rb +30 -32
- data/example/eject.rb +0 -0
- data/example/iso1.rb +0 -0
- data/example/iso2.rb +0 -0
- data/example/iso3.rb +0 -0
- data/example/tracks.rb +0 -0
- data/ext/cdio/Makefile +92 -56
- data/ext/cdio/rubycdio_wrap.c +387 -101
- data/ext/iso9660/Makefile +93 -57
- data/ext/iso9660/rubyiso9660_wrap.c +127 -70
- data/install-sh +355 -159
- data/lib/cdio.rb +877 -843
- data/missing +34 -27
- data/swig/Makefile +1 -1
- data/swig/cdtext.swg +67 -0
- data/swig/device.swg +3 -3
- data/swig/disc.swg +2 -2
- data/swig/rubycdio.swg +3 -1
- data/swig/track.swg +9 -4
- data/test/cdiotest.rb +214 -216
- data/test/cdtext.rb +44 -0
- data/test/isocopy.rb +8 -9
- data/test/isotest.rb +126 -107
- metadata +21 -29
- data/doc/created.rid +0 -1
- data/doc/fr_class_index.html +0 -42
- data/doc/fr_file_index.html +0 -41
- data/doc/fr_method_index.html +0 -133
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/example/COPYING +0 -340
- data/example/copying +0 -340
- data/example/drivers.rb +0 -60
data/test/cdiotest.rb
CHANGED
@@ -3,231 +3,229 @@
|
|
3
3
|
|
4
4
|
# Unit test for cdio
|
5
5
|
#
|
6
|
-
require
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
old_dir = File.expand_path(Dir.pwd)
|
12
|
-
if old_dir != Mypath
|
13
|
-
Dir.chdir(Mypath)
|
14
|
-
end
|
15
|
-
|
16
|
-
%w(/../ext/cdio /../lib).each do |src_dir|
|
17
|
-
$: << Mypath + src_dir unless $:.member?(src_dir)
|
6
|
+
require 'test/unit'
|
7
|
+
mypath = File.expand_path(File.dirname(__FILE__))
|
8
|
+
%w(ext/cdio lib).each do |src_dir|
|
9
|
+
$: << File.join(mypath, '..', src_dir)
|
18
10
|
end
|
19
11
|
|
20
|
-
require
|
12
|
+
require 'cdio'
|
21
13
|
|
22
14
|
class CdioTests < Test::Unit::TestCase
|
15
|
+
|
16
|
+
def setup
|
17
|
+
@mypath = File.expand_path(File.dirname(__FILE__))
|
18
|
+
end
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
assert_equal(true, true, "Test misc operations")
|
20
|
+
# Test running miscellaneous operations
|
21
|
+
# No assumption about the CD-ROM drives is made, so
|
22
|
+
# we're just going to run operations and see that they
|
23
|
+
# don't crash.
|
24
|
+
def test_ops()
|
25
|
+
device = Cdio::Device.new()
|
26
|
+
if Rubycdio::VERSION_NUM >= 76
|
27
|
+
# FIXME: Broken on Darwin?
|
28
|
+
# device.open()
|
29
|
+
device.ATAPI?()
|
30
|
+
# FIXME: Broken on Darwin?
|
31
|
+
# device.media_changed?
|
38
32
|
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
33
|
+
assert_equal(true, true, "Test misc operations")
|
34
|
+
end
|
35
|
+
|
36
|
+
# Test getting default device
|
37
|
+
def test_device_default()
|
38
|
+
result1=Cdio::default_device_driver(Rubycdio::DRIVER_DEVICE)
|
39
|
+
result2=Cdio::default_device_driver()
|
40
|
+
assert_equal(result1, result2,
|
41
|
+
"default_device with/out parameters")
|
42
|
+
device = Cdio::Device.new()
|
43
|
+
result2=device.device()
|
44
|
+
if result1
|
45
|
+
assert_equal(result1[0], result2)
|
46
|
+
# Now try getting device using driver that we got back
|
47
|
+
begin
|
48
|
+
device=Cdio::Device.new(driver_id=result1[1])
|
49
|
+
result1 = device.device()
|
44
50
|
assert_equal(result1, result2,
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
if result1:
|
49
|
-
assert_equal(result1[0], result2)
|
50
|
-
# Now try getting device using driver that we got back
|
51
|
-
begin
|
52
|
-
device=Cdio::Device.new(driver_id=result1[1])
|
53
|
-
result1 = device.device()
|
54
|
-
assert_equal(result1, result2,
|
55
|
-
"default_device using driver name")
|
56
|
-
rescue
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# Test that various routines raise proper exceptions
|
62
|
-
def test_exceptions()
|
63
|
-
device = Cdio::Device.new()
|
64
|
-
# No CD or or CD image has been set yet. So these fail
|
65
|
-
begin
|
66
|
-
lsn = device.disc_last_lsn()
|
67
|
-
rescue IOError
|
68
|
-
assert_equal(true, true, "last_lsn() IO Error")
|
69
|
-
rescue Cdio::DriverError
|
70
|
-
assert_equal(true, true, "last_lsn() DriverError")
|
71
|
-
else
|
72
|
-
assert(false, "last_lsn() should raise error")
|
73
|
-
end
|
74
|
-
assert_equal("Uninitialized Device", device.disc_mode)
|
75
|
-
begin
|
76
|
-
track = device.num_tracks()
|
77
|
-
rescue IOError
|
78
|
-
assert_equal(true, true, "get_num_tracks() IO Error")
|
79
|
-
rescue Cdio::DriverError
|
80
|
-
assert_equal(true, true, "get_num_tracks() DriverError")
|
81
|
-
rescue Cdio::TrackError
|
82
|
-
assert_equal(true, true, "get_num_tracks() TrackError")
|
83
|
-
else
|
84
|
-
assert(false, "last_lsn() should raise error")
|
85
|
-
end
|
86
|
-
## assert_raise(DriverUninitError, device.driver_name)
|
87
|
-
## assert_raise(DriverUninitError,
|
88
|
-
## device.media_changed)
|
89
|
-
## assert_raise(IOError, device.open, "***Invalid device***")
|
51
|
+
"default_device using driver name")
|
52
|
+
rescue
|
53
|
+
end
|
90
54
|
end
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
assert_equal(true, result, "Have BIN/CUE driver via driver_id")
|
106
|
-
end
|
107
|
-
|
108
|
-
# Test functioning of cdrdao image routines
|
109
|
-
def test_tocfile()
|
110
|
-
## TOC reading needs to be done in the directory where the
|
111
|
-
## TOC/BIN files reside.
|
112
|
-
olddir=Dir.pwd()
|
113
|
-
Dir.chdir(Mypath)
|
114
|
-
tocfile="cdda.toc"
|
115
|
-
device = Cdio::Device.new(tocfile, Rubycdio::DRIVER_CDRDAO)
|
116
|
-
hw = device.hwinfo()
|
117
|
-
assert_equal(true, hw != nil, "get_hwinfo ok")
|
118
|
-
assert_equal('libcdio', hw["vendor"], "get_hwinfo vendor")
|
119
|
-
assert_equal('cdrdao', hw["model"], "get_hwinfo cdrdao")
|
120
|
-
# Test known values of various access parameters:
|
121
|
-
# access mode, driver name via string and via driver_id
|
122
|
-
# and cue name
|
123
|
-
result = device.arg("access-mode")
|
124
|
-
assert_equal(result, 'image', 'get_arg("access_mode")')
|
125
|
-
result = device.driver_name()
|
126
|
-
assert_equal(result, 'CDRDAO', 'get_driver_name')
|
127
|
-
result = device.driver_id()
|
128
|
-
assert_equal(result, Rubycdio::DRIVER_CDRDAO, 'get_driver_id')
|
129
|
-
result = device.arg("source")
|
130
|
-
assert_equal(result, tocfile, 'get_arg("source")')
|
131
|
-
result = device.media_changed?
|
132
|
-
assert_equal(false, result, "tocfile: media_changed?")
|
133
|
-
# Test getting is_tocfile
|
134
|
-
result = tocfile?(tocfile)
|
135
|
-
assert_equal(true, result, "is_tocfile(tocfile)")
|
136
|
-
result = nrg? tocfile
|
137
|
-
assert_equal(false, result, "is_nrgfile(tocfile)")
|
138
|
-
result = device? tocfile
|
139
|
-
assert_equal(false, result, "is_device(tocfile)")
|
140
|
-
## FIXME
|
141
|
-
## assert_raise(DriverUnsupportedError,
|
142
|
-
## (deviceblocksize= 2048))
|
143
|
-
##assert_raise(DriverUnsupportedError,
|
144
|
-
## (device.speed = 5))
|
145
|
-
device.close()
|
146
|
-
Dir.chdir(olddir)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Test that various routines raise proper exceptions
|
58
|
+
def test_exceptions()
|
59
|
+
device = Cdio::Device.new()
|
60
|
+
# No CD or or CD image has been set yet. So these fail
|
61
|
+
begin
|
62
|
+
lsn = device.disc_last_lsn()
|
63
|
+
rescue IOError
|
64
|
+
assert_equal(true, true, "last_lsn() IO Error")
|
65
|
+
rescue Cdio::DriverError
|
66
|
+
assert_equal(true, true, "last_lsn() DriverError")
|
67
|
+
else
|
68
|
+
assert(false, "last_lsn() should raise error")
|
147
69
|
end
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
70
|
+
assert_equal("Uninitialized Device", device.disc_mode)
|
71
|
+
begin
|
72
|
+
track = device.num_tracks()
|
73
|
+
rescue IOError
|
74
|
+
assert_equal(true, true, "get_num_tracks() IO Error")
|
75
|
+
rescue Cdio::DriverError
|
76
|
+
assert_equal(true, true, "get_num_tracks() DriverError")
|
77
|
+
rescue Cdio::TrackError
|
78
|
+
assert_equal(true, true, "get_num_tracks() TrackError")
|
79
|
+
else
|
80
|
+
assert(false, "last_lsn() should raise error")
|
159
81
|
end
|
82
|
+
## assert_raise(DriverUninitError, device.driver_name)
|
83
|
+
## assert_raise(DriverUninitError,
|
84
|
+
## device.media_changed)
|
85
|
+
## assert_raise(IOError, device.open, "***Invalid device***")
|
86
|
+
end
|
160
87
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
88
|
+
# Test that we have image drivers
|
89
|
+
def test_have_image_drivers()
|
90
|
+
result = Cdio::driver? :"CDRDAO"
|
91
|
+
assert_equal(true, result, "Have cdrdrao driver via string")
|
92
|
+
result = Cdio::driver? Rubycdio::DRIVER_CDRDAO
|
93
|
+
assert_equal(true, result, "Have cdrdrao driver via driver_id")
|
94
|
+
result = Cdio::driver? :"NRG"
|
95
|
+
assert_equal(true, result, "Have NRG driver via string")
|
96
|
+
result = Cdio::driver? Rubycdio::DRIVER_NRG
|
97
|
+
assert_equal(true, result, "Have NRG driver via driver_id")
|
98
|
+
result = Cdio::driver? :'BIN/CUE'
|
99
|
+
assert_equal(true, result, "Have BIN/CUE driver via string")
|
100
|
+
result = Cdio::driver? Rubycdio::DRIVER_BINCUE
|
101
|
+
assert_equal(true, result, "Have BIN/CUE driver via driver_id")
|
102
|
+
end
|
103
|
+
|
104
|
+
# Test functioning of cdrdao image routines
|
105
|
+
def test_tocfile()
|
106
|
+
## TOC reading needs to be done in the directory where the
|
107
|
+
## TOC/BIN files reside.
|
108
|
+
Dir.chdir(File.expand_path(File.dirname(__FILE__))) {
|
109
|
+
tocfile="cdda.toc"
|
110
|
+
device = Cdio::Device.new(tocfile, Rubycdio::DRIVER_CDRDAO)
|
111
|
+
hw = device.hwinfo()
|
112
|
+
assert_equal(true, hw != nil, "get_hwinfo ok")
|
113
|
+
assert_equal('libcdio', hw["vendor"], "get_hwinfo vendor")
|
114
|
+
assert_equal('cdrdao', hw["model"], "get_hwinfo cdrdao")
|
115
|
+
# Test known values of various access parameters:
|
116
|
+
# access mode, driver name via string and via driver_id
|
117
|
+
# and cue name
|
118
|
+
result = device.arg("access-mode")
|
119
|
+
assert_equal(result, 'image', 'get_arg("access_mode")')
|
120
|
+
result = device.driver_name()
|
121
|
+
assert_equal(result, 'CDRDAO', 'get_driver_name')
|
122
|
+
result = device.driver_id()
|
123
|
+
assert_equal(result, Rubycdio::DRIVER_CDRDAO, 'get_driver_id')
|
124
|
+
result = device.arg("source")
|
125
|
+
assert_equal(result, tocfile, 'get_arg("source")')
|
126
|
+
result = device.media_changed?
|
127
|
+
assert_equal(false, result, "tocfile: media_changed?")
|
128
|
+
# Test getting is_tocfile
|
129
|
+
result = tocfile?(tocfile)
|
130
|
+
assert_equal(true, result, "is_tocfile(tocfile)")
|
131
|
+
result = nrg? tocfile
|
132
|
+
assert_equal(false, result, "is_nrgfile(tocfile)")
|
133
|
+
result = device? tocfile
|
134
|
+
assert_equal(false, result, "is_device(tocfile)")
|
135
|
+
## FIXME
|
136
|
+
## assert_raise(DriverUnsupportedError,
|
137
|
+
## (deviceblocksize= 2048))
|
138
|
+
##assert_raise(DriverUnsupportedError,
|
139
|
+
## (device.speed = 5))
|
140
|
+
device.close()
|
141
|
+
}
|
142
|
+
end
|
143
|
+
|
144
|
+
# Test functioning of read routines
|
145
|
+
def test_read()
|
146
|
+
cuefile = File.join(@mypath, '..', 'data', 'isofs-m1.cue')
|
147
|
+
Dir.chdir(@mypath) {
|
148
|
+
device = Cdio::Device.new(cuefile)
|
149
|
+
# Read the ISO Primary Volume descriptor
|
150
|
+
blocks, data=device.read_sectors(16, Rubycdio::READ_MODE_M1F1)
|
151
|
+
assert_equal(data[1..5], 'CD001')
|
152
|
+
assert_equal(blocks, 1)
|
153
|
+
blocks, data=device.read_data_blocks(26)
|
154
|
+
assert_equal(data[6..31], 'GNU GENERAL PUBLIC LICENSE')
|
155
|
+
}
|
156
|
+
end
|
157
|
+
|
158
|
+
# Test functioning of BIN/CUE image routines
|
159
|
+
def test_bincue()
|
160
|
+
cuefile = File.join(@mypath, 'cdda.cue')
|
161
|
+
Dir.chdir(@mypath) {
|
162
|
+
device = Cdio::Device.new(source=cuefile)
|
163
|
+
# Test known values of various access parameters:
|
164
|
+
# access mode, driver name via string and via driver_id
|
165
|
+
# and cue name
|
166
|
+
result = device.arg("access-mode")
|
167
|
+
assert_equal(result, 'image', 'get_arg("access_mode")')
|
168
|
+
result = device.driver_name()
|
169
|
+
assert_equal(result, 'BIN/CUE', 'get_driver_name')
|
170
|
+
result = device.driver_id()
|
171
|
+
assert_equal(result, Rubycdio::DRIVER_BINCUE, 'get_driver_id')
|
172
|
+
result = device.arg("cue")
|
173
|
+
assert_equal(result, cuefile, 'get_arg("cue")')
|
174
|
+
# Test getting binfile? and cuefile?
|
175
|
+
binfile = cuefile? cuefile
|
176
|
+
assert_equal(true, binfile != nil, "cuefile? cuefile")
|
177
|
+
# require "debug"
|
178
|
+
cuefile2 = binfile? binfile
|
179
|
+
# Could check that cuefile2 == cuefile, but some OS's may
|
180
|
+
# change the case of files
|
181
|
+
assert_equal(true, cuefile2 != nil, "cuefile? binfile")
|
182
|
+
result = tocfile? cuefile
|
183
|
+
assert_equal(false, result, "tocfile? tocfile")
|
184
|
+
hw = device.hwinfo()
|
185
|
+
assert_equal(true, hw != nil, "get_hwinfo ok")
|
186
|
+
assert_equal('libcdio', hw["vendor"], "get_hwinfo vendor")
|
187
|
+
assert_equal('CDRWIN', hw["model"], "get_hwinfo model")
|
188
|
+
result = device? cuefile
|
189
|
+
assert_equal(false, result, "device? tocfile")
|
190
|
+
result = device.media_changed?
|
191
|
+
assert_equal(false, result, "binfile: media_changed?")
|
192
|
+
if Rubycdio::VERSION_NUM >= 77
|
193
|
+
# There's a bug in libcdio 0.76 that causes these to crash
|
194
|
+
### FIXME
|
195
|
+
# assert_raise(DriverUnsupportedError,
|
196
|
+
# device.blocksize= 2048)
|
197
|
+
# assert_raise(DriverUnsupportedError,
|
198
|
+
# device.speed = 5)
|
199
|
+
end
|
200
|
+
device.close()
|
201
|
+
}
|
202
|
+
end
|
203
|
+
|
204
|
+
# Test functioning CD-DA
|
205
|
+
def test_cdda()
|
206
|
+
device = Cdio::Device.new()
|
207
|
+
cuefile = File.join(@mypath, 'cdda.cue')
|
208
|
+
device.open(cuefile)
|
209
|
+
result = device.disc_mode()
|
210
|
+
assert_equal(result, 'CD-DA', 'get_disc_mode')
|
211
|
+
assert_equal(device.mcn(), '0000010271955', 'get_mcn')
|
212
|
+
## FIXME
|
213
|
+
## assert_raise(DriverUnsupportedError,
|
214
|
+
## device.last_session)
|
215
|
+
# assert_raise(IOError, device.joliet_level)
|
216
|
+
result = device.num_tracks()
|
217
|
+
assert_equal(result, 1, 'get_num_tracks')
|
218
|
+
disc_last_lsn = device.disc_last_lsn()
|
219
|
+
assert_equal(disc_last_lsn, 302, 'get_disc_last_lsn')
|
220
|
+
t=device.last_track()
|
221
|
+
assert_equal(t.track, 1, 'last_track')
|
222
|
+
assert_equal(t.last_lsn(), 301, '(track) last_lsn')
|
223
|
+
assert_equal(device.track_for_lsn(t.last_lsn()).track,
|
224
|
+
t.track)
|
225
|
+
t=device.first_track()
|
226
|
+
assert_equal(t.track, 1, 'get_first_track')
|
227
|
+
assert_equal(t.format(), 'audio', 'get_track_format')
|
228
|
+
assert_equal(t.msf(), "00:02:00", "get_msf")
|
229
|
+
device.close()
|
230
|
+
end
|
232
231
|
end
|
233
|
-
Dir.chdir(old_dir)
|
data/test/cdtext.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Unit test for cdtext.
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
mypath = File.expand_path(File.dirname(__FILE__))
|
7
|
+
|
8
|
+
%w(lib ext/cdio ext/iso9660).each do |d|
|
9
|
+
$: << File.join(mypath, '..', d)
|
10
|
+
end
|
11
|
+
%w(cdio iso9660).each {|f| require f}
|
12
|
+
|
13
|
+
class CDTextTests < Test::Unit::TestCase
|
14
|
+
|
15
|
+
# Test keywords
|
16
|
+
def test_keyword
|
17
|
+
assert_equal(Rubycdio.cdtext_is_keyword('PERFORMER'),
|
18
|
+
Rubycdio::CDTEXT_PERFORMER)
|
19
|
+
assert_equal(Rubycdio.cdtext_is_keyword('IDONOTEXIST'),
|
20
|
+
Rubycdio::MAX_CDTEXT_FIELDS)
|
21
|
+
|
22
|
+
assert_equal(Rubycdio.cdtext_field2str(Rubycdio::CDTEXT_PERFORMER),
|
23
|
+
"PERFORMER")
|
24
|
+
end
|
25
|
+
|
26
|
+
# Test getting and setting CDText
|
27
|
+
def test_get_set
|
28
|
+
tocpath = File.join(File.dirname(__FILE__), 'cdtext.toc')
|
29
|
+
device = Cdio::Device.new(tocpath, Rubycdio::DRIVER_CDRDAO)
|
30
|
+
|
31
|
+
disctext = device.track(0).cdtext()
|
32
|
+
assert_equal(disctext.get(Rubycdio::CDTEXT_PERFORMER), 'Performer')
|
33
|
+
assert_equal(disctext.get(Rubycdio::CDTEXT_TITLE), 'CD Title')
|
34
|
+
assert_equal(disctext.get(Rubycdio::CDTEXT_DISCID), 'XY12345')
|
35
|
+
|
36
|
+
track1text = device.track(1).cdtext()
|
37
|
+
assert_equal(track1text.get(Rubycdio::CDTEXT_PERFORMER), 'Performer')
|
38
|
+
assert_equal(track1text.get(Rubycdio::CDTEXT_TITLE), 'Track Title')
|
39
|
+
|
40
|
+
track1text.set(Rubycdio::CDTEXT_PERFORMER, 'Someone')
|
41
|
+
assert_equal(track1text.get(Rubycdio::CDTEXT_PERFORMER), 'Someone')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
data/test/isocopy.rb
CHANGED
@@ -1,26 +1,25 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# $Id: isocopy.rb,v 1.4 2006/12/09 09:59:49 rocky Exp $
|
3
2
|
|
4
3
|
# Unit test of ISO 9660 file extraction.
|
5
4
|
|
6
|
-
require
|
5
|
+
require 'test/unit'
|
7
6
|
mypath = File.expand_path(File.dirname(__FILE__))
|
8
|
-
$: << mypath + '/../lib'
|
9
|
-
$: << mypath + '/../ext/cdio'
|
10
|
-
$: << mypath + '/../ext/iso9660'
|
11
7
|
|
12
|
-
|
13
|
-
|
8
|
+
%w(lib ext/cdio ext/iso9660).each do |d|
|
9
|
+
$: << File.join(mypath, '..', d)
|
10
|
+
end
|
11
|
+
%w(cdio iso9660).each {|f| require f}
|
12
|
+
|
14
13
|
|
15
14
|
# The test CD image
|
16
|
-
CD_IMAGE_PATH = mypath
|
15
|
+
CD_IMAGE_PATH = File.join(mypath, '..', 'data')
|
17
16
|
|
18
17
|
class ISO9660Tests < Test::Unit::TestCase
|
19
18
|
|
20
19
|
def test_fs()
|
21
20
|
|
22
21
|
local_filename="COPYING"
|
23
|
-
cd_image_fname = CD_IMAGE_PATH
|
22
|
+
cd_image_fname = File.join(CD_IMAGE_PATH, 'isofs-m1.cue')
|
24
23
|
cd = ISO9660::FS::new(cd_image_fname)
|
25
24
|
assert(cd != nil, "Open CD image %s" % cd_image_fname)
|
26
25
|
statbuf = cd.stat("/" + local_filename)
|