Skip to content

Commit

Permalink
Merge pull request #290 from MrAnno/build-related-fixes
Browse files Browse the repository at this point in the history
Build related fixes
  • Loading branch information
alltilla authored Sep 18, 2024
2 parents 7296984 + c08f529 commit 39f9b3d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ find_package(FLEX REQUIRED)
find_package(LIBNET REQUIRED)
find_package(Resolv REQUIRED)
find_package(WRAP)
find_package(criterion)
find_package(Inotify)
find_package(LIBCAP)

Expand Down Expand Up @@ -369,17 +368,16 @@ set_target_properties(check-copyright PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES
"copyright-run.log;copyright-err.log")

if (CRITERION_FOUND)
option(BUILD_TESTING "Enable unit tests" ON)
else()
option(BUILD_TESTING "Enable unit tests" OFF)
option(BUILD_TESTING "Enable unit tests" ON)
if (BUILD_TESTING)
find_package (criterion)
endif()

include(add_tests)

if (BUILD_TESTING)
if (NOT CRITERION_FOUND)
message(FATAL_ERROR "BUILD_TESTING enabled without criterion detected!")
message(FATAL_ERROR "BUILD_TESTING is enabled (by default, or explicitely) without criterion detected! You can turn off testing via the -DBUILD_TESTING=OFF cmake option.")
else()
set(CTEST_ENVIRONMENT
"G_SLICE=always-malloc,debug-blocks"
Expand Down
2 changes: 2 additions & 0 deletions lib/template/tests/test_macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Test(macro, test_ipv4_saddr_related_macros)
log_msg_unref(msg);
}

#if SYSLOG_NG_ENABLE_IPV6
Test(macro, test_ipv6_saddr_related_macros)
{
LogMessage *msg = log_msg_new_empty();
Expand All @@ -167,6 +168,7 @@ Test(macro, test_ipv6_mapped_ipv4_saddr_related_macros)
assert_macro_value(M_IP_PROTOCOL, msg, "4", LM_VT_INTEGER);
log_msg_unref(msg);
}
#endif

void
setup(void)
Expand Down
6 changes: 3 additions & 3 deletions modules/grpc/bigquery/bigquery-worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ DestinationWorker::insert_field(const google::protobuf::Reflection *reflection,
}
case FieldDescriptor::CppType::CPPTYPE_INT64:
{
int64_t v;
gint64 v;
if (!type_cast_to_int64(value.str, -1, &v, NULL))
{
type_cast_drop_helper(owner->template_options.on_error, value.str, -1, "integer");
Expand All @@ -237,7 +237,7 @@ DestinationWorker::insert_field(const google::protobuf::Reflection *reflection,
}
case FieldDescriptor::CppType::CPPTYPE_UINT32:
{
int64_t v;
gint64 v;
if (!type_cast_to_int64(value.str, -1, &v, NULL))
{
type_cast_drop_helper(owner->template_options.on_error, value.str, -1, "integer");
Expand All @@ -248,7 +248,7 @@ DestinationWorker::insert_field(const google::protobuf::Reflection *reflection,
}
case FieldDescriptor::CppType::CPPTYPE_UINT64:
{
int64_t v;
gint64 v;
if (!type_cast_to_int64(value.str, -1, &v, NULL))
{
type_cast_drop_helper(owner->template_options.on_error, value.str, -1, "integer");
Expand Down
18 changes: 9 additions & 9 deletions modules/grpc/otel/filterx/object-otel-array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Array::marshal(void)
}

bool
Array::set_subscript(uint64_t index, FilterXObject **value)
Array::set_subscript(guint64 index, FilterXObject **value)
{
FilterXObject *assoc_object = NULL;
if (!any_field_converter.FilterXObjectDirectSetter(array->mutable_values(index), *value, &assoc_object))
Expand All @@ -117,23 +117,23 @@ Array::append(FilterXObject **value)
}

bool
Array::unset_index(uint64_t index)
Array::unset_index(guint64 index)
{
array->mutable_values()->DeleteSubrange(index, 1);
return true;
}

FilterXObject *
Array::get_subscript(uint64_t index)
Array::get_subscript(guint64 index)
{
AnyValue *any_value = array->mutable_values(index);
return any_field_converter.FilterXObjectDirectGetter(any_value);
}

uint64_t
guint64
Array::len() const
{
return (uint64_t) array->values_size();
return (guint64) array->values_size();
}

const ArrayValue &
Expand All @@ -154,7 +154,7 @@ _free(FilterXObject *s)
}

static gboolean
_set_subscript(FilterXList *s, uint64_t index, FilterXObject **new_value)
_set_subscript(FilterXList *s, guint64 index, FilterXObject **new_value)
{
FilterXOtelArray *self = (FilterXOtelArray *) s;

Expand All @@ -170,22 +170,22 @@ _append(FilterXList *s, FilterXObject **new_value)
}

static FilterXObject *
_get_subscript(FilterXList *s, uint64_t index)
_get_subscript(FilterXList *s, guint64 index)
{
FilterXOtelArray *self = (FilterXOtelArray *) s;

return self->cpp->get_subscript(index);
}

static gboolean
_unset_index(FilterXList *s, uint64_t index)
_unset_index(FilterXList *s, guint64 index)
{
FilterXOtelArray *self = (FilterXOtelArray *) s;

return self->cpp->unset_index(index);
}

static uint64_t
static guint64
_len(FilterXList *s)
{
FilterXOtelArray *self = (FilterXOtelArray *) s;
Expand Down
8 changes: 4 additions & 4 deletions modules/grpc/otel/filterx/object-otel-array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class Array
~Array();

std::string marshal();
bool set_subscript(uint64_t index, FilterXObject **value);
FilterXObject *get_subscript(uint64_t index);
bool set_subscript(guint64 index, FilterXObject **value);
FilterXObject *get_subscript(guint64 index);
bool append(FilterXObject **value);
bool unset_index(uint64_t index);
uint64_t len() const;
bool unset_index(guint64 index);
guint64 len() const;
const ArrayValue &get_value() const;

private:
Expand Down
2 changes: 1 addition & 1 deletion modules/grpc/otel/filterx/object-otel-kvlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ _unset_key(FilterXDict *s, FilterXObject *key)
return self->cpp->unset_key(key);
}

static uint64_t
static guint64
_len(FilterXDict *s)
{
FilterXOtelKVList *self = (FilterXOtelKVList *) s;
Expand Down
2 changes: 1 addition & 1 deletion modules/grpc/otel/filterx/otel-field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class OtelSeverityNumberEnumConverter : public ProtobufField
{
if (filterx_object_is_type(object, &FILTERX_TYPE_NAME(integer)))
{
int64_t value;
gint64 value;
g_assert(filterx_integer_unwrap(object, &value));
if (!SeverityNumber_IsValid((int) value))
{
Expand Down

0 comments on commit 39f9b3d

Please sign in to comment.