Duke's Big Numbers 1.0
C++ and Blueprint libraries for performing math, analysis, and formatting with really large numbers (>10e308).
Loading...
Searching...
No Matches
TestHelper.h
1// Copyright (C)2023 Smiling Cat Entertainment, LTD. All Rights Reserved.
2
3#pragma once
4
9{
16 static FString PrettyPrintLeftShiftedNumber(int32 base, int32 shift)
17 {
18 FString prettyShift;
19 if (shift != 0)
20 {
21 prettyShift += FString::Printf(TEXT("<<%d"), shift);
22 }
23 return FString::Printf(TEXT("(%d%s)"), base, *prettyShift);
24 }
25
32 static bool GetEqualityTestExpectation(int32 compareResult, int32 operatorMode)
33 {
34 bool expected = false;
35 switch (operatorMode)
36 {
37 case 0: //Equal
38 expected = (compareResult == 0);
39 break;
40 case 1: //NotEqual
41 expected = (compareResult != 0);
42 break;
43 case 2: //Less
44 expected = (compareResult < 0);
45 break;
46 case 3: //Greater
47 expected = (compareResult > 0);
48 break;
49 case 4: //LessEqual
50 expected = (compareResult <= 0);
51 break;
52 case 5: //GreaterEqual
53 expected = (compareResult >= 0);
54 break;
55 }
56 return expected;
57 }
58};
Definition: TestHelper.h:9
static FString PrettyPrintLeftShiftedNumber(int32 base, int32 shift)
Definition: TestHelper.h:16
static bool GetEqualityTestExpectation(int32 compareResult, int32 operatorMode)
Definition: TestHelper.h:32