[Mono-list] SqlDecimal problems

ville vi64pa@koti.soon.fi
Wed, 23 Oct 2002 22:34:30 +0300

Weird! I made test suite for SqlDecimal and it didn't work correctly. For 

// FIXME: windows: Conversion overflow
AssertEquals  ("#B03", Decimal.MaxValue, SqlDecimal.MaxValue.Value);
AssertEquals ("#B04", Decimal.MinValue, SqlDecimal.MinValue.Value);

It is obvious that ms wont handle SqlDecimal internal value as a decimal,  but 
ain't this bug or what?

And another (much weirder):

// FIXME: 6464.6464 --> 64646464 ??? with windows
AssertEquals ("#N13a", (int)64646464, Test1.ToSqlInt32 ().Value);
// FIXME: 12.12m --> 1212 ??? with windows
AssertEquals ("#N13b", (int)1212, new SqlDecimal(12.12m).ToSqlInt32 ().Value);

and with ToInt64 or ToInt16 everything went alright.

somebody help me, please.