From 765dcc1e36146ba1118daa623ef1113e11a08d8d Mon Sep 17 00:00:00 2001
From: Andreas Schenk <andreas_schenk@hms.harvard.edu>
Date: Thu, 14 Feb 2013 16:46:20 -0500
Subject: [PATCH] changed unit tests for image handle to reflect changes in
 observer, which now retains an internal reference to the observed image

---
 modules/img/base/tests/test_image.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/img/base/tests/test_image.cc b/modules/img/base/tests/test_image.cc
index 89a7663bc..8d5d2e1db 100644
--- a/modules/img/base/tests/test_image.cc
+++ b/modules/img/base/tests/test_image.cc
@@ -209,9 +209,10 @@ void test_Observer()
   }
   // ih and ih2 go out-of-scope
 
-  BOOST_CHECK(to1->release_count==1);
+  // observer retains internal reference, therefore no call to release should happen
+  BOOST_CHECK(to1->release_count==0);
 
-  BOOST_CHECK_THROW(to1->CheckData(), InvalidObserver);
+  BOOST_CHECK_NO_THROW(to1->CheckData());
 
   delete to1;
 }
-- 
GitLab