11#include " catch.hpp"
2- #include " helpers.h"
32#include " helper_type.hpp"
3+ #include " helpers.h"
44#include < cstdint>
55#include < lsl_cpp.h>
66
7- TEMPLATE_TEST_CASE (" datatransfer" , " [datatransfer][basic]" , char , int16_t , int32_t , int64_t , float , double ) {
7+ TEMPLATE_TEST_CASE (
8+ " datatransfer" , " [datatransfer][basic]" , char , int16_t , int32_t , int64_t , float , double ) {
89 const int numBounces = sizeof (TestType) * 8 ;
910 double timestamps[numBounces][2 ];
10- const char * name = SampleType<TestType>::fmt_string ();
11- lsl::channel_format_t cf = (lsl::channel_format_t ) SampleType<TestType>::chan_fmt;
11+ const char * name = SampleType<TestType>::fmt_string ();
12+ lsl::channel_format_t cf = (lsl::channel_format_t )SampleType<TestType>::chan_fmt;
1213
1314 Streampair sp (create_streampair (
1415 lsl::stream_info (name, " Bounce" , 2 , lsl::IRREGULAR_RATE, cf, " streamid" )));
@@ -37,8 +38,8 @@ TEMPLATE_TEST_CASE("datatransfer", "[datatransfer][basic]", char, int16_t, int32
3738TEST_CASE (" data datatransfer" , " [datatransfer][multi][string]" ) {
3839 const std::size_t numChannels = 2 ;
3940
40- Streampair sp (create_streampair (
41- lsl::stream_info ( " cf_string" , " DataType" , numChannels, lsl::IRREGULAR_RATE, lsl::cf_string, " streamid" )));
41+ Streampair sp (create_streampair (lsl::stream_info (
42+ " cf_string" , " DataType" , numChannels, lsl::IRREGULAR_RATE, lsl::cf_string, " streamid" )));
4243
4344 std::vector<std::string> sent_data, received_data (numChannels);
4445 const char nullstr[] = " \0 Test\0 string\0 with\0 nulls" ;
@@ -49,23 +50,22 @@ TEST_CASE("data datatransfer", "[datatransfer][multi][string]") {
4950 CHECK (sp.in_ .pull_sample (received_data, 5 .) != 0.0 );
5051 CHECK (received_data[0 ] == sent_data[0 ]);
5152 // Manually check second string for equality to avoid printing the entire test string
52- if (received_data[1 ] != sent_data[1 ])
53+ if (received_data[1 ] != sent_data[1 ])
5354 FAIL (" Sent large string data doesn't match received data" );
5455}
5556
5657TEST_CASE (" TypeConversion" , " [datatransfer][types][basic]" ) {
57- Streampair sp{
58- create_streampair ( lsl::stream_info (" TypeConversion" , " int2str2int" , 1 , 1 , lsl::cf_string, " TypeConversion" ))};
58+ Streampair sp{create_streampair (
59+ lsl::stream_info (" TypeConversion" , " int2str2int" , 1 , 1 , lsl::cf_string, " TypeConversion" ))};
5960 const int num_bounces = 31 ;
6061 std::vector<int32_t > data;
6162 for (int i = 0 ; i < num_bounces; ++i) data.push_back (1 << i);
6263
6364 sp.out_ .push_chunk_multiplexed (data);
6465
65- for (int32_t val: data) {
66+ for (int32_t val : data) {
6667 int32_t result;
6768 sp.in_ .pull_sample (&result, 1 , 1 .);
6869 CHECK (result == val);
6970 }
7071}
71-
0 commit comments