35 Operand = (-1537977259);
39 return UNIT_TEST_PASSED;
66 return UNIT_TEST_PASSED;
88 Operand = (-1537977259);
96 Operand = (0x5babababefefefef);
100 Operand = (-6605562033422200815);
104 return UNIT_TEST_PASSED;
109TestSafeIntnToUint32 (
120 Operand = 0xabababab;
129 Operand = (0x5babababefefefef);
133 Operand = (-6605562033422200815);
137 return UNIT_TEST_PASSED;
142TestSafeUintnToUint32 (
153 Operand = 0xabababab;
162 Operand = (0xababababefefefef);
166 return UNIT_TEST_PASSED;
182 Operand = 0x5babababefefefef;
191 Operand = (0xababababefefefef);
195 return UNIT_TEST_PASSED;
200TestSafeUintnToInt64 (
211 Operand = 0x5babababefefefef;
220 Operand = (0xababababefefefef);
224 return UNIT_TEST_PASSED;
240 Operand = 0x5babababefefefef;
246 return UNIT_TEST_PASSED;
251TestSafeInt64ToUintn (
262 Operand = 0x5babababefefefef;
271 Operand = (-6605562033422200815);
275 return UNIT_TEST_PASSED;
280TestSafeUint64ToIntn (
291 Operand = 0x5babababefefefef;
300 Operand = (0xababababefefefef);
304 return UNIT_TEST_PASSED;
309TestSafeUint64ToUintn (
320 Operand = 0xababababefefefef;
326 return UNIT_TEST_PASSED;
343 Augend = 0x3a3a3a3a12121212;
344 Addend = 0x3a3a3a3a12121212;
353 Augend = 0xababababefefefef;
354 Addend = 0xbcbcbcbcdededede;
358 return UNIT_TEST_PASSED;
376 Augend = 0x3a3a3a3a3a3a3a3a;
377 Addend = 0x3a3a3a3a3a3a3a3a;
383 Augend = (-4195730024608447034);
384 Addend = (-4195730024608447034);
392 Augend = 0x5a5a5a5a5a5a5a5a;
393 Addend = 0x5a5a5a5a5a5a5a5a;
397 Augend = (-6510615555426900570);
398 Addend = (-6510615555426900570);
402 return UNIT_TEST_PASSED;
419 Minuend = 0x5a5a5a5a5a5a5a5a;
420 Subtrahend = 0x3b3b3b3b3b3b3b3b;
429 Minuend = 0x5a5a5a5a5a5a5a5a;
430 Subtrahend = 0x6d6d6d6d6d6d6d6d;
434 return UNIT_TEST_PASSED;
452 Minuend = 0x5a5a5a5a5a5a5a5a;
453 Subtrahend = 0x3a3a3a3a3a3a3a3a;
455 Status =
SafeIntnSub (Minuend, Subtrahend, &Result);
459 Minuend = 0x3a3a3a3a3a3a3a3a;
460 Subtrahend = 0x5a5a5a5a5a5a5a5a;
461 Status =
SafeIntnSub (Minuend, Subtrahend, &Result);
468 Minuend = (-8825501086245354106);
469 Subtrahend = 8825501086245354106;
470 Status =
SafeIntnSub (Minuend, Subtrahend, &Result);
473 Minuend = (8825501086245354106);
474 Subtrahend = (-8825501086245354106);
475 Status =
SafeIntnSub (Minuend, Subtrahend, &Result);
478 return UNIT_TEST_PASSED;
495 Multiplicand = 0x123456789a;
496 Multiplier = 0x1234567;
505 Multiplicand = 0x123456789a;
506 Multiplier = 0x12345678;
510 return UNIT_TEST_PASSED;
528 Multiplicand = 0x123456789;
529 Multiplier = 0x6789abcd;
531 Status =
SafeIntnMult (Multiplicand, Multiplier, &Result);
538 Multiplicand = 0x123456789;
539 Multiplier = 0xa789abcd;
540 Status =
SafeIntnMult (Multiplicand, Multiplier, &Result);
543 return UNIT_TEST_PASSED;
#define RETURN_BUFFER_TOO_SMALL
RETURN_STATUS EFIAPI SafeInt64ToIntn(IN INT64 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUint32ToIntn(IN UINT32 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUintnAdd(IN UINTN Augend, IN UINTN Addend, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnToInt32(IN INTN Operand, OUT INT32 *Result)
RETURN_STATUS EFIAPI SafeUintnMult(IN UINTN Multiplicand, IN UINTN Multiplier, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUintnToIntn(IN UINTN Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeIntnToUint32(IN INTN Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeUintnToUint32(IN UINTN Operand, OUT UINT32 *Result)
RETURN_STATUS EFIAPI SafeIntnMult(IN INTN Multiplicand, IN INTN Multiplier, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeIntnSub(IN INTN Minuend, IN INTN Subtrahend, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUint64ToIntn(IN UINT64 Operand, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeUintnToInt64(IN UINTN Operand, OUT INT64 *Result)
RETURN_STATUS EFIAPI SafeInt32ToUintn(IN INT32 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeIntnAdd(IN INTN Augend, IN INTN Addend, OUT INTN *Result)
RETURN_STATUS EFIAPI SafeInt64ToUintn(IN INT64 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUint64ToUintn(IN UINT64 Operand, OUT UINTN *Result)
RETURN_STATUS EFIAPI SafeUintnSub(IN UINTN Minuend, IN UINTN Subtrahend, OUT UINTN *Result)
#define UT_ASSERT_EQUAL(ValueA, ValueB)
#define UT_ASSERT_NOT_EFI_ERROR(Status)