Fixed BigInt test cases

This commit is contained in:
Stefan Müller 2024-05-14 16:52:32 +02:00
parent 1caee9ae6e
commit df8b5c32fd
1 changed files with 5 additions and 5 deletions

View File

@ -127,7 +127,7 @@ type
TBigIntSumTestCase = class(TTestCase)
private
procedure Test(const AHexValueLeft, AHexValueRight, AHexValueSum: string);
public
published
procedure TestShort;
procedure TestPositivePlusPositive;
procedure TestNegativePlusNegative;
@ -691,7 +691,7 @@ procedure TBigIntShiftLeftTestCase.TestShort;
begin
// BIN 101
// BIN 101000
Test('5', 3, '40');
Test('5', 3, '28');
end;
procedure TBigIntShiftLeftTestCase.TestShortWithCarry;
@ -734,7 +734,7 @@ begin
a := TBigInt.FromInt64(AValue);
b := TBigInt.FromInt64(AValue);
AssertTrue('Two BigInt from ''' + IntToStr(AValue) + ''' were not equal.', a = b);
AssertFalse('Two BigInt from ''' + IntToStr(AValue) + ''' were not equal.', a <> b);
AssertFalse('Two BigInt from ''' + IntToStr(AValue) + ''' were un-equal.', a <> b);
end;
procedure TBigIntEqualityTestCase.TestEqualHex(const AHexValue: string);
@ -744,7 +744,7 @@ begin
a := TBigInt.FromHexadecimalString(AHexValue);
b := TBigInt.FromHexadecimalString(AHexValue);
AssertTrue('Two BigInt from ''' + AHexValue + ''' were not equal.', a = b);
AssertFalse('Two BigInt from ''' + AHexValue + ''' were not equal.', a <> b);
AssertFalse('Two BigInt from ''' + AHexValue + ''' were un-equal.', a <> b);
end;
procedure TBigIntEqualityTestCase.TestNotEqualHex(const AHexValueLeft, AHexValueRight: string);
@ -753,7 +753,7 @@ var
begin
a := TBigInt.FromHexadecimalString(AHexValueLeft);
b := TBigInt.FromHexadecimalString(AHexValueRight);
AssertTrue('BigInt from ''' + AHexValueLeft + ''' and from ''' + AHexValueRight + ''' were equal.',
AssertTrue('BigInt from ''' + AHexValueLeft + ''' and from ''' + AHexValueRight + ''' were not un-equal.',
a <> b);
AssertFalse('BigInt from ''' + AHexValueLeft + ''' and from ''' + AHexValueRight + ''' were equal.',
a = b);