Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-julialib
Commits
2cc0435c
Verified
Commit
2cc0435c
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into f-release-results
parents
e0a84d69
cba6a1b9
No related branches found
No related tags found
1 merge request
!12
F release results
Pipeline
#13268
passed with warnings
3 years ago
Stage: info
Stage: code-style
Stage: setup
Stage: test
Stage: deploy
Pipeline: CaosDB Julia Integration Tests
#13269
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Entity.jl
+18
-18
18 additions, 18 deletions
src/Entity.jl
test/runtests.jl
+6
-6
6 additions, 6 deletions
test/runtests.jl
with
24 additions
and
24 deletions
src/Entity.jl
+
18
−
18
View file @
2cc0435c
...
...
@@ -771,11 +771,11 @@ function get_value(entity::Ref{_Entity})
if
ent_datatype
[
1
]
in
_caosdb_dtypes
if
!
is_list
if
ent_datatype
[
1
]
==
"INTEGER"
out
=
Ref
{
C
int
}(
0
)
out
=
Ref
{
C
long
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_get_int_value
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
C
int
}),
(
Ref
{
_Entity
},
Ref
{
C
long
}),
entity
,
out
,
)
...
...
@@ -815,7 +815,7 @@ function get_value(entity::Ref{_Entity})
else
list_length
=
get_property_list_length
(
entity
)
if
ent_datatype
[
1
]
==
"INTEGER"
out
=
Vector
{
C
int
}()
out
=
Vector
{
C
long
}()
for
i
::
Cint
=
1
:
list_length
temp
=
get_int_list_value_at
(
entity
,
i
)
append!
(
out
,
temp
)
...
...
@@ -880,11 +880,11 @@ function get_value(property::Ref{_Property})
if
prop_datatype
[
1
]
in
_caosdb_dtypes
if
!
is_list
if
prop_datatype
[
1
]
==
"INTEGER"
out
=
Ref
{
C
int
}(
0
)
out
=
Ref
{
C
long
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_property_get_int_value
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Property
},
Ref
{
C
int
}),
(
Ref
{
_Property
},
Ref
{
C
long
}),
property
,
out
,
)
...
...
@@ -924,7 +924,7 @@ function get_value(property::Ref{_Property})
else
list_length
=
get_property_list_length
(
property
)
if
prop_datatype
[
1
]
==
"INTEGER"
out
=
Vector
{
C
int
}()
out
=
Vector
{
C
long
}()
for
i
::
Cint
=
1
:
list_length
temp
=
get_int_list_value_at
(
property
,
i
)
append!
(
out
,
temp
)
...
...
@@ -1024,11 +1024,11 @@ end
Return the value of the INTEGER list of the given `property` at the position `index`.
"""
function
get_int_list_value_at
(
property
::
Ref
{
_Property
},
index
::
Cint
)
out
=
Ref
{
C
int
}(
0
)
out
=
Ref
{
C
long
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_property_get_int_list_value_at
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Property
},
Ref
{
C
int
},
Cint
),
(
Ref
{
_Property
},
Ref
{
C
long
},
Cint
),
property
,
out
,
index
-
Cint
(
1
),
...
...
@@ -1044,11 +1044,11 @@ end
Return the value of the INTEGER list of the given `entity` at the position `index`.
"""
function
get_int_list_value_at
(
entity
::
Ref
{
_Entity
},
index
::
Cint
)
out
=
Ref
{
C
int
}(
0
)
out
=
Ref
{
C
long
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_get_int_list_value_at
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
C
int
},
Cint
),
(
Ref
{
_Entity
},
Ref
{
C
long
},
Cint
),
entity
,
out
,
index
-
Cint
(
1
),
...
...
@@ -1985,9 +1985,9 @@ function set_value(
err_code
=
ccall
(
(
:
caosdb_entity_entity_set_int_value
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
C
int
),
(
Ref
{
_Entity
},
C
long
),
entity
,
C
int
(
value
),
C
long
(
value
),
)
elseif
in_type
<:
Number
err_code
=
ccall
(
...
...
@@ -2022,9 +2022,9 @@ function set_value(
err_code
=
ccall
(
(
:
caosdb_entity_entity_set_int_list_value
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ptr
{
C
int
},
Cint
),
(
Ref
{
_Entity
},
Ptr
{
C
long
},
Cint
),
entity
,
Vector
{
C
int
}(
value
),
Vector
{
C
long
}(
value
),
vec_length
,
)
elseif
in_type
<:
Vector
{
T
}
where
{
T
<:
Number
}
...
...
@@ -2074,9 +2074,9 @@ function set_value(
err_code
=
ccall
(
(
:
caosdb_entity_property_set_int_value
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Property
},
C
int
),
(
Ref
{
_Property
},
C
long
),
property
,
C
int
(
value
),
C
long
(
value
),
)
elseif
in_type
<:
Number
err_code
=
ccall
(
...
...
@@ -2111,9 +2111,9 @@ function set_value(
err_code
=
ccall
(
(
:
caosdb_entity_property_set_int_list_value
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Property
},
Ptr
{
C
int
},
Cint
),
(
Ref
{
_Property
},
Ptr
{
C
long
},
Cint
),
property
,
Vector
{
C
int
}(
value
),
Vector
{
C
long
}(
value
),
vec_length
,
)
elseif
in_type
<:
Vector
{
T
}
where
{
T
<:
Number
}
...
...
This diff is collapsed.
Click to expand it.
test/runtests.jl
+
6
−
6
View file @
2cc0435c
...
...
@@ -152,8 +152,8 @@ using CaosDB
@test
length
(
CaosDB
.
Entity
.
get_properties
(
rec_with_parent_and_props
))
==
3
# properties can be accessed as a list
# TODO(
henrik, daniel)
@test
CaosDB
.
Entity
.
get_value
(
# TODO(
florian) Fix this once we have a reasonable treatment of value objects in Extern C.
@test
_broken
CaosDB
.
Entity
.
get_value
(
CaosDB
.
Entity
.
get_properties
(
rec_with_parent_and_props
)[
1
],
)
==
"2"
type
,
is_ref
,
is_list
=
CaosDB
.
Entity
.
get_datatype
(
...
...
@@ -263,10 +263,10 @@ using CaosDB
CaosDB
.
Entity
.
set_value
(
ref_list_prop
,
[
"some_id"
,
"another_id"
])
@test
CaosDB
.
Entity
.
get_value
(
int_list_prop
)
==
[
123
,
456
]
@test
CaosDB
.
Entity
.
get_value
(
double_list_prop
)
==
[
10.246
,
3.14
]
@test
CaosDB
.
Entity
.
get_value
(
bool_list_prop
)
==
=
[
true
,
false
]
@test
CaosDB
.
Entity
.
get_value
(
bool_list_prop
)
==
[
true
,
false
]
@test
CaosDB
.
Entity
.
get_value
(
string_list_prop
)
==
[
"Hello"
,
"World"
]
@test
CaosDB
.
Entity
.
get_value
(
ref_list_prop
)
==
[
"some_id"
,
"another_id"
]
@test
isa
(
CaosDB
.
Entity
.
get_value
(
int_list_prop
),
Vector
{
C
int
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
int_list_prop
),
Vector
{
C
long
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
double_list_prop
),
Vector
{
Cdouble
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
bool_list_prop
),
Vector
{
Bool
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
string_list_prop
),
Vector
{
String
})
...
...
@@ -345,10 +345,10 @@ using CaosDB
CaosDB
.
Entity
.
set_value
(
ref_list_prop
,
[
"some_id"
,
"another_id"
])
@test
CaosDB
.
Entity
.
get_value
(
int_list_prop
)
==
[
123
,
456
]
@test
CaosDB
.
Entity
.
get_value
(
double_list_prop
)
==
[
10.246
,
3.14
]
@test
CaosDB
.
Entity
.
get_value
(
bool_list_prop
)
==
=
[
true
,
false
]
@test
CaosDB
.
Entity
.
get_value
(
bool_list_prop
)
==
[
true
,
false
]
@test
CaosDB
.
Entity
.
get_value
(
string_list_prop
)
==
[
"Hello"
,
"World"
]
@test
CaosDB
.
Entity
.
get_value
(
ref_list_prop
)
==
[
"some_id"
,
"another_id"
]
@test
isa
(
CaosDB
.
Entity
.
get_value
(
int_list_prop
),
Vector
{
C
int
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
int_list_prop
),
Vector
{
C
long
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
double_list_prop
),
Vector
{
Cdouble
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
bool_list_prop
),
Vector
{
Bool
})
@test
isa
(
CaosDB
.
Entity
.
get_value
(
string_list_prop
),
Vector
{
String
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment