Lines Matching defs:overflow

542    handling of overflow.
550 int overflow;
552 /* Test that overflow is set properly for a large value. */
557 overflow = 1234;
558 value = PyLong_AsLongAndOverflow(num, &overflow);
565 if (overflow != 1)
567 "overflow was not set to 1");
584 overflow = 0;
585 value = PyLong_AsLongAndOverflow(num, &overflow);
592 if (overflow != 1)
594 "overflow was not set to 1");
596 /* Test that overflow is set properly for a large negative value. */
601 overflow = 1234;
602 value = PyLong_AsLongAndOverflow(num, &overflow);
609 if (overflow != -1)
611 "overflow was not set to -1");
628 overflow = 0;
629 value = PyLong_AsLongAndOverflow(num, &overflow);
636 if (overflow != -1)
638 "overflow was not set to -1");
640 /* Test that overflow is cleared properly for small values. */
644 overflow = 1234;
645 value = PyLong_AsLongAndOverflow(num, &overflow);
652 if (overflow != 0)
654 "overflow was not cleared");
659 overflow = 0;
660 value = PyLong_AsLongAndOverflow(num, &overflow);
667 if (overflow != 0)
669 "overflow was set incorrectly");
674 overflow = 1234;
675 value = PyLong_AsLongAndOverflow(num, &overflow);
682 if (overflow != 0)
684 "overflow was not cleared");
689 overflow = 0;
690 value = PyLong_AsLongAndOverflow(num, &overflow);
697 if (overflow != 0)
699 "overflow was not cleared");
706 concentrate on proper handling of overflow.
714 int overflow;
716 /* Test that overflow is set properly for a large value. */
721 overflow = 1234;
722 value = PyLong_AsLongLongAndOverflow(num, &overflow);
729 if (overflow != 1)
731 "overflow was not set to 1");
748 overflow = 0;
749 value = PyLong_AsLongLongAndOverflow(num, &overflow);
756 if (overflow != 1)
758 "overflow was not set to 1");
760 /* Test that overflow is set properly for a large negative value. */
765 overflow = 1234;
766 value = PyLong_AsLongLongAndOverflow(num, &overflow);
773 if (overflow != -1)
775 "overflow was not set to -1");
792 overflow = 0;
793 value = PyLong_AsLongLongAndOverflow(num, &overflow);
800 if (overflow != -1)
802 "overflow was not set to -1");
804 /* Test that overflow is cleared properly for small values. */
808 overflow = 1234;
809 value = PyLong_AsLongLongAndOverflow(num, &overflow);
816 if (overflow != 0)
818 "overflow was not cleared");
823 overflow = 0;
824 value = PyLong_AsLongLongAndOverflow(num, &overflow);
831 if (overflow != 0)
833 "overflow was set incorrectly");
838 overflow = 1234;
839 value = PyLong_AsLongLongAndOverflow(num, &overflow);
846 if (overflow != 0)
848 "overflow was not cleared");
853 overflow = 0;
854 value = PyLong_AsLongLongAndOverflow(num, &overflow);
861 if (overflow != 0)
863 "overflow was not cleared");
870 test overflow handling.
4977 /* Deliberate buffer overflow to check that PyMem_Free() detects
4978 the overflow when debug hooks are installed. */