-
Notifications
You must be signed in to change notification settings - Fork 47
/
flags_test.go
169 lines (150 loc) · 5.36 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// Code generated by astiav. DO NOT EDIT.
package astiav
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestBuffersinkFlags(t *testing.T) {
fs := NewBuffersinkFlags(BuffersinkFlag(1))
require.True(t, fs.Has(BuffersinkFlag(1)))
fs = fs.Add(BuffersinkFlag(2))
require.True(t, fs.Has(BuffersinkFlag(2)))
fs = fs.Del(BuffersinkFlag(2))
require.False(t, fs.Has(BuffersinkFlag(2)))
}
func TestBuffersrcFlags(t *testing.T) {
fs := NewBuffersrcFlags(BuffersrcFlag(1))
require.True(t, fs.Has(BuffersrcFlag(1)))
fs = fs.Add(BuffersrcFlag(2))
require.True(t, fs.Has(BuffersrcFlag(2)))
fs = fs.Del(BuffersrcFlag(2))
require.False(t, fs.Has(BuffersrcFlag(2)))
}
func TestCodecContextFlags(t *testing.T) {
fs := NewCodecContextFlags(CodecContextFlag(1))
require.True(t, fs.Has(CodecContextFlag(1)))
fs = fs.Add(CodecContextFlag(2))
require.True(t, fs.Has(CodecContextFlag(2)))
fs = fs.Del(CodecContextFlag(2))
require.False(t, fs.Has(CodecContextFlag(2)))
}
func TestCodecContextFlags2(t *testing.T) {
fs := NewCodecContextFlags2(CodecContextFlag2(1))
require.True(t, fs.Has(CodecContextFlag2(1)))
fs = fs.Add(CodecContextFlag2(2))
require.True(t, fs.Has(CodecContextFlag2(2)))
fs = fs.Del(CodecContextFlag2(2))
require.False(t, fs.Has(CodecContextFlag2(2)))
}
func TestCodecHardwareConfigMethodFlags(t *testing.T) {
fs := NewCodecHardwareConfigMethodFlags(CodecHardwareConfigMethodFlag(1))
require.True(t, fs.Has(CodecHardwareConfigMethodFlag(1)))
fs = fs.Add(CodecHardwareConfigMethodFlag(2))
require.True(t, fs.Has(CodecHardwareConfigMethodFlag(2)))
fs = fs.Del(CodecHardwareConfigMethodFlag(2))
require.False(t, fs.Has(CodecHardwareConfigMethodFlag(2)))
}
func TestDictionaryFlags(t *testing.T) {
fs := NewDictionaryFlags(DictionaryFlag(1))
require.True(t, fs.Has(DictionaryFlag(1)))
fs = fs.Add(DictionaryFlag(2))
require.True(t, fs.Has(DictionaryFlag(2)))
fs = fs.Del(DictionaryFlag(2))
require.False(t, fs.Has(DictionaryFlag(2)))
}
func TestFilterFlags(t *testing.T) {
fs := NewFilterFlags(FilterFlag(1))
require.True(t, fs.Has(FilterFlag(1)))
fs = fs.Add(FilterFlag(2))
require.True(t, fs.Has(FilterFlag(2)))
fs = fs.Del(FilterFlag(2))
require.False(t, fs.Has(FilterFlag(2)))
}
func TestFilterCommandFlags(t *testing.T) {
fs := NewFilterCommandFlags(FilterCommandFlag(1))
require.True(t, fs.Has(FilterCommandFlag(1)))
fs = fs.Add(FilterCommandFlag(2))
require.True(t, fs.Has(FilterCommandFlag(2)))
fs = fs.Del(FilterCommandFlag(2))
require.False(t, fs.Has(FilterCommandFlag(2)))
}
func TestFormatContextFlags(t *testing.T) {
fs := NewFormatContextFlags(FormatContextFlag(1))
require.True(t, fs.Has(FormatContextFlag(1)))
fs = fs.Add(FormatContextFlag(2))
require.True(t, fs.Has(FormatContextFlag(2)))
fs = fs.Del(FormatContextFlag(2))
require.False(t, fs.Has(FormatContextFlag(2)))
}
func TestFormatContextCtxFlags(t *testing.T) {
fs := NewFormatContextCtxFlags(FormatContextCtxFlag(1))
require.True(t, fs.Has(FormatContextCtxFlag(1)))
fs = fs.Add(FormatContextCtxFlag(2))
require.True(t, fs.Has(FormatContextCtxFlag(2)))
fs = fs.Del(FormatContextCtxFlag(2))
require.False(t, fs.Has(FormatContextCtxFlag(2)))
}
func TestFormatEventFlags(t *testing.T) {
fs := NewFormatEventFlags(FormatEventFlag(1))
require.True(t, fs.Has(FormatEventFlag(1)))
fs = fs.Add(FormatEventFlag(2))
require.True(t, fs.Has(FormatEventFlag(2)))
fs = fs.Del(FormatEventFlag(2))
require.False(t, fs.Has(FormatEventFlag(2)))
}
func TestIOContextFlags(t *testing.T) {
fs := NewIOContextFlags(IOContextFlag(1))
require.True(t, fs.Has(IOContextFlag(1)))
fs = fs.Add(IOContextFlag(2))
require.True(t, fs.Has(IOContextFlag(2)))
fs = fs.Del(IOContextFlag(2))
require.False(t, fs.Has(IOContextFlag(2)))
}
func TestIOFormatFlags(t *testing.T) {
fs := NewIOFormatFlags(IOFormatFlag(1))
require.True(t, fs.Has(IOFormatFlag(1)))
fs = fs.Add(IOFormatFlag(2))
require.True(t, fs.Has(IOFormatFlag(2)))
fs = fs.Del(IOFormatFlag(2))
require.False(t, fs.Has(IOFormatFlag(2)))
}
func TestOptionSearchFlags(t *testing.T) {
fs := NewOptionSearchFlags(OptionSearchFlag(1))
require.True(t, fs.Has(OptionSearchFlag(1)))
fs = fs.Add(OptionSearchFlag(2))
require.True(t, fs.Has(OptionSearchFlag(2)))
fs = fs.Del(OptionSearchFlag(2))
require.False(t, fs.Has(OptionSearchFlag(2)))
}
func TestPacketFlags(t *testing.T) {
fs := NewPacketFlags(PacketFlag(1))
require.True(t, fs.Has(PacketFlag(1)))
fs = fs.Add(PacketFlag(2))
require.True(t, fs.Has(PacketFlag(2)))
fs = fs.Del(PacketFlag(2))
require.False(t, fs.Has(PacketFlag(2)))
}
func TestSeekFlags(t *testing.T) {
fs := NewSeekFlags(SeekFlag(1))
require.True(t, fs.Has(SeekFlag(1)))
fs = fs.Add(SeekFlag(2))
require.True(t, fs.Has(SeekFlag(2)))
fs = fs.Del(SeekFlag(2))
require.False(t, fs.Has(SeekFlag(2)))
}
func TestSoftwareScaleContextFlags(t *testing.T) {
fs := NewSoftwareScaleContextFlags(SoftwareScaleContextFlag(1))
require.True(t, fs.Has(SoftwareScaleContextFlag(1)))
fs = fs.Add(SoftwareScaleContextFlag(2))
require.True(t, fs.Has(SoftwareScaleContextFlag(2)))
fs = fs.Del(SoftwareScaleContextFlag(2))
require.False(t, fs.Has(SoftwareScaleContextFlag(2)))
}
func TestStreamEventFlags(t *testing.T) {
fs := NewStreamEventFlags(StreamEventFlag(1))
require.True(t, fs.Has(StreamEventFlag(1)))
fs = fs.Add(StreamEventFlag(2))
require.True(t, fs.Has(StreamEventFlag(2)))
fs = fs.Del(StreamEventFlag(2))
require.False(t, fs.Has(StreamEventFlag(2)))
}