sourcehook/test/testevents.h
branchhookman_autogen
changeset 432 f26dd3e3030b
parent 294 0d87bc8606f8
child 459 53e363661d53
     1.1 --- a/sourcehook/test/testevents.h	Sun Oct 21 21:18:40 2007 +0000
     1.2 +++ b/sourcehook/test/testevents.h	Sun Oct 21 21:47:53 2007 +0000
     1.3 @@ -31,9 +31,25 @@
     1.4  		return (typeid(other) == typeid(this)) ? true : false;
     1.5  	}
     1.6  
     1.7 +	virtual bool Ignore()
     1.8 +	{
     1.9 +		return false;
    1.10 +	}
    1.11 +
    1.12  	virtual void Dump() = 0;
    1.13  };
    1.14  
    1.15 +struct IgnoreState : public State
    1.16 +{
    1.17 +	virtual bool Ignore()
    1.18 +	{
    1.19 +		return true;
    1.20 +	}
    1.21 +	virtual void Dump()
    1.22 +	{
    1.23 +	}
    1.24 +};
    1.25 +
    1.26  typedef std::list<State*> StateList;
    1.27  namespace
    1.28  {
    1.29 @@ -53,6 +69,8 @@
    1.30  			State *cs = va_arg(argptr, State*);
    1.31  			if (!cs)
    1.32  				break;
    1.33 +			if (cs->Ignore())
    1.34 +				continue;
    1.35  			requiredstates.push_back(cs);
    1.36  		}
    1.37  		va_end(argptr);
    1.38 @@ -86,6 +104,14 @@
    1.39  			}
    1.40  		}
    1.41  
    1.42 +		if (!ok && g_Verbose)
    1.43 +		{
    1.44 +			std::cout << std::endl << "FAIL: Should be:" << std::endl;
    1.45 +			DumpStates(&requiredstates);
    1.46 +			std::cout << std::endl << "FAIL: Is:" << std::endl;
    1.47 +			DumpStates(sl);
    1.48 +		}
    1.49 +
    1.50  		for (StateList::iterator iter = requiredstates.begin(); iter != requiredstates.end(); ++iter)
    1.51  			delete *iter;
    1.52  		for (StateList::iterator iter = sl->begin(); iter != sl->end(); ++iter)