Skip to content
Snippets Groups Projects
Commit e89fc870 authored by florian's avatar florian
Browse files

ENH: Add IsUndefined to datatypes in extern c

parent 9b0c5988
No related branches found
No related tags found
1 merge request!25F cpp to string
Pipeline #13992 passed
Pipeline: caosdb-cppinttest

#13993

    ...@@ -412,6 +412,7 @@ int caosdb_entity_parent_get_description(caosdb_entity_parent *parent, char **ou ...@@ -412,6 +412,7 @@ int caosdb_entity_parent_get_description(caosdb_entity_parent *parent, char **ou
    int caosdb_entity_message_get_code(caosdb_entity_message *message, int *out); int caosdb_entity_message_get_code(caosdb_entity_message *message, int *out);
    int caosdb_entity_message_get_description(caosdb_entity_message *message, char **out); int caosdb_entity_message_get_description(caosdb_entity_message *message, char **out);
    int caosdb_entity_datatype_is_undefined(caosdb_entity_datatype *datatype, bool *out);
    int caosdb_entity_datatype_is_atomic(caosdb_entity_datatype *datatype, bool *out); int caosdb_entity_datatype_is_atomic(caosdb_entity_datatype *datatype, bool *out);
    int caosdb_entity_datatype_is_reference(caosdb_entity_datatype *datatype, bool *out); int caosdb_entity_datatype_is_reference(caosdb_entity_datatype *datatype, bool *out);
    int caosdb_entity_datatype_is_list_of_atomic(caosdb_entity_datatype *datatype, bool *out); int caosdb_entity_datatype_is_list_of_atomic(caosdb_entity_datatype *datatype, bool *out);
    ......
    ...@@ -991,6 +991,14 @@ ERROR_RETURN_CODE( ...@@ -991,6 +991,14 @@ ERROR_RETURN_CODE(
    return 0; return 0;
    }) })
    ERROR_RETURN_CODE(GENERIC_ERROR,
    int caosdb_entity_datatype_is_undefined(caosdb_entity_datatype *datatype,
    bool *out),
    {
    auto *wrapped_datatype = WRAPPED_DATATYPE_CAST(datatype);
    *out = wrapped_datatype->IsUndefined();
    return 0;
    })
    ERROR_RETURN_CODE(GENERIC_ERROR, ERROR_RETURN_CODE(GENERIC_ERROR,
    int caosdb_entity_datatype_is_atomic(caosdb_entity_datatype *datatype, bool *out), int caosdb_entity_datatype_is_atomic(caosdb_entity_datatype *datatype, bool *out),
    { {
    ......
    ...@@ -150,6 +150,9 @@ TEST_F(test_ccaosdb, test_datatype) { ...@@ -150,6 +150,9 @@ TEST_F(test_ccaosdb, test_datatype) {
    EXPECT_EQ(return_code, 0); EXPECT_EQ(return_code, 0);
    bool is_a(false); bool is_a(false);
    return_code = caosdb_entity_datatype_is_undefined(&atomic, &is_a);
    EXPECT_EQ(return_code, 0);
    EXPECT_FALSE(is_a);
    return_code = caosdb_entity_datatype_is_atomic(&atomic, &is_a); return_code = caosdb_entity_datatype_is_atomic(&atomic, &is_a);
    EXPECT_EQ(return_code, 0); EXPECT_EQ(return_code, 0);
    EXPECT_TRUE(is_a); EXPECT_TRUE(is_a);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment