summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ingen_bench.cpp12
-rw-r--r--tests/ingen_test.cpp12
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp
index c7eb336c..d840eea9 100644
--- a/tests/ingen_bench.cpp
+++ b/tests/ingen_bench.cpp
@@ -115,10 +115,10 @@ run(int argc, char** argv)
// Run benchmark
// TODO: Set up real-time scheduling for this and worker threads
- ingen::Clock clock;
- const uint32_t n_test_frames = 1 << 20;
- const uint32_t block_length = 4096;
- const uint64_t t_start = clock.now_microseconds();
+ const ingen::Clock clock;
+ const uint32_t n_test_frames = 1 << 20;
+ const uint32_t block_length = 4096;
+ const uint64_t t_start = clock.now_microseconds();
for (uint32_t i = 0; i < n_test_frames; i += block_length) {
world->engine()->advance(block_length);
world->engine()->run(block_length);
@@ -127,8 +127,8 @@ run(int argc, char** argv)
const uint64_t t_end = clock.now_microseconds();
// Write log output
- std::unique_ptr<FILE, decltype(&fclose)> log{fopen(out_file.c_str(), "a"),
- &fclose};
+ const std::unique_ptr<FILE, decltype(&fclose)> log{fopen(out_file.c_str(), "a"),
+ &fclose};
if (ftell(log.get()) == 0) {
fprintf(log.get(), "# n_threads\trun_time\treal_time\n");
}
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index ec89c40c..ca026e4a 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -67,8 +67,8 @@ ingen_try(bool cond, const char* msg)
FilePath
real_file_path(const char* path)
{
- std::unique_ptr<char, FreeDeleter<char>> real_path{realpath(path, nullptr),
- FreeDeleter<char>{}};
+ const std::unique_ptr<char, FreeDeleter<char>> real_path{realpath(path, nullptr),
+ FreeDeleter<char>{}};
return FilePath{real_path.get()};
}
@@ -146,7 +146,7 @@ run(int argc, char** argv)
*world->interface());
// AtomWriter to serialise responses from the engine
- std::shared_ptr<Interface> client(new TestClient(world->log()));
+ const std::shared_ptr<Interface> client{new TestClient(world->log())};
world->interface()->set_respondee(client);
world->engine()->register_client(client);
@@ -162,10 +162,10 @@ run(int argc, char** argv)
SerdEnv* env = serd_env_new(&cmds_file_uri);
cmds->load_file(env, SERD_TURTLE, run_path);
- Sord::Node nil;
- int n_events = 0;
+ const Sord::Node nil;
+ int n_events = 0;
for (;; ++n_events) {
- std::string subject_str = fmt("msg%1%", n_events);
+ const std::string subject_str = fmt("msg%1%", n_events);
Sord::URI subject(*world->rdf_world(),
subject_str,