Browse Source

Print also resource key when attempting to overwrite final resource.

pull/7/head
Vladimír Vondruš 13 years ago
parent
commit
5707a138d1
  1. 2
      src/ResourceManager.h
  2. 2
      src/Test/ResourceManagerTest.cpp

2
src/ResourceManager.h

@ -157,7 +157,7 @@ namespace Implementation {
/* Cannot change resource with already final state */
CORRADE_ASSERT(it == _data.end() || it->second.state != ResourceDataState::Final,
"ResourceManager::set(): cannot change already final resource", );
"ResourceManager::set(): cannot change already final resource" << key, );
/* If nothing is referencing reference-counted resource, we're done */
if(policy == ResourcePolicy::ReferenceCounted && (it == _data.end() || it->second.referenceCount == 0)) {

2
src/Test/ResourceManagerTest.cpp

@ -162,7 +162,7 @@ void ResourceManagerTest::basic() {
Error::setOutput(&out);
rm.set(answerKey, new std::int32_t(43), ResourceDataState::Mutable, ResourcePolicy::Resident);
CORRADE_COMPARE(*theAnswer, 42);
CORRADE_COMPARE(out.str(), "ResourceManager::set(): cannot change already final resource\n");
CORRADE_COMPARE(out.str(), "ResourceManager::set(): cannot change already final resource " + answerKey.hexString() + '\n');
/* But non-final can be changed */
rm.set(questionKey, new std::int32_t(20), ResourceDataState::Final, ResourcePolicy::Resident);

Loading…
Cancel
Save