summaryrefslogtreecommitdiff
path: root/cs/src/Ice/Assert.cs
blob: 8c6640217453a07af7c510e63932bb4cb4102d55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// **********************************************************************
//
// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

using IceInternal;

namespace IceUtil
{

    public sealed class Assert
    {
	//
	// Both Mono (as of 18 May 2005) and .NET guarantee that writes to
	// the Console are safe during system shutdown.
	//
	public static void
	FinalizerAssert(bool b)
	{
#if DEBUG
	    if(!b)
            {
		System.Console.Error.WriteLine("Assertion failure:");
		System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(true);
		System.Console.Error.WriteLine(st);
            }
#endif
	}
    }

}