From 628e10b08008c578512687a687439108bebeb7b7 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 13 Oct 2009 19:56:38 -0700 Subject: "Fix" unit test: you can't count on timers being scheduled to not actually also fire in the same 'pump' --- indra/newview/tests/llmediadataclient_test.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index b4700c9bbc..445ec7aa34 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -29,6 +29,8 @@ * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ + +#include "linden_common.h" #include "../llviewerprecompiledheaders.h" #include @@ -210,9 +212,9 @@ namespace tut mediadataclient() { gPostRecords = &mLLSD; -// LLError::setDefaultLevel(LLError::LEVEL_DEBUG); -// LLError::setClassLevel("LLMediaDataClient", LLError::LEVEL_DEBUG); -// LLError::setTagLevel("MediaOnAPrim", LLError::LEVEL_DEBUG); + //LLError::setDefaultLevel(LLError::LEVEL_DEBUG); + //LLError::setClassLevel("LLMediaDataClient", LLError::LEVEL_DEBUG); + //LLError::setTagLevel("MediaOnAPrim", LLError::LEVEL_DEBUG); } LLSD mLLSD; }; @@ -433,12 +435,13 @@ namespace tut // Third, fires queue timer again for (int i=0; isize(), i+1); - ::pump_timers(); + ::pump_timers(); // Should pump (fire) the queue timer, causing a retry timer to be scheduled + // XXX This ensure is not guaranteed, because scheduling a timer might actually get it pumped in the same loop + //ensure("post records " + STR(i), gPostRecords->size(), i+1); + ::pump_timers(); // Should pump (fire) the retry timer, scheduling the queue timer } - // Do some extre pumps to make sure no other timer work occurs. + // Do some extra pumps to make sure no other timer work occurs. ::pump_timers(); ::pump_timers(); ::pump_timers(); -- cgit v1.2.3