From bf1d42ff96cbccff8f4a802b2c609fac15502365 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 28 Dec 2010 20:00:06 -0800 Subject: STORM-744 : Make getMetaData pass when all is stubbed --- indra/llkdu/llimagej2ckdu.cpp | 11 ++++++----- indra/llkdu/tests/llimagej2ckdu_test.cpp | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'indra/llkdu') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index c0db63a85b..10ea5685e8 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -229,16 +229,17 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod mCodeStreamp = NULL; } - if (!mInputp) + if (!mInputp && base.getData()) { - llassert_always(base.getData()); // The compressed data has been loaded - // Setup the source for the codestrea + // Setup the source for the codestream mInputp = new LLKDUMemSource(base.getData(), data_size); } - llassert_always(mInputp); - mInputp->reset(); + if (mInputp) + { + mInputp->reset(); + } mCodeStreamp = new kdu_codestream; mCodeStreamp->create(mInputp); diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index b3c3da20e2..1ccee4bb64 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -219,8 +219,9 @@ namespace tut { LLImageJ2C* image = new LLImageJ2C(); BOOL res = mImage->callGetMetadata(*image); - // Trying to set up a data stream with all NIL values will throw an exception that will be caught and will return FALSE - ensure("getMetadata() test failed", res == FALSE); + // Trying to set up a data stream with all NIL values and stubbed KDU will "work" and return TRUE + // Note that is linking with KDU, that call will throw an exception and fail, returning FALSE + ensure("getMetadata() test failed", res == TRUE); } // Test 2 : test decodeImpl() -- cgit v1.2.3