mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-01 19:18:04 +00:00
Fixed buffer test array initialization warning for clang
This commit is contained in:
@@ -43,7 +43,7 @@ TEST_CASE("construction", "[buffer]") {
|
||||
// From vector
|
||||
const vector<uint8_t> vector_data(str_data.begin(), str_data.end());
|
||||
// From array
|
||||
const array<char,12> array_data{'H','e','l','l','o',' ','w','o','r','l','d','!'};
|
||||
const array<char,12> array_data{{'H','e','l','l','o',' ','w','o','r','l','d','!'}};
|
||||
// From raw array
|
||||
const char raw_array[12]{'H','e','l','l','o',' ','w','o','r','l','d','!'};
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ using namespace cppkafka;
|
||||
static Configuration make_producer_config() {
|
||||
Configuration config = {
|
||||
{ "metadata.broker.list", KAFKA_TEST_INSTANCE },
|
||||
{ "max.in.flight", 1 }
|
||||
};
|
||||
return config;
|
||||
}
|
||||
@@ -82,7 +83,7 @@ TEST_CASE("roundrobin consumer test", "[roundrobin consumer]") {
|
||||
|
||||
// push 3 messages in each partition
|
||||
for (int i = 0; i < total_messages; ++i) {
|
||||
producer.produce(MessageBuilder(KAFKA_TOPICS[0])
|
||||
producer.sync_produce(MessageBuilder(KAFKA_TOPICS[0])
|
||||
.partition(i % KAFKA_NUM_PARTITIONS)
|
||||
.payload(payload));
|
||||
}
|
||||
@@ -101,7 +102,7 @@ TEST_CASE("roundrobin consumer test", "[roundrobin consumer]") {
|
||||
// find first polled partition index
|
||||
partition_idx = runner.get_messages()[i].get_partition();
|
||||
}
|
||||
REQUIRE(runner.get_messages()[i].get_partition() == partition_order[i+partition_idx]);
|
||||
CHECK(runner.get_messages()[i].get_partition() == partition_order[i+partition_idx]);
|
||||
REQUIRE((string)runner.get_messages()[i].get_payload() == payload);
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@ TEST_CASE("roundrobin consumer test", "[roundrobin consumer]") {
|
||||
payload = "SerialPolling";
|
||||
// push 3 messages in each partition
|
||||
for (int i = 0; i < total_messages; ++i) {
|
||||
producer.produce(MessageBuilder(KAFKA_TOPICS[0]).partition(i%KAFKA_NUM_PARTITIONS).payload(payload));
|
||||
producer.sync_produce(MessageBuilder(KAFKA_TOPICS[0]).partition(i%KAFKA_NUM_PARTITIONS).payload(payload));
|
||||
}
|
||||
producer.flush();
|
||||
serial_runner.try_join();
|
||||
|
||||
Reference in New Issue
Block a user