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