summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 11:50:31 +0200
committerDavid Robillard <d@drobilla.net>2020-08-01 16:48:06 +0200
commit358c0a4140406c8c38138a88aa03a4fc0ec6e7ee (patch)
tree21a0c0397ca9bd8e67136c472d8146bb3a22a204 /tests
parentb453818f17a84c01d679088e5a377e244a231981 (diff)
downloadingen-358c0a4140406c8c38138a88aa03a4fc0ec6e7ee.tar.gz
ingen-358c0a4140406c8c38138a88aa03a4fc0ec6e7ee.tar.bz2
ingen-358c0a4140406c8c38138a88aa03a4fc0ec6e7ee.zip
Use modern casts
Diffstat (limited to 'tests')
-rw-r--r--tests/ingen_bench.cpp8
-rw-r--r--tests/ingen_test.cpp15
2 files changed, 14 insertions, 9 deletions
diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp
index 0a042f94..2741e5d6 100644
--- a/tests/ingen_bench.cpp
+++ b/tests/ingen_bench.cpp
@@ -82,11 +82,13 @@ main(int argc, char** argv)
}
// Get start graph and output file options
- const std::string start_graph = real_path((const char*)load.get_body());
- const std::string out_file = (const char*)out.get_body();
+ const std::string start_graph =
+ real_path(static_cast<const char*>(load.get_body()));
+
+ const std::string out_file = static_cast<const char*>(out.get_body());
if (start_graph.empty()) {
cerr << "error: initial graph '"
- << ((const char*)load.get_body())
+ << static_cast<const char*>(load.get_body())
<< "' does not exist" << endl;
return EXIT_FAILURE;
}
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index 4d9823bc..605b25fc 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -94,8 +94,8 @@ main(int argc, char** argv)
}
// Get start graph and commands file options
- const FilePath load_path = real_file_path((const char*)load.get_body());
- const FilePath run_path = real_file_path((const char*)execute.get_body());
+ const FilePath load_path = real_file_path(static_cast<const char*>(load.get_body()));
+ const FilePath run_path = real_file_path(static_cast<const char*>(execute.get_body()));
if (load_path.empty()) {
cerr << "error: initial graph '" << load_path << "' does not exist" << endl;
@@ -142,10 +142,13 @@ main(int argc, char** argv)
SerdURI cmds_base;
SerdNode cmds_file_uri = serd_node_new_file_uri(
- (const uint8_t*)run_path.c_str(),
+ reinterpret_cast<const uint8_t*>(run_path.c_str()),
nullptr, &cmds_base, true);
- Sord::Model* cmds = new Sord::Model(*world->rdf_world(),
- (const char*)cmds_file_uri.buf);
+
+ Sord::Model* cmds =
+ new Sord::Model(*world->rdf_world(),
+ reinterpret_cast<const char*>(cmds_file_uri.buf));
+
SerdEnv* env = serd_env_new(&cmds_file_uri);
cmds->load_file(env, SERD_TURTLE, run_path);
Sord::Node nil;
@@ -153,7 +156,7 @@ main(int argc, char** argv)
for (;; ++n_events) {
std::string subject_str = fmt("msg%1%", n_events);
Sord::URI subject(*world->rdf_world(), subject_str,
- (const char*)cmds_file_uri.buf);
+ reinterpret_cast<const char*>(cmds_file_uri.buf));
Sord::Iter iter = cmds->find(subject, nil, nil);
if (iter.end()) {
break;