Re: Test exception

"Charlie Poole" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <007b01c83243$7c00bd40$85c8000a@FERRARI>
Hello Haiping,

> Can somebody give me an example of testing exception in C++?
> 
> I tried use the same way as we did in C# but it does not work:
> [Test]
> [ExpectedException(typeof(std::bad_alloc))]
> void TestCurrentChannel();

It's usually best to say more than "does not work" :-)

I am guessing that your problem here is that ExpectedException
requires a managed exception type derived from System.Exception,
but you may need to give more info about what is happening
for us to be sure.

Charlie



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.