diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:19:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:07:37 +0000 |
commit | b485aab7e71c1625cfc27e0f92c9509f42378458 (patch) | |
tree | ae9abe108601079d1679194de237c9a435ae5b55 /src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test | |
parent | Adding upstream version 1.44.3. (diff) | |
download | netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip |
Adding upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test')
-rw-r--r-- | src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/Makefile | 19 | ||||
-rw-r--r-- | src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/plugin_test.c | 58 |
2 files changed, 77 insertions, 0 deletions
diff --git a/src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/Makefile b/src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/Makefile new file mode 100644 index 000000000..a39f18270 --- /dev/null +++ b/src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/Makefile @@ -0,0 +1,19 @@ +LIBNAME= plugin_test +LIBVER= 1 + +-include ../../Makefile.config + +SRCS= plugin_test.c + +OBJS= $(SRCS:.c=.o) + +# For rdkafka.h +CPPFLAGS+=-I../../src + +all: lib + +include ../../mklove/Makefile.base + +clean: lib-clean + +-include $(DEPS) diff --git a/src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/plugin_test.c b/src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/plugin_test.c new file mode 100644 index 000000000..54639a5a8 --- /dev/null +++ b/src/fluent-bit/lib/librdkafka-2.1.0/tests/plugin_test/plugin_test.c @@ -0,0 +1,58 @@ +/* + * librdkafka - The Apache Kafka C/C++ library + * + * Copyright (c) 2017 Magnus Edenhill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +/** + * @brief Plugin test library + */ + +#include <stdio.h> +#include <assert.h> + +/* typical include path outside tests is <librdkafka/rdkafka.h> */ +#include "rdkafka.h" + + + +static void *my_opaque = (void *)0x5678; +/* + * Common methods + */ +rd_kafka_resp_err_t conf_init(rd_kafka_conf_t *conf, + void **plug_opaquep, + char *errstr, + size_t errstr_size) { + printf("plugin conf_init called!\n"); + *plug_opaquep = my_opaque; + return RD_KAFKA_RESP_ERR_NO_ERROR; +} + +void conf_destroy(const rd_kafka_conf_t *conf, void *plug_opaque) { + assert(plug_opaque == plug_opaque); + printf("plugin destroy called\n"); +} |