@@ -156,6 +156,45 @@ TEST(ChannelTest, StreamingChannelWithFifoDepth) {
156
156
EXPECT_EQ (ch.GetStrictness (), ChannelStrictness::kProvenMutuallyExclusive );
157
157
}
158
158
159
+ TEST (ChannelTest, StreamingChannelWithFifoConfigSerializesFifoConfigCorrectly) {
160
+ Package p (" my_package" );
161
+
162
+ auto ch_with_fifo_config = [&](FifoConfig fifo_config) {
163
+ return StreamingChannel (
164
+ " my_channel" , 42 , ChannelOps::kSendReceive , p.GetBitsType (32 ), {},
165
+ /* fifo_config=*/ fifo_config, FlowControl::kNone ,
166
+ ChannelStrictness::kProvenMutuallyExclusive , ChannelMetadataProto ());
167
+ };
168
+ EXPECT_THAT (ch_with_fifo_config (FifoConfig (/* depth=*/ 123 , /* bypass=*/ false ,
169
+ /* register_push_outputs=*/ false ,
170
+ /* register_pop_outputs=*/ false ))
171
+ .ToString (),
172
+ AllOf (HasSubstr (" fifo_depth=123" ), HasSubstr (" bypass=false" ),
173
+ HasSubstr (" register_push_outputs=false" ),
174
+ HasSubstr (" register_pop_outputs=false" )));
175
+ EXPECT_THAT (ch_with_fifo_config (FifoConfig (/* depth=*/ 123 , /* bypass=*/ true ,
176
+ /* register_push_outputs=*/ false ,
177
+ /* register_pop_outputs=*/ false ))
178
+ .ToString (),
179
+ AllOf (HasSubstr (" fifo_depth=123" ), HasSubstr (" bypass=true" ),
180
+ HasSubstr (" register_push_outputs=false" ),
181
+ HasSubstr (" register_pop_outputs=false" )));
182
+ EXPECT_THAT (ch_with_fifo_config (FifoConfig (/* depth=*/ 123 , /* bypass=*/ false ,
183
+ /* register_push_outputs=*/ true ,
184
+ /* register_pop_outputs=*/ false ))
185
+ .ToString (),
186
+ AllOf (HasSubstr (" fifo_depth=123" ), HasSubstr (" bypass=false" ),
187
+ HasSubstr (" register_push_outputs=true" ),
188
+ HasSubstr (" register_pop_outputs=false" )));
189
+ EXPECT_THAT (ch_with_fifo_config (FifoConfig (/* depth=*/ 123 , /* bypass=*/ false ,
190
+ /* register_push_outputs=*/ false ,
191
+ /* register_pop_outputs=*/ true ))
192
+ .ToString (),
193
+ AllOf (HasSubstr (" fifo_depth=123" ), HasSubstr (" bypass=false" ),
194
+ HasSubstr (" register_push_outputs=false" ),
195
+ HasSubstr (" register_pop_outputs=true" )));
196
+ }
197
+
159
198
TEST (ChannelTest, StreamingToStringParses) {
160
199
Package p (" my_package" );
161
200
std::vector<Value> initial_values = {
0 commit comments