forked from asticode/go-astiav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags_test.go
134 lines (119 loc) · 4.77 KB
/
flags_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Code generated by astiav. DO NOT EDIT.
package astiav_test
import (
"testing"
"github.com/asticode/go-astiav"
"github.com/stretchr/testify/require"
)
func TestBuffersinkFlags(t *testing.T) {
fs := astiav.NewBuffersinkFlags(astiav.BuffersinkFlag(1))
require.True(t, fs.Has(astiav.BuffersinkFlag(1)))
fs = fs.Add(astiav.BuffersinkFlag(2))
require.True(t, fs.Has(astiav.BuffersinkFlag(2)))
fs = fs.Del(astiav.BuffersinkFlag(2))
require.False(t, fs.Has(astiav.BuffersinkFlag(2)))
}
func TestBuffersrcFlags(t *testing.T) {
fs := astiav.NewBuffersrcFlags(astiav.BuffersrcFlag(1))
require.True(t, fs.Has(astiav.BuffersrcFlag(1)))
fs = fs.Add(astiav.BuffersrcFlag(2))
require.True(t, fs.Has(astiav.BuffersrcFlag(2)))
fs = fs.Del(astiav.BuffersrcFlag(2))
require.False(t, fs.Has(astiav.BuffersrcFlag(2)))
}
func TestCodecContextFlags(t *testing.T) {
fs := astiav.NewCodecContextFlags(astiav.CodecContextFlag(1))
require.True(t, fs.Has(astiav.CodecContextFlag(1)))
fs = fs.Add(astiav.CodecContextFlag(2))
require.True(t, fs.Has(astiav.CodecContextFlag(2)))
fs = fs.Del(astiav.CodecContextFlag(2))
require.False(t, fs.Has(astiav.CodecContextFlag(2)))
}
func TestCodecContextFlags2(t *testing.T) {
fs := astiav.NewCodecContextFlags2(astiav.CodecContextFlag2(1))
require.True(t, fs.Has(astiav.CodecContextFlag2(1)))
fs = fs.Add(astiav.CodecContextFlag2(2))
require.True(t, fs.Has(astiav.CodecContextFlag2(2)))
fs = fs.Del(astiav.CodecContextFlag2(2))
require.False(t, fs.Has(astiav.CodecContextFlag2(2)))
}
func TestDictionaryFlags(t *testing.T) {
fs := astiav.NewDictionaryFlags(astiav.DictionaryFlag(1))
require.True(t, fs.Has(astiav.DictionaryFlag(1)))
fs = fs.Add(astiav.DictionaryFlag(2))
require.True(t, fs.Has(astiav.DictionaryFlag(2)))
fs = fs.Del(astiav.DictionaryFlag(2))
require.False(t, fs.Has(astiav.DictionaryFlag(2)))
}
func TestFilterCommandFlags(t *testing.T) {
fs := astiav.NewFilterCommandFlags(astiav.FilterCommandFlag(1))
require.True(t, fs.Has(astiav.FilterCommandFlag(1)))
fs = fs.Add(astiav.FilterCommandFlag(2))
require.True(t, fs.Has(astiav.FilterCommandFlag(2)))
fs = fs.Del(astiav.FilterCommandFlag(2))
require.False(t, fs.Has(astiav.FilterCommandFlag(2)))
}
func TestFormatContextCtxFlags(t *testing.T) {
fs := astiav.NewFormatContextCtxFlags(astiav.FormatContextCtxFlag(1))
require.True(t, fs.Has(astiav.FormatContextCtxFlag(1)))
fs = fs.Add(astiav.FormatContextCtxFlag(2))
require.True(t, fs.Has(astiav.FormatContextCtxFlag(2)))
fs = fs.Del(astiav.FormatContextCtxFlag(2))
require.False(t, fs.Has(astiav.FormatContextCtxFlag(2)))
}
func TestFormatContextFlags(t *testing.T) {
fs := astiav.NewFormatContextFlags(astiav.FormatContextFlag(1))
require.True(t, fs.Has(astiav.FormatContextFlag(1)))
fs = fs.Add(astiav.FormatContextFlag(2))
require.True(t, fs.Has(astiav.FormatContextFlag(2)))
fs = fs.Del(astiav.FormatContextFlag(2))
require.False(t, fs.Has(astiav.FormatContextFlag(2)))
}
func TestFormatEventFlags(t *testing.T) {
fs := astiav.NewFormatEventFlags(astiav.FormatEventFlag(1))
require.True(t, fs.Has(astiav.FormatEventFlag(1)))
fs = fs.Add(astiav.FormatEventFlag(2))
require.True(t, fs.Has(astiav.FormatEventFlag(2)))
fs = fs.Del(astiav.FormatEventFlag(2))
require.False(t, fs.Has(astiav.FormatEventFlag(2)))
}
func TestIOContextFlags(t *testing.T) {
fs := astiav.NewIOContextFlags(astiav.IOContextFlag(1))
require.True(t, fs.Has(astiav.IOContextFlag(1)))
fs = fs.Add(astiav.IOContextFlag(2))
require.True(t, fs.Has(astiav.IOContextFlag(2)))
fs = fs.Del(astiav.IOContextFlag(2))
require.False(t, fs.Has(astiav.IOContextFlag(2)))
}
func TestIOFormatFlags(t *testing.T) {
fs := astiav.NewIOFormatFlags(astiav.IOFormatFlag(1))
require.True(t, fs.Has(astiav.IOFormatFlag(1)))
fs = fs.Add(astiav.IOFormatFlag(2))
require.True(t, fs.Has(astiav.IOFormatFlag(2)))
fs = fs.Del(astiav.IOFormatFlag(2))
require.False(t, fs.Has(astiav.IOFormatFlag(2)))
}
func TestPacketFlags(t *testing.T) {
fs := astiav.NewPacketFlags(astiav.PacketFlag(1))
require.True(t, fs.Has(astiav.PacketFlag(1)))
fs = fs.Add(astiav.PacketFlag(2))
require.True(t, fs.Has(astiav.PacketFlag(2)))
fs = fs.Del(astiav.PacketFlag(2))
require.False(t, fs.Has(astiav.PacketFlag(2)))
}
func TestSeekFlags(t *testing.T) {
fs := astiav.NewSeekFlags(astiav.SeekFlag(1))
require.True(t, fs.Has(astiav.SeekFlag(1)))
fs = fs.Add(astiav.SeekFlag(2))
require.True(t, fs.Has(astiav.SeekFlag(2)))
fs = fs.Del(astiav.SeekFlag(2))
require.False(t, fs.Has(astiav.SeekFlag(2)))
}
func TestStreamEventFlags(t *testing.T) {
fs := astiav.NewStreamEventFlags(astiav.StreamEventFlag(1))
require.True(t, fs.Has(astiav.StreamEventFlag(1)))
fs = fs.Add(astiav.StreamEventFlag(2))
require.True(t, fs.Has(astiav.StreamEventFlag(2)))
fs = fs.Del(astiav.StreamEventFlag(2))
require.False(t, fs.Has(astiav.StreamEventFlag(2)))
}