1
- using XDF, Downloads, Test
1
+ using XDF, Downloads, Test, SHA
2
2
3
3
@testset " Minimal XDF file" begin
4
4
url = " https://github.com/xdf-modules/example-files/blob/master/minimal.xdf?raw=true"
74
74
@test d_stream[" segments" ][1 ] == (1 , 12875 )
75
75
@test d_stream[" segments" ][2 ] == (12876 , 27815 )
76
76
end
77
+
78
+ @testset " strings" begin
79
+ file = " test/testdata/test_chunk3.xdf"
80
+ @testset " strings.sha256" begin
81
+ open (file) do f
82
+ @test bytes2hex (sha256 (f)) == " c730991efa078906117aa2accdca5f0ea11c54f43c3884770eba21e5a72edb82"
83
+ end
84
+ end
85
+ @testset " strings.read_xdf" begin
86
+ import XDF
87
+ streams = XDF. read_xdf (file)
88
+ end
89
+ @testset " strings.dejitter" begin
90
+ import XDF
91
+ streams = XDF. read_xdf (file)
92
+ s1 = streams[3735928559 ]
93
+ @test s1[" type" ] == " Marker"
94
+ @test s1[" nchannels" ] == 2
95
+ @test s1[" srate" ] == 1000.0
96
+ @test s1[" dtype" ] == String
97
+ @test size (s1[" data" ]) == (1 , 2 )
98
+ @test s1[" data" ] == [" Marker 0A" " Marker 0A" ]
99
+ s2 = streams[46202862 ]
100
+ @test s2[" type" ] == " EEG"
101
+ @test s2[" nchannels" ] == 64
102
+ @test s2[" srate" ] == 1000.0
103
+ @test s2[" dtype" ] == Float64
104
+ @test size (s2[" data" ]) == (1 , 64 )
105
+ @test sum (s2[" data" ]) == 0.0
106
+ sgs = [XDF. dejitter (streams[k])[" segments" ] for k in keys (streams)]
107
+ @test sgs[1 ] == [(1 , 1 )]
108
+ @test sgs[2 ] == [(1 , 1 )]
109
+ end
110
+ end
0 commit comments