mirror of
https://github.com/SSCLI/sscli_20021101
synced 2026-06-08 12:28:57 +00:00
9fa3874800
Moved the original file to the archive subfolder.
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
// ==++==
|
|
//
|
|
//
|
|
// Copyright (c) 2002 Microsoft Corporation. All rights reserved.
|
|
//
|
|
// The use and distribution terms for this software are contained in the file
|
|
// named license.txt, which can be found in the root of this distribution.
|
|
// By using this software in any fashion, you are agreeing to be bound by the
|
|
// terms of this license.
|
|
//
|
|
// You must not remove this notice, or any other, from this software.
|
|
//
|
|
//
|
|
// ==--==
|
|
using System.IO;
|
|
using System.Text;
|
|
using System;
|
|
public class BugAddYears
|
|
{
|
|
public virtual void runTest()
|
|
{
|
|
DateTime dt2;
|
|
DateTime dt3;
|
|
dt3 = DateTime.Now;
|
|
try
|
|
{
|
|
dt2 = dt3.AddYears(Int32.MinValue);
|
|
Console.WriteLine("Bug??? Exception not thrown, {0}", dt2);
|
|
}
|
|
catch(ArgumentOutOfRangeException)
|
|
{
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
Console.WriteLine("Wrong exception thrown, " + ex.GetType().Name);
|
|
}
|
|
try
|
|
{
|
|
dt2 = dt3.AddYears(Int32.MaxValue);
|
|
Console.WriteLine("Bug??? Exception not thrown, {0}", dt2);
|
|
}
|
|
catch(ArgumentOutOfRangeException)
|
|
{
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
Console.WriteLine("Wrong exception thrown, " + ex.GetType().Name);
|
|
}
|
|
}
|
|
public static void Main( String[] args )
|
|
{
|
|
BugAddYears cbA = new BugAddYears();
|
|
cbA.runTest();
|
|
}
|
|
}
|