From 2ad896027b79e79ba0071b146fded9bfa1b80cf7 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 8 Oct 2009 21:41:20 +0200 Subject: [PATCH] why doesn't the reverse lookup return a Symbol? damn! I have the vague rememberance that I had a reason for not returning a Symbol. Anyway, here it goes... --- src/proc/control/command-registry.hpp | 2 +- tests/components/proc/control/command-registry-test.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proc/control/command-registry.hpp b/src/proc/control/command-registry.hpp index b650e05d4..956a732bd 100644 --- a/src/proc/control/command-registry.hpp +++ b/src/proc/control/command-registry.hpp @@ -195,7 +195,7 @@ namespace control { * @param cmdInstance using the definition to look up * @return the ID used to register this definition * or \c NULL in case of an "anonymous" command */ - const char* + Symbol findDefinition (Command const& cmdInstance) const { Lock sync(this); diff --git a/tests/components/proc/control/command-registry-test.cpp b/tests/components/proc/control/command-registry-test.cpp index c92509fb3..b23cf2b27 100644 --- a/tests/components/proc/control/command-registry-test.cpp +++ b/tests/components/proc/control/command-registry-test.cpp @@ -112,7 +112,7 @@ namespace test { Command cmd1 = registry.queryIndex (TEST_CMD); ASSERT (cmd1); - ASSERT (string(TEST_CMD) == registry.findDefinition(cmd1)); + ASSERT (TEST_CMD == registry.findDefinition(cmd1)); Command nonexistant = registry.queryIndex("miraculous"); ASSERT (!nonexistant); @@ -149,7 +149,7 @@ namespace test { ASSERT (1+cnt_inst == registry.instance_count()); ASSERT (1+cnt_defs == registry.index_size()); - ASSERT (string(TEST_CMD2) == registry.findDefinition(cmdX)); + ASSERT (TEST_CMD2 == registry.findDefinition(cmdX)); ASSERT ( registry.remove(TEST_CMD2)); ASSERT (!registry.remove("miraculous"));