Commit 96fe3b9 1 parent 93130e5 commit 96fe3b9 Copy full SHA for 96fe3b9
File tree 3 files changed +47
-1
lines changed
3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ mod test_id3v1;
10
10
mod test_info;
11
11
mod test_mp4;
12
12
mod test_mpeg;
13
+ mod test_ogaflac;
13
14
mod test_speex;
15
+ mod test_wav;
14
16
mod test_wavpack;
15
17
mod test_xiphcomment;
16
- mod test_wav;
Original file line number Diff line number Diff line change
1
+ use crate :: temp_file;
2
+ use lofty:: flac:: FlacFile ;
3
+ use lofty:: ogg:: VorbisComments ;
4
+ use lofty:: { Accessor , AudioFile , ParseOptions } ;
5
+ use std:: io:: { Seek , SeekFrom } ;
6
+
7
+ #[ test]
8
+ #[ ignore] // TODO: We don't support FLAC in OGA
9
+ fn test_framing_bit ( ) {
10
+ let mut file = temp_file ! ( "tests/taglib/data/empty_flac.oga" ) ;
11
+
12
+ {
13
+ let mut f = FlacFile :: read_from ( & mut file, ParseOptions :: new ( ) ) . unwrap ( ) ;
14
+ file. rewind ( ) . unwrap ( ) ;
15
+
16
+ let mut vorbis_comments = VorbisComments :: new ( ) ;
17
+ vorbis_comments. set_artist ( String :: from ( "The Artist" ) ) ;
18
+ f. set_vorbis_comments ( vorbis_comments) ;
19
+ f. save_to ( & mut file) . unwrap ( ) ;
20
+ }
21
+ file. rewind ( ) . unwrap ( ) ;
22
+ {
23
+ let f = FlacFile :: read_from ( & mut file, ParseOptions :: new ( ) ) . unwrap ( ) ;
24
+ assert_eq ! (
25
+ f. vorbis_comments( ) . unwrap( ) . artist( ) . as_deref( ) ,
26
+ Some ( "The Artist" )
27
+ ) ;
28
+
29
+ assert_eq ! ( file. seek( SeekFrom :: End ( 0 ) ) . unwrap( ) , 9134 ) ;
30
+ }
31
+ }
32
+
33
+ #[ test]
34
+ #[ ignore] // TODO
35
+ fn test_fuzzed_file ( ) {
36
+ let mut file = temp_file ! ( "tests/taglib/data/segfault.oga" ) ;
37
+ let f = FlacFile :: read_from ( & mut file, ParseOptions :: new ( ) ) ;
38
+ assert ! ( f. is_err( ) ) ;
39
+ }
40
+
41
+ #[ test]
42
+ #[ ignore]
43
+ fn test_split_packets ( ) {
44
+ // Marker test, Lofty does not retain the packet information
45
+ }
You can’t perform that action at this time.
0 commit comments