Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_io
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_io
Commits
d2a7fbed
Commit
d2a7fbed
authored
Dec 09, 2014
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addedd GraphMLWriter unit test
parent
f6749b75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
0 deletions
+89
-0
src/GraphMLWriter_unit_tests.hpp
src/GraphMLWriter_unit_tests.hpp
+89
-0
No files found.
src/GraphMLWriter_unit_tests.hpp
0 → 100644
View file @
d2a7fbed
/*
* GraphMLWriter_unit_tests.hpp
*
* Created on: Dec 9, 2014
* Author: i-bird
*/
#ifndef GRAPHMLWRITER_UNIT_TESTS_HPP_
#define GRAPHMLWRITER_UNIT_TESTS_HPP_
#define GS_SIZE 128
#include "GraphMLWriter.hpp"
#include "Graph/CartesianGraphFactory.hpp"
BOOST_AUTO_TEST_SUITE
(
graphml_writer_test
)
/*!
*
* Test node and edge
*
*/
struct
ne_cp
{
//! The node contain several properties
typedef
boost
::
fusion
::
vector
<
float
,
float
,
float
,
double
,
long
int
,
int
,
std
::
string
>
type
;
typedef
typename
memory_traits_inte
<
type
>::
type
memory_int
;
typedef
typename
memory_traits_lin
<
type
>::
type
memory_lin
;
//! define attributes names
struct
attributes
{
static
const
std
::
string
name
[];
};
//! The data
type
data
;
//! x property id in boost::fusion::vector
static
const
unsigned
int
x
=
0
;
//! y property id in boost::fusion::vector
static
const
unsigned
int
y
=
1
;
//! z property id in boost::fusion::vector
static
const
unsigned
int
z
=
2
;
//! float_num property id in boost::fusion::vector
static
const
unsigned
int
float_num
=
3
;
//! double_num property id in boost::fusion::vector
static
const
unsigned
int
double_num
=
4
;
//! long_num property id in boost::fusion::vector
static
const
unsigned
int
long_num
=
5
;
//! integer property id in boost::fusion::vector
static
const
unsigned
int
integer
=
6
;
//! string property id in boost::fusion::vector
static
const
unsigned
int
string
=
7
;
//! total number of properties boost::fusion::vector
static
const
unsigned
int
max_prop
=
8
;
};
// Initialize the attributes strings array
const
std
::
string
ne_cp
::
attributes
::
name
[]
=
{
"x"
,
"y"
,
"z"
,
"float_num"
,
"double_num"
,
"long_num"
,
"integer"
,
"string"
};
BOOST_AUTO_TEST_CASE
(
graphml_writer_use
)
{
//! Create a graph
CartesianGraphFactory
<
3
,
Graph_CSR
<
ne_cp
,
ne_cp
>>
g_factory
;
// Cartesian grid
std
::
vector
<
size_t
>
sz
;
sz
.
push_back
(
GS_SIZE
);
sz
.
push_back
(
GS_SIZE
);
sz
.
push_back
(
GS_SIZE
);
// Box
Box
<
3
,
float
>
box
({
0.0
,
0.0
,
0.0
},{
1.0
,
1.0
,
1.0
});
Graph_CSR
<
ne_cp
,
ne_cp
>
g_csr
=
g_factory
.
construct
<
5
,
float
,
2
>
(
sz
,
box
);
GraphMLWriter
<
Graph_CSR
<
ne_cp
,
ne_cp
>>
gw
(
g_csr
);
gw
.
write
(
"test_graph.gml"
);
}
BOOST_AUTO_TEST_SUITE_END
()
#endif
/* GRAPHMLWRITER_UNIT_TESTS_HPP_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment